コード例 #1
0
    def run(cls, directory: 'Service', storage: ServiceData, pd: ParamDict,
            *args):
        if not args:
            return cls.need_help()

        resp = Tools.get(Tools.FlowerFont, {"sentence": args[0]})
        messages = []
        if not resp['supported']:
            messages.append('暂无完全支持的花字体')
        else:
            messages.append('以下为完全支持的花字体')
            for font in resp['supported']:
                messages.append(font['sentence'])

        if resp['unsupported']:
            messages.append('下方有部分字符无法转换')
            for font in resp['unsupported']:
                messages.append(font['sentence'])
        return '\n'.join(messages)
コード例 #2
0
 def btnTools_click(self):
     tools = Tools()
     tools.run(ui.cbTools.currentData())
コード例 #3
0
    def show(self, parentin=None):
        from Base.utility import getVersion, getBuild
        global dialog, ui, parent
        ui = Ui_frmModelAnalysis()
        QtWidgets.QApplication.setStyle(
            QtWidgets.QStyleFactory.create('Fusion'))
        if parentin is not None:
            dialog = MainWindow(parentin)
        else:
            dialog = MainWindow()
        ui.setupUi(dialog)
        self.set_events(self)

        tools = Tools()
        tools.combo(ui.cbTools)

        ui.tabWidget.setCurrentIndex(0)
        # Unsupervised
        ui.cbMAU.addItem("MatLab, SK Clustering: Agglomerative", 10002)
        ui.cbMAU.addItem("MatLab, SK Clustering: Birch", 10003)
        ui.cbMAU.addItem("MatLab, SK Clustering: Gaussian Mixture", 10004)
        ui.cbMAU.addItem("MatLab, SK Clustering: KMeans", 10000)
        ui.cbMAU.addItem("MatLab, SK Clustering: Spectral", 10001)
        ui.cbMAU.addItem(
            "MatLab, SK RSA: Session Level Representational Similarity Analysis",
            20007)
        ui.cbMAU.addItem(
            "MatLab, SK RSA: Group Level Representational Similarity Analysis",
            20008)
        ui.cbMAU.addItem(
            "MatLab, NumPy RSA: Session Level Representational Similarity Analysis",
            20000)
        ui.cbMAU.addItem(
            "MatLab, NumPy RSA: Group Level Representational Similarity Analysis",
            20001)
        ui.cbMAU.addItem(
            "MatLab, Tensorflow RSA: Session Level Gradient Representational Similarity Analysis",
            20002)
        ui.cbMAU.addItem(
            "MatLab, Tensorflow RSA: Session Level Deep-Kernel Representational Similarity Analysis",
            20004)
        ui.cbMAU.addItem(
            "MatLab, Tensorflow RSA: Group Level Gradient Representational Similarity Analysis",
            20003)
        ui.cbMAU.addItem(
            "MatLab, Tensorflow RSA: Group Level Multi-Deep-Kernel Representational Similarity Analysis",
            20005)
        ui.cbMAU.addItem(
            "MatLab, Tensorflow RSA: Group Level Single-Deep-Kernel Representational Similarity Analysis",
            20006)

        # Supervised
        ui.cbMAS.addItem("MatLab, MVPA, SK Classification: AdaBoost", 80005)
        ui.cbMAS.addItem("MatLab, MVPA, SK Classification: Decision Tree",
                         80001)
        ui.cbMAS.addItem(
            "MatLab, MVPA, SK Classification: Gaussian Naive Bayes", 80000)
        ui.cbMAS.addItem(
            "MatLab, MVPA, SK Classification: Linear Support Vector Machine (liblinear)",
            10001)
        ui.cbMAS.addItem(
            "MatLab, MVPA, SK Classification: Multi-Layer Perceptron (MLP)",
            80002)
        ui.cbMAS.addItem(
            "MatLab, MVPA, SK Classification: Nu Support Vector Machine (libsvm)",
            10002)
        ui.cbMAS.addItem("MatLab, MVPA, SK Classification: Random Forest",
                         80004)
        ui.cbMAS.addItem(
            "MatLab, MVPA, SK Classification: Stochastic Gradient Descent based approaches",
            80003)
        ui.cbMAS.addItem(
            "MatLab, MVPA, SK Classification: Support Vector Machine (libsvm)",
            10000)

        dialog.setWindowTitle("easy fMRI model analysis - V" + getVersion() +
                              "B" + getBuild())
        dialog.setWindowFlags(dialog.windowFlags()
                              | QtCore.Qt.CustomizeWindowHint)
        dialog.setWindowFlags(dialog.windowFlags()
                              & ~QtCore.Qt.WindowMaximizeButtonHint)
        dialog.setFixedSize(dialog.size())
        dialog.show()
コード例 #4
0
ファイル: frmMainMenu.py プロジェクト: jishanling/easyfmri
    def show(self):
        from Base.utility import getVersion, getBuild
        global dialog, ui
        ui = Ui_frmMainMenuGUI()
        QtWidgets.QApplication.setStyle(
            QtWidgets.QStyleFactory.create('Fusion'))
        dialog = QtWidgets.QMainWindow()
        ui.setupUi(dialog)
        self.set_events(self)

        tools = Tools()
        tools.combo(ui.cbTools)
        print()
        print(20 * "#" + " Platform Information " + 20 * "#")
        # Base Info
        print("Base:", os.name)
        # OS Info
        try:
            import platform
            print("OS:", platform.system())
            print("Kernel:", platform.release())
        except:
            pass
        # Python Info
        try:
            pythonInfo = str(sys.version).split("\n")
            print("Python:", pythonInfo[0])
            print("C Compiler:", pythonInfo[1])

        except:
            pass
        print(20 * "#" + " Software Information " + 20 * "#")
        try:
            ezdir = str(os.environ['EASYFMRI'])
            if len(ezdir):
                ui.txtEZDIR.setText(ezdir)
                assert os.path.isfile(ezdir + "/main.py")
                print("Easy fMRI directory is " + ezdir)
            else:
                print(
                    "WARNING: cannot find $EASYFMRI! Please setup ~/.startupscript or ~/.zstartupscript"
                )
                msgBox = QMessageBox()
                msgBox.setText(
                    "WARNING: cannot find $EASYFMRI! Please setup ~/.startupscript or ~/.zstartupscript"
                )
                msgBox.setIcon(QMessageBox.Critical)
                msgBox.setStandardButtons(QMessageBox.Ok)
                msgBox.exec_()
        except:
            print(
                "WARNING: cannot find $EASYFMRI! Please setup ~/.startupscript or ~/.zstartupscript"
            )
            msgBox = QMessageBox()
            msgBox.setText(
                "WARNING: cannot find $EASYFMRI! Please setup ~/.startupscript or ~/.zstartupscript"
            )
            msgBox.setIcon(QMessageBox.Critical)
            msgBox.setStandardButtons(QMessageBox.Ok)
            msgBox.exec_()
        if has_git_branch():
            ui.cbSource.addItem("Fast via pull request", ["", "", False, True])
        ui.cbSource.addItem(
            "GitLab (Clone/Full)",
            ["gitlab.com/easyfmri/easyfmri.git", "https", False, False])
        ui.cbSource.addItem(
            "GitHub (Clone/Full)",
            ["github.com/easyfmri/easyfmri.git", "https", False, False])

        dialog.setWindowTitle(
            f"easy fMRI - V{getVersion()}B{getBuild()} ({getGitBranch()})")

        dialog.setWindowFlags(dialog.windowFlags()
                              | QtCore.Qt.CustomizeWindowHint)
        dialog.setWindowFlags(dialog.windowFlags()
                              & ~QtCore.Qt.WindowMaximizeButtonHint)
        dialog.setFixedSize(dialog.size())
        dialog.show()