Пример #1
0
    def on_wySubsetSelection_clicked(self):
        # Show the Subset Selection
        if len(self.openfile_name) != 0:
            # show the weights
            # self.scrollArea.hide()
            self.W_F = 's'
            self.chosenSSNumber = 1
            self.horizontalSliderPatch.setMinimum(1)
            self.horizontalSliderPatch.setMaximum(self.totalSS)
            self.horizontalSliderPatch.setValue(self.chosenSSNumber)
            self.horizontalSliderPatch.valueChanged.connect(
                self.lcdNumberPatch.display)
            self.lcdNumberPatch.show()
            self.lcdNumberSlice.hide()
            self.horizontalSliderPatch.show()
            self.horizontalSliderSlice.hide()
            self.labelPatch.show()
            self.labelSlice.hide()
            # self.matplotlibwidget_static.hide()
            # self.matplotlibwidget_static_2.show()
            # self.horizontalSliderSS.show()
            # self.lcdNumberSS.show()

            self.matplotlibwidget_static.mpl.getSubsetSelections(
                self.subset_selection, self.totalSS)

            self.overlay = Overlay(
                self.centralWidget())  # self.scrollArea self.centralWidget()
            self.overlay.setGeometry(QtCore.QRect(700, 350, 171, 141))
            self.overlay.show()

            from loadf import loadImage_subset_selection_plot
            self.wyPlot.setDisabled(True)
            self.newf = loadImage_subset_selection_plot(
                self.matplotlibwidget_static, self.chosenSSNumber)
            self.newf.trigger.connect(self.loadEnd)
            self.newf.start()

            # self.matplotlibwidget_static.mpl.subset_selection_plot(self.chosenSSNumber)
        else:
            self.showChooseFileDialog()
Пример #2
0
    def on_wySubsetSelection_clicked(self):
        # Show the Subset Selection
        if len(self.openfile_name) != 0:
            # show the weights
            # self.scrollArea.hide()
            self.W_F = 's'
            self.chosenSSNumber = 1
            self.horizontalSliderPatch.setMinimum(1)
            self.horizontalSliderPatch.setMaximum(self.totalSS)
            self.horizontalSliderPatch.setValue(self.chosenSSNumber)
            self.horizontalSliderPatch.valueChanged.connect(
                self.lcdNumberPatch.display)
            self.lcdNumberPatch.show()
            self.lcdNumberSlice.hide()
            self.horizontalSliderPatch.show()
            self.horizontalSliderSlice.hide()
            self.labelPatch.show()
            self.labelSlice.hide()

            # create input patch
            if self.twoInput == False:
                self.matplotlibwidget_static.mpl.getSubsetSelections(
                    self.subset_selection, self.totalSS)

                self.createSubset(self.modelInput, self.subset_selection)
                self.matplotlibwidget_static.mpl.getSSResult(self.ssResult)

                self.overlay = Overlay(self.centralWidget(
                ))  # self.scrollArea self.centralWidget()
                self.overlay.setGeometry(QtCore.QRect(500, 350, 171, 141))
                self.overlay.show()

                from loadf import loadImage_subset_selection_plot
                self.wyPlot.setDisabled(True)
                self.newf = loadImage_subset_selection_plot(
                    self.matplotlibwidget_static, self.chosenSSNumber)
                self.newf.trigger.connect(self.loadEnd)
                self.newf.start()

                # self.matplotlibwidget_static.mpl.subset_selection_plot(self.chosenSSNumber)
            elif self.twoInput:
                if self.radioButton_3.isChecked():  # the 1st input
                    self.matplotlibwidget_static.mpl.getSubsetSelections(
                        self.subset_selection, self.totalSS)
                    self.createSubset(self.modelInput, self.subset_selection)
                    self.matplotlibwidget_static.mpl.getSSResult(self.ssResult)

                    self.overlay = Overlay(self.centralWidget(
                    ))  # self.scrollArea self.centralWidget()
                    self.overlay.setGeometry(QtCore.QRect(500, 350, 171, 141))
                    self.overlay.show()

                    from loadf import loadImage_subset_selection_plot
                    self.wyPlot.setDisabled(True)
                    self.newf = loadImage_subset_selection_plot(
                        self.matplotlibwidget_static, self.chosenSSNumber)
                    self.newf.trigger.connect(self.loadEnd)
                    self.newf.start()

                elif self.radioButton_4.isChecked():  # the 2nd input
                    self.matplotlibwidget_static.mpl.getSubsetSelections(
                        self.subset_selection_2, self.totalSS)
                    self.createSubset(self.modelInput2,
                                      self.subset_selection_2)
                    self.matplotlibwidget_static.mpl.getSSResult(self.ssResult)

                    self.overlay = Overlay(self.centralWidget(
                    ))  # self.scrollArea self.centralWidget()
                    self.overlay.setGeometry(QtCore.QRect(500, 350, 171, 141))
                    self.overlay.show()

                    from loadf import loadImage_subset_selection_plot
                    self.wyPlot.setDisabled(True)
                    self.newf = loadImage_subset_selection_plot(
                        self.matplotlibwidget_static, self.chosenSSNumber)
                    self.newf.trigger.connect(self.loadEnd)
                    self.newf.start()

                else:
                    self.showChooseInput()
            else:
                print('the number of input should be 1 or 2')

        else:
            self.showChooseFileDialog()
Пример #3
0
    def sliderValue(self):
        if self.W_F == 'w':

            self.chosenWeightNumber = self.horizontalSliderPatch.value()
            self.overlay = Overlay(
                self.centralWidget())  # self.scrollArea self.centralWidget()
            self.overlay.setGeometry(QtCore.QRect(700, 350, 171, 141))
            self.overlay.show()

            from loadf import loadImage_weights_plot_3D
            self.wyPlot.setDisabled(True)
            self.newW3D = loadImage_weights_plot_3D(
                self.matplotlibwidget_static, self.w, self.chosenWeightNumber,
                self.totalWeights, self.totalWeightsSlices)
            self.newW3D.trigger.connect(self.loadEnd)
            self.newW3D.start()

            # self.matplotlibwidget_static.mpl.weights_plot_3D(self.w, self.chosenWeightNumber, self.totalWeights,self.totalWeightsSlices)
        elif self.W_F == 'f':

            if self.modelDimension == '2D':
                self.chosenPatchNumber = self.horizontalSliderPatch.value()
                self.overlay = Overlay(self.centralWidget(
                ))  # self.scrollArea self.centralWidget()
                self.overlay.setGeometry(QtCore.QRect(700, 350, 171, 141))
                self.overlay.show()

                from loadf import loadImage_features_plot
                self.wyPlot.setDisabled(True)
                self.newf = loadImage_features_plot(
                    self.matplotlibwidget_static, self.chosenPatchNumber)
                self.newf.trigger.connect(self.loadEnd)
                self.newf.start()
                # self.matplotlibwidget_static.mpl.features_plot(self.chosenPatchNumber)
            elif self.modelDimension == '3D':

                self.chosenPatchNumber = self.horizontalSliderPatch.value()
                self.chosenPatchSliceNumber = self.horizontalSliderSlice.value(
                )
                self.overlay = Overlay(self.centralWidget(
                ))  # self.scrollArea self.centralWidget()
                self.overlay.setGeometry(QtCore.QRect(700, 350, 171, 141))
                self.overlay.show()

                from loadf import loadImage_features_plot_3D
                self.wyPlot.setDisabled(True)
                self.newf = loadImage_features_plot_3D(
                    self.matplotlibwidget_static, self.chosenPatchNumber,
                    self.chosenPatchSliceNumber)
                self.newf.trigger.connect(self.loadEnd)
                self.newf.start()
                # self.matplotlibwidget_static.mpl.features_plot_3D(self.chosenPatchNumber,self.chosenPatchSliceNumber)
        elif self.W_F == 's':

            self.chosenSSNumber = self.horizontalSliderPatch.value()
            self.overlay = Overlay(
                self.centralWidget())  # self.scrollArea self.centralWidget()
            self.overlay.setGeometry(QtCore.QRect(700, 350, 171, 141))
            self.overlay.show()

            from loadf import loadImage_subset_selection_plot
            self.wyPlot.setDisabled(True)
            self.newf = loadImage_subset_selection_plot(
                self.matplotlibwidget_static, self.chosenSSNumber)
            self.newf.trigger.connect(self.loadEnd)
            self.newf.start()
            # self.matplotlibwidget_static.mpl.subset_selection_plot(self.chosenSSNumber)

        else:
            pass