コード例 #1
0
    def show(self):
        from Base.utility import getDirSpace, getDirSpaceINI
        global dialog
        global ui
        ui = Ui_frmWholeBrainROI()
        QtWidgets.QApplication.setStyle(
            QtWidgets.QStyleFactory.create('Fusion'))
        dialog = QtWidgets.QMainWindow()
        ui.setupUi(dialog)
        self.set_events(self)
        ui.tabWidget_2.setCurrentIndex(0)

        # Load Setting History
        history = History()
        histories = history.load_history()
        ui.txtSSSetting.clear()
        for history in histories:
            ui.txtSSSetting.addItem(history)
        ui.txtSSSetting.setCurrentText("")

        # Default Values for Input File
        ui.txtSSInFile.addItem(
            "$MAINDIR$/sub-$SUB$/func/sub-$SUB$_task-$TASK$_run-$RUN$_analyze.feat/mask.nii.gz"
        )
        ui.txtSSInFile.addItem(
            "$MAINDIR$/sub-$SUB$/func/sub-$SUB$_task-$TASK$_run-$RUN$_analyze.feat/std_mask.nii.gz"
        )

        # Default Values for Metric
        ui.cbMetric.addItem("Intersection of voxels from all masks", "inter")

        # Default Values for Space
        ui.txtSSSpace.addItem(DefaultSpace())
        ProgramPath = os.path.dirname(os.path.abspath(__file__))
        try:
            spaceINI = str.rsplit(open(getDirSpaceINI()).read(), "\n")
            for space in spaceINI:
                if len(space):
                    ui.txtSSSpace.addItem(getDirSpace() + space)

            ui.txtSSSpace.setCurrentIndex(0)
        except:
            msgBox = QMessageBox()
            msgBox.setText("Cannot find MNI files!")
            msgBox.setIcon(QMessageBox.Critical)
            msgBox.setStandardButtons(QMessageBox.Ok)
            msgBox.exec_()

        dialog.setWindowTitle("easy fMRI whole brain ROI - V" + getVersion() +
                              "B" + getBuild())
        dialog.setWindowFlags(dialog.windowFlags()
                              | QtCore.Qt.CustomizeWindowHint)
        dialog.setWindowFlags(dialog.windowFlags()
                              & ~QtCore.Qt.WindowMaximizeButtonHint)
        dialog.setFixedSize(dialog.size())
        dialog.show()
コード例 #2
0
    def show(self):
        global dialog
        global ui
        ui = Ui_frmMatNITF()
        QtWidgets.QApplication.setStyle(
            QtWidgets.QStyleFactory.create('Fusion'))
        dialog = QtWidgets.QMainWindow()
        ui.setupUi(dialog)
        self.set_events(self)
        ui.tabWidget.setCurrentIndex(0)

        # SS Default Values for Space
        try:
            spaceINI = str.rsplit(open(getDirSpaceINI()).read(), "\n")
            for space in spaceINI:
                if len(space):
                    ui.txtSSSpace.addItem(getDirSpace() + space)

            ui.txtSSSpace.setCurrentIndex(1)
        except:
            msgBox = QMessageBox()
            msgBox.setText("Cannot find MNI files!")
            msgBox.setIcon(QMessageBox.Critical)
            msgBox.setStandardButtons(QMessageBox.Ok)
            msgBox.exec_()

        afni = AFNI()
        afni.setting()
        if not afni.Validate:
            msgBox = QMessageBox()
            msgBox.setText("Cannot find AFNI setting!")
            msgBox.setIcon(QMessageBox.Critical)
            msgBox.setStandardButtons(QMessageBox.Ok)
            msgBox.exec_()
        else:
            ui.txtFAFNI.setText(afni.COPY)
            ui.txtFSUMA.setText(afni.REFIT)

        # Default Values for Threshold type
        ui.cbThType.addItem("Without Thresholding", "no")
        ui.cbThType.addItem("Minimum Thresholding", "min")
        ui.cbThType.addItem("Maximum Thresholding", "max")
        ui.cbThType.addItem("Extremum Thresholding", "ext")

        dialog.setWindowTitle("easy fMRI Convert Matrix to Nifti1 - V" +
                              getVersion() + "B" + getBuild())
        dialog.setWindowFlags(dialog.windowFlags()
                              | QtCore.Qt.CustomizeWindowHint)
        dialog.setWindowFlags(dialog.windowFlags()
                              & ~QtCore.Qt.WindowMaximizeButtonHint)
        dialog.setFixedSize(dialog.size())
        dialog.show()
コード例 #3
0
    def set_defaults(self):
        from Base.utility import getDirSpace, getDirSpaceINI
        global ui
        # Default Values for Space
        ui.txtSpace.clear()
        try:
            spaceINI = str.rsplit(open(getDirSpaceINI()).read(), "\n")
            for space in spaceINI:
                if len(space):
                    ui.txtSpace.addItem(getDirSpace() + space)
            ui.txtSpace.setCurrentIndex(0)
        except:
            msgBox = QMessageBox()
            msgBox.setText("Cannot find MNI files!")
            msgBox.setIcon(QMessageBox.Critical)
            msgBox.setStandardButtons(QMessageBox.Ok)
            msgBox.exec_()

        # Search items
        ui.cbSearch.clear()
        ui.cbSearch.addItem("Already virtually aligned (no search)")
        ui.cbSearch.addItem("Not aligned, but same orientation")
        ui.cbSearch.addItem("Incorrect oriented")
        ui.cbSearch.setCurrentIndex(1)

        # Cost Function
        ui.cbCostFunction.clear()
        ui.cbCostFunction.addItem("Correlation Ratio", "corratio")
        ui.cbCostFunction.addItem("Mutual Information", "mutualinfo")
        ui.cbCostFunction.addItem("Normalised Mutual Information", "normmi")
        ui.cbCostFunction.addItem("Normalised Correlation (intra-modal)",
                                  "normcorr")
        ui.cbCostFunction.addItem("Least Squares (intra-modal)", "leastsq")

        # Interpolation
        ui.cbInter.clear()
        ui.cbInter.addItem("Tri-Linear", "trilinear")
        ui.cbInter.addItem("Nearest Neighbour", "nearestneighbour")
        ui.cbInter.addItem("Spline", "spline")