Example #1
0
class Ui_MainWindow(object):
    def __init__(self):
        self.timer = QtCore.QTimer()
        self.number_of_clicked = 0
        self.worker = Pool(1)
        self.result_space = None

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1000, 700)
        MainWindow.setMaximumSize(QtCore.QSize(1000, 700))
        setConfigOption('background', 'w')

        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName("horizontalLayout")

        self.formLayout_settings = QtWidgets.QFormLayout()
        self.formLayout_settings.setObjectName("formLayout_settings")

        self.label_neighbours_rule = QtWidgets.QLabel(self.centralwidget)
        self.label_neighbours_rule.setObjectName("label_neighbours_rule")
        self.formLayout_settings.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                           self.label_neighbours_rule)

        self.comboBox_neighbours_rule = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox_neighbours_rule.setObjectName("comboBox_neighbours_rule")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.formLayout_settings.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                           self.comboBox_neighbours_rule)

        self.label_border_condition = QtWidgets.QLabel(self.centralwidget)
        self.label_border_condition.setObjectName("label_border_condition")
        self.formLayout_settings.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                           self.label_border_condition)

        self.comboBox_border_condition = QtWidgets.QComboBox(
            self.centralwidget)
        self.comboBox_border_condition.setObjectName(
            "comboBox_border_condition")
        self.comboBox_border_condition.addItem("")
        self.comboBox_border_condition.addItem("")
        self.formLayout_settings.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                           self.comboBox_border_condition)

        self.label_size_of_space = QtWidgets.QLabel(self.centralwidget)
        self.label_size_of_space.setObjectName("label_size_of_space")
        self.formLayout_settings.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                           self.label_size_of_space)

        self.lineEdit_size_of_space = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_size_of_space.setObjectName("lineEdit_size_of_space")
        self.formLayout_settings.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                           self.lineEdit_size_of_space)

        self.label_number_of_grains = QtWidgets.QLabel(self.centralwidget)
        self.label_number_of_grains.setObjectName("label_number_of_grains")
        self.formLayout_settings.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                           self.label_number_of_grains)

        self.lineEdit_number_of_grains = QtWidgets.QLineEdit(
            self.centralwidget)
        self.lineEdit_number_of_grains.setObjectName(
            "lineEdit_number_of_grains")
        self.formLayout_settings.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                           self.lineEdit_number_of_grains)

        self.label_inclusions_number = QtWidgets.QLabel(self.centralwidget)
        self.label_inclusions_number.setObjectName("label_inclusions_number")
        self.formLayout_settings.setWidget(4, QtWidgets.QFormLayout.LabelRole,
                                           self.label_inclusions_number)

        self.lineEdit_inclusions_number = QtWidgets.QLineEdit(
            self.centralwidget)
        self.lineEdit_inclusions_number.setObjectName(
            "lineEdit_inclusions_number")
        self.formLayout_settings.setWidget(4, QtWidgets.QFormLayout.FieldRole,
                                           self.lineEdit_inclusions_number)

        self.label_min_radius = QtWidgets.QLabel(self.centralwidget)
        self.label_min_radius.setObjectName("label_min_radius")
        self.formLayout_settings.setWidget(5, QtWidgets.QFormLayout.LabelRole,
                                           self.label_min_radius)

        self.lineEdit_min_radius = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_min_radius.setObjectName("lineEdit_min_radius")
        self.formLayout_settings.setWidget(5, QtWidgets.QFormLayout.FieldRole,
                                           self.lineEdit_min_radius)

        self.label_max_radius = QtWidgets.QLabel(self.centralwidget)
        self.label_max_radius.setObjectName("label_max_radius")
        self.formLayout_settings.setWidget(6, QtWidgets.QFormLayout.LabelRole,
                                           self.label_max_radius)

        self.lineEdit_max_radius = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_max_radius.setObjectName("lineEdit_max_radius")
        self.formLayout_settings.setWidget(6, QtWidgets.QFormLayout.FieldRole,
                                           self.lineEdit_max_radius)

        self.pushButton_import_from_csv = QtWidgets.QPushButton(
            self.centralwidget)
        self.pushButton_import_from_csv.setObjectName(
            "pushButton_import_from_csv")
        self.pushButton_import_from_csv.clicked.connect(
            self.io_open_file_name_dialog)
        self.formLayout_settings.setWidget(12, QtWidgets.QFormLayout.LabelRole,
                                           self.pushButton_import_from_csv)

        self.pushButton_export_to_csv = QtWidgets.QPushButton(
            self.centralwidget)
        self.pushButton_export_to_csv.setObjectName("pushButton_export_to_csv")
        self.pushButton_export_to_csv.clicked.connect(self.io_open_save_dialog)
        self.formLayout_settings.setWidget(13, QtWidgets.QFormLayout.LabelRole,
                                           self.pushButton_export_to_csv)

        self.pushButton_export_to_png = QtWidgets.QPushButton(
            self.centralwidget)
        self.pushButton_export_to_png.setObjectName("pushButton_export_to_png")
        self.pushButton_export_to_png.clicked.connect(
            self.io_open_save_dialog_image)
        self.formLayout_settings.setWidget(14, QtWidgets.QFormLayout.LabelRole,
                                           self.pushButton_export_to_png)

        self.line_horizontal = QtWidgets.QFrame(self.centralwidget)
        self.line_horizontal.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_horizontal.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_horizontal.setObjectName("line")
        self.formLayout_settings.setWidget(15,
                                           QtWidgets.QFormLayout.SpanningRole,
                                           self.line_horizontal)

        self.pushButton_init_space = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_init_space.setMaximumSize(QtCore.QSize(16777215, 40))
        self.pushButton_init_space.setObjectName("pushButton_init_space")
        self.pushButton_init_space.clicked.connect(
            self.controller_init_ca_algo)
        self.formLayout_settings.setWidget(17, QtWidgets.QFormLayout.FieldRole,
                                           self.pushButton_init_space)

        self.pushButton_start_stop = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_start_stop.setObjectName("pushButton_start_stop")
        self.pushButton_start_stop.clicked.connect(
            self.controller_init_image_timer)
        self.formLayout_settings.setWidget(18, QtWidgets.QFormLayout.FieldRole,
                                           self.pushButton_start_stop)

        self.pushButton_step = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_step.setObjectName("pushButton_step")
        self.pushButton_step.clicked.connect(self.controller_one_step)
        self.formLayout_settings.setWidget(19, QtWidgets.QFormLayout.FieldRole,
                                           self.pushButton_step)

        self.pushButton_clear_space = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_clear_space.setObjectName("pushButton_clear_space")
        self.pushButton_clear_space.clicked.connect(self.view_clear_space)
        self.formLayout_settings.setWidget(20, QtWidgets.QFormLayout.FieldRole,
                                           self.pushButton_clear_space)

        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setText("")
        self.label.setObjectName("label")
        self.formLayout_settings.setWidget(9, QtWidgets.QFormLayout.LabelRole,
                                           self.label)

        self.label_probability = QtWidgets.QLabel(self.centralwidget)
        self.label_probability.setObjectName("label_probability")
        self.formLayout_settings.setWidget(8, QtWidgets.QFormLayout.LabelRole,
                                           self.label_probability)

        self.lineEdit_prob_threshold = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_prob_threshold.setObjectName("lineEdit_prob_threshold")
        self.formLayout_settings.setWidget(8, QtWidgets.QFormLayout.FieldRole,
                                           self.lineEdit_prob_threshold)

        self.horizontalLayout.addLayout(self.formLayout_settings)

        self.line_vertical = QtWidgets.QFrame(self.centralwidget)
        self.line_vertical.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_vertical.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_vertical.setObjectName("line_2")
        self.horizontalLayout.addWidget(self.line_vertical)

        self.graphicsView = ImageView(self.centralwidget)
        self.graphicsView.setMinimumSize(QtCore.QSize(501, 501))
        self.graphicsView.setMaximumSize(QtCore.QSize(501, 501))
        self.graphicsView.setObjectName("graphicsView")
        self.graphicsView.ui.histogram.hide()
        self.graphicsView.ui.roiBtn.hide()
        self.graphicsView.ui.menuBtn.hide()
        self.graphicsView.show()
        self.horizontalLayout.addWidget(self.graphicsView)

        # Other stuff
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1000, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        self.controller_init_ca_algo()

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label_neighbours_rule.setText(
            _translate("MainWindow", "Neighbours rule"))
        self.comboBox_neighbours_rule.setItemText(
            0, _translate("MainWindow", "VONNEUMANN"))
        self.comboBox_neighbours_rule.setItemText(
            1, _translate("MainWindow", "MOORE"))
        self.comboBox_neighbours_rule.setItemText(
            2, _translate("MainWindow", "HEXAGONAL_LEFT"))
        self.comboBox_neighbours_rule.setItemText(
            3, _translate("MainWindow", "HEXAGONAL_RIGHT"))
        self.comboBox_neighbours_rule.setItemText(
            4, _translate("MainWindow", "PENTAGONAL_LEFT"))
        self.comboBox_neighbours_rule.setItemText(
            5, _translate("MainWindow", "PENTAGONAL_RIGHT"))
        self.label_border_condition.setText(
            _translate("MainWindow", "Border rule"))
        self.comboBox_border_condition.setItemText(
            0, _translate("MainWindow", "ABSORBING"))
        self.comboBox_border_condition.setItemText(
            1, _translate("MainWindow", "SNAKELIKE"))
        self.label_size_of_space.setText(
            _translate("MainWindow", "Size of space"))
        self.lineEdit_size_of_space.setText(_translate("MainWindow", "100"))
        self.label_number_of_grains.setText(
            _translate("MainWindow", "Number of grains"))
        self.lineEdit_number_of_grains.setText(_translate("MainWindow", "120"))
        self.label_inclusions_number.setText(
            _translate("MainWindow", "Number of incl."))
        self.lineEdit_inclusions_number.setText(_translate("MainWindow", "0"))
        self.label_min_radius.setText(_translate("MainWindow", "Min radius"))
        self.lineEdit_min_radius.setText(_translate("MainWindow", "1"))
        self.label_max_radius.setText(_translate("MainWindow", "Max radius"))
        self.lineEdit_max_radius.setText(_translate("MainWindow", "6"))
        self.pushButton_import_from_csv.setText(
            _translate("MainWindow", "Import csv"))
        self.pushButton_export_to_csv.setText(
            _translate("MainWindow", "Export csv"))
        self.pushButton_export_to_png.setText(
            _translate("MainWindow", "Export png"))
        self.pushButton_init_space.setText(
            _translate("MainWindow", "Init space"))
        self.pushButton_start_stop.setText(
            _translate("MainWindow", "Start/Stop"))
        self.pushButton_step.setText(_translate("MainWindow", "Step"))
        self.pushButton_clear_space.setText(
            _translate("MainWindow", "Clear space"))
        self.label_probability.setText(_translate("MainWindow", "Probability"))
        self.lineEdit_prob_threshold.setText(_translate("MainWindow", "60"))

    def view_generate_pg_colormap(self):
        self.pos = np.linspace(
            0.0, 1.0, self._ca_algo.number_of_reserved_ids +
            int(self.lineEdit_number_of_grains.text()))
        self.cmap = ColorMap(pos=self.pos, color=self._ca_algo.color_id)
        self.graphicsView.setColorMap(self.cmap)

    def view_display_image(self):
        self.graphicsView.setImage(
            self._ca_algo.space.T,
            levels=(0.0, self._ca_algo.number_of_reserved_ids +
                    float(self.lineEdit_number_of_grains.text())))

    def view_clear_space(self):
        self.result_space = None
        self.timer.stop()
        self._ca_algo.space = self._ca_algo.space_clear
        self.graphicsView.clear()

    def controller_init_ca_algo(self):
        self._ca_algo = None
        self.result_space = None
        self._ca_algo = CellularAutomata(
            int(self.lineEdit_number_of_grains.text()),
            int(self.lineEdit_inclusions_number.text()),
            int(self.lineEdit_min_radius.text()),
            int(self.lineEdit_max_radius.text()),
            int(self.lineEdit_size_of_space.text()),
            int(self.lineEdit_size_of_space.text()),
            str(self.comboBox_border_condition.currentText()),
            str(self.comboBox_neighbours_rule.currentText()))
        self._ca_algo.add_random()
        self._ca_algo.add_inclusions()
        self.view_generate_pg_colormap()
        self.view_display_image()

    def controller_init_image_timer(self):
        self.number_of_clicked += 1
        if self.number_of_clicked % 2:
            self.pushButton_start_stop.setStyleSheet("background-color: green")
            self.timer.timeout.connect(self.controller_update_func)
            self.timer.start(50)
        else:
            self.pushButton_start_stop.setStyleSheet("background-color: none")
            self.timer.stop()

    def controller_update_func(self):
        if self.result_space is None:
            self.result_space = self.worker.apply_async(self._ca_algo.one_step)
            return
        if self.result_space.ready():
            self._ca_algo.space = self.result_space.get()
            self.view_display_image()
            self.result_space = self.worker.apply_async(self._ca_algo.one_step)

    def controller_one_step(self):
        self.timer.stop()
        self.controller_update_func()

    def io_open_save_dialog(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getSaveFileName(self.centralwidget,
                                                  "Save to CSV file",
                                                  "",
                                                  "CSV Files (*.csv)",
                                                  options=options)
        if fileName:
            pd.DataFrame(self._ca_algo.space).to_csv(fileName)

    def io_open_file_name_dialog(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getOpenFileName(self.centralwidget,
                                                  "Open CSV file",
                                                  "",
                                                  "CSV Files (*.csv)",
                                                  options=options)
        if fileName:
            self._ca_algo.space = pd.read_csv(fileName,
                                              index_col=0).astype(int).values
            self.view_display_image()

    def io_open_save_dialog_image(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getSaveFileName(self.centralwidget,
                                                  "Save to PNG file",
                                                  "",
                                                  "PNG Files (*.png)",
                                                  options=options)
        if fileName:
            self.graphicsView.export(fileName)
class Ui_MainWindow(object):
    def __init__(self):
        self.timer = QtCore.QTimer()
        self.gbc_is_on = False
        self.dph_is_on = False
        self.sbs_is_on = False
        self.number_of_clicked = 0
        self.number_of_clicked_gbc = 0
        self.number_of_clicked_dph = 0
        self.number_of_clicked_sbs = 0
        self.worker = Pool(1)
        self.result_space = None
        self.deleted_ids = list()

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1000, 700)
        MainWindow.setMaximumSize(QtCore.QSize(1000, 700))
        setConfigOption('background', 'w')

        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName("horizontalLayout")

        self.formLayout_settings = QtWidgets.QFormLayout()
        self.formLayout_settings.setObjectName("formLayout_settings")

        self.label_neighbours_rule = QtWidgets.QLabel(self.centralwidget)
        self.label_neighbours_rule.setObjectName("label_neighbours_rule")
        self.formLayout_settings.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_neighbours_rule)

        self.comboBox_neighbours_rule = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox_neighbours_rule.setObjectName("comboBox_neighbours_rule")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.comboBox_neighbours_rule.addItem("")
        self.formLayout_settings.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.comboBox_neighbours_rule)

        self.label_border_condition = QtWidgets.QLabel(self.centralwidget)
        self.label_border_condition.setObjectName("label_border_condition")
        self.formLayout_settings.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_border_condition)

        self.comboBox_border_condition = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox_border_condition.setObjectName("comboBox_border_condition")
        self.comboBox_border_condition.addItem("")
        self.comboBox_border_condition.addItem("")
        self.formLayout_settings.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.comboBox_border_condition)

        self.label_size_of_space = QtWidgets.QLabel(self.centralwidget)
        self.label_size_of_space.setObjectName("label_size_of_space")
        self.formLayout_settings.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_size_of_space)

        self.lineEdit_size_of_space = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_size_of_space.setObjectName("lineEdit_size_of_space")
        self.formLayout_settings.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.lineEdit_size_of_space)

        self.label_number_of_grains = QtWidgets.QLabel(self.centralwidget)
        self.label_number_of_grains.setObjectName("label_number_of_grains")
        self.formLayout_settings.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_number_of_grains)

        self.lineEdit_number_of_grains = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_number_of_grains.setObjectName("lineEdit_number_of_grains")
        self.formLayout_settings.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.lineEdit_number_of_grains)

        self.label_inclusions_number = QtWidgets.QLabel(self.centralwidget)
        self.label_inclusions_number.setObjectName("label_inclusions_number")
        self.formLayout_settings.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_inclusions_number)

        self.lineEdit_inclusions_number = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_inclusions_number.setObjectName("lineEdit_inclusions_number")
        self.formLayout_settings.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.lineEdit_inclusions_number)

        self.label_min_radius = QtWidgets.QLabel(self.centralwidget)
        self.label_min_radius.setObjectName("label_min_radius")
        self.formLayout_settings.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_min_radius)

        self.lineEdit_min_radius = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_min_radius.setObjectName("lineEdit_min_radius")
        self.formLayout_settings.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.lineEdit_min_radius)

        self.label_max_radius = QtWidgets.QLabel(self.centralwidget)
        self.label_max_radius.setObjectName("label_max_radius")
        self.formLayout_settings.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.label_max_radius)

        self.lineEdit_max_radius = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_max_radius.setObjectName("lineEdit_max_radius")
        self.formLayout_settings.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.lineEdit_max_radius)

        self.pushButton_gbc_feature = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_gbc_feature.setObjectName("radioButton_gbc_feature")
        self.pushButton_gbc_feature.setStyleSheet("background-color: red")
        self.pushButton_gbc_feature.clicked.connect(self.controller_gbc_init)
        self.formLayout_settings.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.pushButton_gbc_feature)

        self.pushButton_delete_grains = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_delete_grains.setObjectName("pushButton_delete_grains")
        self.pushButton_delete_grains.clicked.connect(self.view_delete_grains)
        self.formLayout_settings.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.pushButton_delete_grains)

        self.pushButton_keep_selected = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_keep_selected.setObjectName("pushButton_keep_selected")
        self.pushButton_keep_selected.clicked.connect(self.view_keep_selected)
        self.formLayout_settings.setWidget(11, QtWidgets.QFormLayout.LabelRole, self.pushButton_keep_selected)

        self.comboBox_list_of_grains = QtWidgets.QComboBox(self.centralwidget)
        self.comboBox_list_of_grains.setObjectName("comboBox_list_of_grains")
        self.formLayout_settings.setWidget(10, QtWidgets.QFormLayout.FieldRole, self.comboBox_list_of_grains)

        self.pushButton_import_from_csv = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_import_from_csv.setObjectName("pushButton_import_from_csv")
        self.pushButton_import_from_csv.clicked.connect(self.io_open_file_name_dialog)
        self.formLayout_settings.setWidget(12, QtWidgets.QFormLayout.LabelRole, self.pushButton_import_from_csv)

        self.pushButton_export_to_csv = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_export_to_csv.setObjectName("pushButton_export_to_csv")
        self.pushButton_export_to_csv.clicked.connect(self.io_open_save_dialog)
        self.formLayout_settings.setWidget(13, QtWidgets.QFormLayout.LabelRole, self.pushButton_export_to_csv)

        self.pushButton_export_to_png = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_export_to_png.setObjectName("pushButton_export_to_png")
        self.pushButton_export_to_png.clicked.connect(self.io_open_save_dialog_image)
        self.formLayout_settings.setWidget(14, QtWidgets.QFormLayout.LabelRole, self.pushButton_export_to_png)

        self.line_horizontal = QtWidgets.QFrame(self.centralwidget)
        self.line_horizontal.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_horizontal.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_horizontal.setObjectName("line")
        self.formLayout_settings.setWidget(15, QtWidgets.QFormLayout.SpanningRole, self.line_horizontal)

        self.pushButton_init_space = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_init_space.setMaximumSize(QtCore.QSize(16777215, 40))
        self.pushButton_init_space.setObjectName("pushButton_init_space")
        self.pushButton_init_space.clicked.connect(self.controller_init_ca_algo)
        self.formLayout_settings.setWidget(17, QtWidgets.QFormLayout.FieldRole, self.pushButton_init_space)

        self.pushButton_start_stop = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_start_stop.setObjectName("pushButton_start_stop")
        self.pushButton_start_stop.clicked.connect(self.controller_init_image_timer)
        self.formLayout_settings.setWidget(18, QtWidgets.QFormLayout.FieldRole, self.pushButton_start_stop)

        self.pushButton_step = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_step.setObjectName("pushButton_step")
        self.pushButton_step.clicked.connect(self.controller_one_step)
        self.formLayout_settings.setWidget(19, QtWidgets.QFormLayout.FieldRole, self.pushButton_step)

        self.pushButton_clear_space = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_clear_space.setObjectName("pushButton_clear_space")
        self.pushButton_clear_space.clicked.connect(self.view_clear_space)
        self.formLayout_settings.setWidget(20, QtWidgets.QFormLayout.FieldRole, self.pushButton_clear_space)

        self.pushButton_draw_boundaries = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_draw_boundaries.setObjectName("pushButton_draw_boundaries")
        self.pushButton_draw_boundaries.clicked.connect(self.view_draw_boundaries)
        self.formLayout_settings.setWidget(21, QtWidgets.QFormLayout.FieldRole, self.pushButton_draw_boundaries)

        self.pushButton_dual_phase = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_dual_phase.setObjectName("pushButton_dual_phase")
        self.pushButton_dual_phase.clicked.connect(self.controller_init_dual_phase)
        self.formLayout_settings.setWidget(17, QtWidgets.QFormLayout.LabelRole, self.pushButton_dual_phase)

        self.pushButton_dual_phase_init = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_dual_phase_init.setObjectName("pushButton_dual_phase")
        self.pushButton_dual_phase_init.clicked.connect(self.controller_dual_phase_add_random)
        self.formLayout_settings.setWidget(18, QtWidgets.QFormLayout.LabelRole, self.pushButton_dual_phase_init)

        self.pushButton_substructures = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton_substructures.setObjectName("pushButton_dual_phase")
        self.pushButton_substructures.clicked.connect(self.controller_init_substructures)
        self.formLayout_settings.setWidget(19, QtWidgets.QFormLayout.LabelRole, self.pushButton_substructures)

        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setText("")
        self.label.setObjectName("label")
        self.formLayout_settings.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.label)

        self.label_probability = QtWidgets.QLabel(self.centralwidget)
        self.label_probability.setObjectName("label_probability")
        self.formLayout_settings.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.label_probability)

        self.lineEdit_prob_threshold = QtWidgets.QLineEdit(self.centralwidget)
        self.lineEdit_prob_threshold.setObjectName("lineEdit_prob_threshold")
        self.formLayout_settings.setWidget(8, QtWidgets.QFormLayout.FieldRole, self.lineEdit_prob_threshold)

        self.horizontalLayout.addLayout(self.formLayout_settings)

        self.line_vertical = QtWidgets.QFrame(self.centralwidget)
        self.line_vertical.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_vertical.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_vertical.setObjectName("line_2")
        self.horizontalLayout.addWidget(self.line_vertical)

        self.graphicsView = ImageView(self.centralwidget)
        self.graphicsView.setMinimumSize(QtCore.QSize(501, 501))
        self.graphicsView.setMaximumSize(QtCore.QSize(501, 501))
        self.graphicsView.setObjectName("graphicsView")
        self.graphicsView.ui.histogram.hide()
        self.graphicsView.ui.roiBtn.hide()
        self.graphicsView.ui.menuBtn.hide()
        self.graphicsView.show()
        self.horizontalLayout.addWidget(self.graphicsView)

        # Other stuff
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1000, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        self.controller_init_ca_algo()
        # self._clear_space()

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label_neighbours_rule.setText(_translate("MainWindow", "Neighbours rule"))
        self.comboBox_neighbours_rule.setItemText(0, _translate("MainWindow", "VONNEUMANN"))
        self.comboBox_neighbours_rule.setItemText(1, _translate("MainWindow", "MOORE"))
        self.comboBox_neighbours_rule.setItemText(2, _translate("MainWindow", "HEXAGONAL_LEFT"))
        self.comboBox_neighbours_rule.setItemText(3, _translate("MainWindow", "HEXAGONAL_RIGHT"))
        self.comboBox_neighbours_rule.setItemText(4, _translate("MainWindow", "PENTAGONAL_LEFT"))
        self.comboBox_neighbours_rule.setItemText(5, _translate("MainWindow", "PENTAGONAL_RIGHT"))
        self.label_border_condition.setText(_translate("MainWindow", "Border rule"))
        self.comboBox_border_condition.setItemText(0, _translate("MainWindow", "ABSORBING"))
        self.comboBox_border_condition.setItemText(1, _translate("MainWindow", "SNAKELIKE"))
        self.label_size_of_space.setText(_translate("MainWindow", "Size of space"))
        self.lineEdit_size_of_space.setText(_translate("MainWindow", "100"))
        self.label_number_of_grains.setText(_translate("MainWindow", "Number of grains"))
        self.lineEdit_number_of_grains.setText(_translate("MainWindow", "120"))
        self.label_inclusions_number.setText(_translate("MainWindow", "Number of incl."))
        self.lineEdit_inclusions_number.setText(_translate("MainWindow", "0"))
        self.label_min_radius.setText(_translate("MainWindow", "Min radius"))
        self.lineEdit_min_radius.setText(_translate("MainWindow", "1"))
        self.label_max_radius.setText(_translate("MainWindow", "Max radius"))
        self.lineEdit_max_radius.setText(_translate("MainWindow", "6"))
        self.pushButton_gbc_feature.setText(_translate("MainWindow", "GBC feature"))
        self.pushButton_delete_grains.setText(_translate("MainWindow", "Delete grains"))
        self.pushButton_keep_selected.setText(_translate("MainWindow", "Keep selected"))
        self.pushButton_import_from_csv.setText(_translate("MainWindow", "Import csv"))
        self.pushButton_export_to_csv.setText(_translate("MainWindow", "Export csv"))
        self.pushButton_export_to_png.setText(_translate("MainWindow", "Export png"))
        self.pushButton_init_space.setText(_translate("MainWindow", "Init space"))
        self.pushButton_start_stop.setText(_translate("MainWindow", "Start/Stop"))
        self.pushButton_step.setText(_translate("MainWindow", "Step"))
        self.pushButton_clear_space.setText(_translate("MainWindow", "Clear space"))
        self.pushButton_draw_boundaries.setText(_translate("MainWindow", "Draw bound."))
        self.pushButton_dual_phase.setText(_translate("MainWindow", "Dual phase"))
        self.pushButton_dual_phase_init.setText(_translate("MainWindow", "Dual init"))
        self.pushButton_substructures.setText(_translate("MainWindow", "Substructures"))
        self.label_probability.setText(_translate("MainWindow", "Probability"))
        self.lineEdit_prob_threshold.setText(_translate("MainWindow", "60"))

    def view_generate_pg_colormap(self):
        self.pos = np.linspace(0.0, 1.0, self._ca_algo.number_of_reserved_ids+int(self.lineEdit_number_of_grains.text()))
        self.cmap = ColorMap(pos=self.pos, color=self._ca_algo.color_id)
        self.graphicsView.setColorMap(self.cmap)

    def view_display_image(self):
        self.graphicsView.setImage(self._ca_algo.space.T, levels=(0.0, self._ca_algo.number_of_reserved_ids+float(self.lineEdit_number_of_grains.text())))

    def view_generate_set_of_ids(self):
        self.comboBox_list_of_grains.clear()
        for item in self._ca_algo.list_of_id:
            self.comboBox_list_of_grains.addItem(str(item))
        self.comboBox_list_of_grains.setEnabled(False)
        self.pushButton_delete_grains.setEnabled(False)
        self.pushButton_keep_selected.setEnabled(False)

    def view_delete_grains(self):
        id_to_delete = int(self.comboBox_list_of_grains.currentText())
        if id_to_delete in self._ca_algo.space:
            self._ca_algo.space[self._ca_algo.space == id_to_delete] = 0
            self.result_space = None
            self.deleted_ids.append(id_to_delete)
            self.view_display_image()
        else:
            return

    def view_keep_selected(self):
        id_to_keep = int(self.comboBox_list_of_grains.currentText())
        if id_to_keep in self._ca_algo.space:
            self._ca_algo.space[self._ca_algo.space != id_to_keep] = 0
            self.result_space = None

            self.view_display_image()
        else:
            return

    def view_draw_boundaries(self):
        for x in range(self._ca_algo.space_width):
            for y in range(self._ca_algo.space_width):
                cell  = self._ca_algo.space[x, y]
                if x < self._ca_algo.space_width-1:
                    cell_neigh_1 = self._ca_algo.space[x+1, y]
                else:
                    cell_neigh_1 = cell
                if y < self._ca_algo.space_width-1:
                    cell_neigh_2 = self._ca_algo.space[x, y+1]
                else:
                    cell_neigh_2 = cell
                if cell > self._ca_algo.cell_inclusion and (cell != cell_neigh_1 or cell != cell_neigh_2):
                    self._ca_algo.space[x, y] = self._ca_algo.cell_inclusion
        self.result_space = self._ca_algo.space
        self.view_display_image()
        grain_boundaries = np.count_nonzero(self._ca_algo.space == 1)
        grain_size = len(self._ca_algo.list_of_id)
        grain_aver = (self._ca_algo.space_width * self._ca_algo.space_width) / grain_size
        msg = QMessageBox()
        msg.setWindowTitle('Result')
        msg.setText('Total length of the boundaries: ' + str(grain_boundaries) + '\n' +
                    'Average size of a grain: '        + str(int(grain_aver)))
        msg.exec_()

    def view_clear_space(self):
        self.result_space = None
        self.timer.stop()
        self._ca_algo.space = self._ca_algo.space_clear
        self.graphicsView.clear()

    def controller_init_ca_algo(self):
        self._ca_algo = None
        self.deleted_ids = list()
        if not self.gbc_is_on:
            self.result_space = None
            self._ca_algo = CellularAutomata(int(self.lineEdit_number_of_grains.text()),
                                             int(self.lineEdit_inclusions_number.text()),
                                             int(self.lineEdit_min_radius.text()),
                                             int(self.lineEdit_max_radius.text()),
                                             int(self.lineEdit_size_of_space.text()),
                                             int(self.lineEdit_size_of_space.text()),
                                             str(self.comboBox_border_condition.currentText()),
                                             str(self.comboBox_neighbours_rule.currentText()))
            self._ca_algo.add_random()
            self._ca_algo.add_inclusions()
            self.view_generate_pg_colormap()
            self.view_generate_set_of_ids()
            self.view_display_image()
        else:
            self.result_space = None
            self._ca_algo = CellularAutomataGBC(int(self.lineEdit_number_of_grains.text()),
                                                int(self.lineEdit_inclusions_number.text()),
                                                int(self.lineEdit_min_radius.text()),
                                                int(self.lineEdit_max_radius.text()),
                                                int(self.lineEdit_size_of_space.text()),
                                                int(self.lineEdit_size_of_space.text()),
                                                str(self.comboBox_border_condition.currentText()),
                                                int(self.lineEdit_prob_threshold.text()))
            self._ca_algo.add_random()
            self._ca_algo.add_inclusions()
            self.view_generate_pg_colormap()
            self.view_generate_set_of_ids()
            self.view_display_image()

    def controller_init_image_timer(self):
        self.number_of_clicked += 1
        if self.number_of_clicked % 2:
            self.pushButton_start_stop.setStyleSheet("background-color: green")
            self.timer.timeout.connect(self.controller_update_func)
            self.timer.start(50)
        else:
            self.pushButton_start_stop.setStyleSheet("background-color: none")
            self.timer.stop()

    def controller_update_func(self):
        if self._ca_algo.cell_empty in self._ca_algo.space:
            if self.result_space is None:
                self.result_space = self.worker.apply_async(self._ca_algo.one_step)
                return

            if self.result_space.ready():
                self._ca_algo.space = self.result_space.get()
                self.view_display_image()
                self.result_space = self.worker.apply_async(self._ca_algo.one_step)
        else:
            self.comboBox_list_of_grains.setEnabled(True)
            self.pushButton_delete_grains.setEnabled(True)
            self.pushButton_keep_selected.setEnabled(True)

    def controller_one_step(self):
        self.timer.stop()
        self.controller_update_func()

    def controller_gbc_init(self):
        self.number_of_clicked_gbc += 1
        if self.number_of_clicked_gbc % 2:
            self.gbc_is_on = True
            self.pushButton_gbc_feature.setStyleSheet("background-color: green")
            self.comboBox_neighbours_rule.setCurrentText('MOORE')
            self.comboBox_neighbours_rule.setEnabled(False)
        else:
            self.gbc_is_on = False
            self.pushButton_gbc_feature.setStyleSheet("background-color: red")
            self.comboBox_neighbours_rule.setEnabled(True)

    def controller_init_substructures(self):
        self.number_of_clicked_sbs += 1
        if self.number_of_clicked_sbs % 2:
            self.pushButton_substructures.setStyleSheet("background-color: green")
            self.sbs_is_on = True
        else:
            self.pushButton_substructures.setStyleSheet("background-color: none")
            self.sbs_is_on = False
        self.substr_kept_ids = self._ca_algo.list_of_id
        for one_id in self.deleted_ids:
            self.substr_kept_ids.remove(one_id)
        for one_id in self.substr_kept_ids:
            self._ca_algo.grain_model[one_id] = self._ca_algo.phase_nonzero
            self._ca_algo.color_id[one_id] = self._ca_algo.color_id[2]
        self.result_space = None
        self.view_display_image()

    def controller_init_dual_phase(self):
        self.number_of_clicked_dph += 1
        if self.number_of_clicked_dph % 2:
            self.pushButton_dual_phase.setStyleSheet("background-color: green")
            self.dph_is_on = True
        else:
            self.pushButton_dual_phase.setStyleSheet("background-color: none")
            self.dph_is_on = False
        kept_ids = self._ca_algo.list_of_id
        for one_id in self.deleted_ids:
            kept_ids.remove(one_id)
        for one_id in kept_ids:
            self._ca_algo.space[self._ca_algo.space == one_id] = 2
        self.result_space = None
        self.view_display_image()

    def controller_dual_phase_add_random(self):
        if self.sbs_is_on and not self.dph_is_on:
            self._ca_algo.add_random_dual_phase(self.substr_kept_ids)
        else:
            self._ca_algo.add_random_dual_phase()
        self.result_space = None
        self.view_display_image()

    def controller_substructures_add_random(self):
        self._ca_algo.add_random_dual_phase(self.substr_kept_ids)
        self.result_space = None
        self.view_display_image()

    def io_open_save_dialog(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getSaveFileName(self.centralwidget, "Save to CSV file", "",
                                                  "CSV Files (*.csv)", options=options)
        if fileName:
            pd.DataFrame(self._ca_algo.space).to_csv(fileName)

    def io_open_file_name_dialog(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getOpenFileName(self.centralwidget, "Open CSV file", "",
                                                  "CSV Files (*.csv)", options=options)
        if fileName:
            self._ca_algo.space = pd.read_csv(fileName, index_col=0).astype(int).values
            self.view_display_image()

    def io_open_save_dialog_image(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getSaveFileName(self.centralwidget, "Save to PNG file", "",
                                                  "PNG Files (*.png)", options=options)
        if fileName:
            self.graphicsView.export(fileName)
Example #3
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1216, 857)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.frame = QtWidgets.QFrame(self.centralwidget)
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.gridLayout_20 = QtWidgets.QGridLayout(self.frame)
        self.gridLayout_20.setObjectName("gridLayout_20")
        self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_8.setObjectName("horizontalLayout_8")
        self.frame_13 = QtWidgets.QFrame(self.frame)
        self.frame_13.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_13.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_13.setObjectName("frame_13")
        self.gridLayout_18 = QtWidgets.QGridLayout(self.frame_13)
        self.gridLayout_18.setObjectName("gridLayout_18")
        self.verticalLayout_7 = QtWidgets.QVBoxLayout()
        self.verticalLayout_7.setObjectName("verticalLayout_7")
        self.frame_2 = QtWidgets.QFrame(self.frame_13)
        self.frame_2.setMaximumSize(QtCore.QSize(16777215, 200))
        self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_2.setObjectName("frame_2")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.frame_2)
        self.gridLayout_2.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.verticalLayout_8 = QtWidgets.QVBoxLayout()
        self.verticalLayout_8.setObjectName("verticalLayout_8")
        self.label_7 = QtWidgets.QLabel(self.frame_2)
        self.label_7.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_7.setFont(font)
        self.label_7.setAlignment(QtCore.Qt.AlignCenter)
        self.label_7.setObjectName("label_7")
        self.verticalLayout_8.addWidget(self.label_7)
        self.originalImage = QtWidgets.QLabel(self.frame_2)
        self.originalImage.setMaximumSize(QtCore.QSize(150, 16777215))
        self.originalImage.setPixmap(QtGui.QPixmap("test.jpg"))
        self.originalImage.setScaledContents(True)
        self.originalImage.setObjectName("originalImage")
        self.verticalLayout_8.addWidget(self.originalImage)
        self.horizontalLayout_4.addLayout(self.verticalLayout_8)
        self.verticalLayout_9 = QtWidgets.QVBoxLayout()
        self.verticalLayout_9.setObjectName("verticalLayout_9")
        self.label_8 = QtWidgets.QLabel(self.frame_2)
        self.label_8.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_8.setFont(font)
        self.label_8.setAlignment(QtCore.Qt.AlignCenter)
        self.label_8.setObjectName("label_8")
        self.verticalLayout_9.addWidget(self.label_8)
        self.grayScaleImage = ImageView(self.frame_2)
        self.grayScaleImage.setMaximumSize(QtCore.QSize(150, 16777215))
        self.grayScaleImage.setObjectName("grayScaleImage")
        self.verticalLayout_9.addWidget(self.grayScaleImage)
        self.horizontalLayout_4.addLayout(self.verticalLayout_9)
        self.verticalLayout_13 = QtWidgets.QVBoxLayout()
        self.verticalLayout_13.setObjectName("verticalLayout_13")
        self.label_9 = QtWidgets.QLabel(self.frame_2)
        self.label_9.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_9.setFont(font)
        self.label_9.setAlignment(QtCore.Qt.AlignCenter)
        self.label_9.setObjectName("label_9")
        self.verticalLayout_13.addWidget(self.label_9)
        self.originalHistogram = PlotWidget(self.frame_2)
        self.originalHistogram.setObjectName("originalHistogram")
        self.verticalLayout_13.addWidget(self.originalHistogram)
        self.horizontalLayout_4.addLayout(self.verticalLayout_13)
        self.gridLayout_2.addLayout(self.horizontalLayout_4, 0, 0, 1, 1)
        self.verticalLayout_7.addWidget(self.frame_2)
        self.frame_16 = QtWidgets.QFrame(self.frame_13)
        self.frame_16.setMaximumSize(QtCore.QSize(16777215, 25))
        self.frame_16.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_16.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_16.setObjectName("frame_16")
        self.gridLayout_15 = QtWidgets.QGridLayout(self.frame_16)
        self.gridLayout_15.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_15.setObjectName("gridLayout_15")
        self.label_11 = QtWidgets.QLabel(self.frame_16)
        self.label_11.setMaximumSize(QtCore.QSize(16777215, 20))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_11.setFont(font)
        self.label_11.setAlignment(QtCore.Qt.AlignCenter)
        self.label_11.setObjectName("label_11")
        self.gridLayout_15.addWidget(self.label_11, 0, 0, 1, 1)
        self.verticalLayout_7.addWidget(self.frame_16)
        self.frame_14 = QtWidgets.QFrame(self.frame_13)
        self.frame_14.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_14.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_14.setObjectName("frame_14")
        self.gridLayout_13 = QtWidgets.QGridLayout(self.frame_14)
        self.gridLayout_13.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_13.setObjectName("gridLayout_13")
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.verticalLayout_10 = QtWidgets.QVBoxLayout()
        self.verticalLayout_10.setObjectName("verticalLayout_10")
        self.redChannel = ImageView(self.frame_14)
        self.redChannel.setObjectName("redChannel")
        self.verticalLayout_10.addWidget(self.redChannel)
        self.horizontalLayout_5.addLayout(self.verticalLayout_10)
        self.verticalLayout_11 = QtWidgets.QVBoxLayout()
        self.verticalLayout_11.setObjectName("verticalLayout_11")
        self.greenChannel = ImageView(self.frame_14)
        self.greenChannel.setObjectName("greenChannel")
        self.verticalLayout_11.addWidget(self.greenChannel)
        self.horizontalLayout_5.addLayout(self.verticalLayout_11)
        self.verticalLayout_12 = QtWidgets.QVBoxLayout()
        self.verticalLayout_12.setObjectName("verticalLayout_12")
        self.blueChannel = ImageView(self.frame_14)
        self.blueChannel.setObjectName("blueChannel")
        self.verticalLayout_12.addWidget(self.blueChannel)
        self.horizontalLayout_5.addLayout(self.verticalLayout_12)
        self.gridLayout_13.addLayout(self.horizontalLayout_5, 0, 0, 1, 1)
        self.verticalLayout_7.addWidget(self.frame_14)
        self.frame_15 = QtWidgets.QFrame(self.frame_13)
        self.frame_15.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_15.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_15.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_15.setObjectName("frame_15")
        self.gridLayout_14 = QtWidgets.QGridLayout(self.frame_15)
        self.gridLayout_14.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_14.setObjectName("gridLayout_14")
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
        self.verticalLayout_15 = QtWidgets.QVBoxLayout()
        self.verticalLayout_15.setObjectName("verticalLayout_15")
        self.label_12 = QtWidgets.QLabel(self.frame_15)
        self.label_12.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_12.setFont(font)
        self.label_12.setAlignment(QtCore.Qt.AlignCenter)
        self.label_12.setObjectName("label_12")
        self.verticalLayout_15.addWidget(self.label_12)
        self.imageOne = ImageView(self.frame_15)
        self.imageOne.setObjectName("imageOne")
        self.verticalLayout_15.addWidget(self.imageOne)
        self.horizontalLayout_6.addLayout(self.verticalLayout_15)
        self.verticalLayout_16 = QtWidgets.QVBoxLayout()
        self.verticalLayout_16.setObjectName("verticalLayout_16")
        self.label_13 = QtWidgets.QLabel(self.frame_15)
        self.label_13.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_13.setFont(font)
        self.label_13.setAlignment(QtCore.Qt.AlignCenter)
        self.label_13.setObjectName("label_13")
        self.verticalLayout_16.addWidget(self.label_13)
        self.imageTwo = ImageView(self.frame_15)
        self.imageTwo.setObjectName("imageTwo")
        self.verticalLayout_16.addWidget(self.imageTwo)
        self.horizontalLayout_6.addLayout(self.verticalLayout_16)
        self.verticalLayout_14 = QtWidgets.QVBoxLayout()
        self.verticalLayout_14.setObjectName("verticalLayout_14")
        self.label_10 = QtWidgets.QLabel(self.frame_15)
        self.label_10.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_10.setFont(font)
        self.label_10.setAlignment(QtCore.Qt.AlignCenter)
        self.label_10.setObjectName("label_10")
        self.verticalLayout_14.addWidget(self.label_10)
        self.mixedImage = ImageView(self.frame_15)
        self.mixedImage.setObjectName("mixedImage")
        self.verticalLayout_14.addWidget(self.mixedImage)
        self.horizontalLayout_6.addLayout(self.verticalLayout_14)
        self.gridLayout_14.addLayout(self.horizontalLayout_6, 0, 0, 1, 1)
        self.verticalLayout_7.addWidget(self.frame_15)
        self.frame_17 = QtWidgets.QFrame(self.frame_13)
        self.frame_17.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_17.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_17.setObjectName("frame_17")
        self.gridLayout_16 = QtWidgets.QGridLayout(self.frame_17)
        self.gridLayout_16.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_16.setObjectName("gridLayout_16")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.frame_18 = QtWidgets.QFrame(self.frame_17)
        self.frame_18.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_18.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_18.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_18.setObjectName("frame_18")
        self.gridLayout_17 = QtWidgets.QGridLayout(self.frame_18)
        self.gridLayout_17.setObjectName("gridLayout_17")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setSpacing(0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label_14 = QtWidgets.QLabel(self.frame_18)
        self.label_14.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_14.setFont(font)
        self.label_14.setAlignment(QtCore.Qt.AlignCenter)
        self.label_14.setObjectName("label_14")
        self.verticalLayout_2.addWidget(self.label_14)
        self.localThresholdImage = ImageView(self.frame_18)
        self.localThresholdImage.setMinimumSize(QtCore.QSize(0, 125))
        self.localThresholdImage.setObjectName("localThresholdImage")
        self.verticalLayout_2.addWidget(self.localThresholdImage)
        self.gridLayout_17.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
        self.horizontalLayout.addWidget(self.frame_18)
        self.localThreshSlider = QtWidgets.QSlider(self.frame_17)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Ignored)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.localThreshSlider.sizePolicy().hasHeightForWidth())
        self.localThreshSlider.setSizePolicy(sizePolicy)
        self.localThreshSlider.setOrientation(QtCore.Qt.Vertical)
        self.localThreshSlider.setObjectName("localThreshSlider")
        self.horizontalLayout.addWidget(self.localThreshSlider)
        self.frame_19 = QtWidgets.QFrame(self.frame_17)
        self.frame_19.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_19.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_19.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_19.setObjectName("frame_19")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.frame_19)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label_15 = QtWidgets.QLabel(self.frame_19)
        self.label_15.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_15.setFont(font)
        self.label_15.setAlignment(QtCore.Qt.AlignCenter)
        self.label_15.setObjectName("label_15")
        self.verticalLayout.addWidget(self.label_15)
        self.globalThesholdImage = ImageView(self.frame_19)
        self.globalThesholdImage.setMinimumSize(QtCore.QSize(0, 125))
        self.globalThesholdImage.setObjectName("globalThesholdImage")
        self.verticalLayout.addWidget(self.globalThesholdImage)
        self.gridLayout_3.addLayout(self.verticalLayout, 0, 0, 1, 1)
        self.horizontalLayout.addWidget(self.frame_19)
        self.globalThreshSlider = QtWidgets.QSlider(self.frame_17)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Ignored)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.globalThreshSlider.sizePolicy().hasHeightForWidth())
        self.globalThreshSlider.setSizePolicy(sizePolicy)
        self.globalThreshSlider.setOrientation(QtCore.Qt.Vertical)
        self.globalThreshSlider.setObjectName("globalThreshSlider")
        self.horizontalLayout.addWidget(self.globalThreshSlider)
        self.gridLayout_16.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        self.verticalLayout_7.addWidget(self.frame_17)
        self.gridLayout_18.addLayout(self.verticalLayout_7, 0, 0, 1, 1)
        self.horizontalLayout_8.addWidget(self.frame_13)
        self.frame_12 = QtWidgets.QFrame(self.frame)
        self.frame_12.setMinimumSize(QtCore.QSize(600, 0))
        self.frame_12.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.frame_12.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_12.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_12.setObjectName("frame_12")
        self.gridLayout_19 = QtWidgets.QGridLayout(self.frame_12)
        self.gridLayout_19.setObjectName("gridLayout_19")
        self.verticalLayout_17 = QtWidgets.QVBoxLayout()
        self.verticalLayout_17.setObjectName("verticalLayout_17")
        self.frame_3 = QtWidgets.QFrame(self.frame_12)
        self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_3.setObjectName("frame_3")
        self.gridLayout_12 = QtWidgets.QGridLayout(self.frame_3)
        self.gridLayout_12.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_12.setObjectName("gridLayout_12")
        self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
        self.frame_4 = QtWidgets.QFrame(self.frame_3)
        self.frame_4.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_4.setObjectName("frame_4")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_4)
        self.gridLayout_5.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.label = QtWidgets.QLabel(self.frame_4)
        self.label.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.gridLayout_5.addWidget(self.label, 0, 0, 1, 2)
        self.noiseOptions = QtWidgets.QComboBox(self.frame_4)
        self.noiseOptions.setObjectName("noiseOptions")
        self.noiseOptions.addItem("")
        self.noiseOptions.addItem("")
        self.noiseOptions.addItem("")
        self.gridLayout_5.addWidget(self.noiseOptions, 2, 0, 1, 1)
        self.noiseImage = ImageView(self.frame_4)
        self.noiseImage.setMinimumSize(QtCore.QSize(0, 0))
        self.noiseImage.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.noiseImage.setObjectName("noiseImage")
        self.gridLayout_5.addWidget(self.noiseImage, 1, 0, 1, 2)
        self.noiseSlider = QtWidgets.QSlider(self.frame_4)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.noiseSlider.sizePolicy().hasHeightForWidth())
        self.noiseSlider.setSizePolicy(sizePolicy)
        self.noiseSlider.setOrientation(QtCore.Qt.Horizontal)
        self.noiseSlider.setObjectName("noiseSlider")
        self.gridLayout_5.addWidget(self.noiseSlider, 2, 1, 1, 1)
        self.horizontalLayout_7.addWidget(self.frame_4)
        self.frame_5 = QtWidgets.QFrame(self.frame_3)
        self.frame_5.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_5.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_5.setObjectName("frame_5")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.frame_5)
        self.gridLayout_4.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.filteredImage = ImageView(self.frame_5)
        self.filteredImage.setMinimumSize(QtCore.QSize(0, 0))
        self.filteredImage.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.filteredImage.setObjectName("filteredImage")
        self.gridLayout_4.addWidget(self.filteredImage, 1, 0, 1, 1)
        self.filtersOptions = QtWidgets.QComboBox(self.frame_5)
        self.filtersOptions.setObjectName("filtersOptions")
        self.filtersOptions.addItem("")
        self.filtersOptions.addItem("")
        self.filtersOptions.addItem("")
        self.gridLayout_4.addWidget(self.filtersOptions, 2, 0, 1, 1)
        self.label_2 = QtWidgets.QLabel(self.frame_5)
        self.label_2.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_2.setFont(font)
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setObjectName("label_2")
        self.gridLayout_4.addWidget(self.label_2, 0, 0, 1, 1)
        self.horizontalLayout_7.addWidget(self.frame_5)
        self.gridLayout_12.addLayout(self.horizontalLayout_7, 0, 0, 1, 1)
        self.verticalLayout_17.addWidget(self.frame_3)
        self.frame_6 = QtWidgets.QFrame(self.frame_12)
        self.frame_6.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_6.setObjectName("frame_6")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.frame_6)
        self.gridLayout_6.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.frame_7 = QtWidgets.QFrame(self.frame_6)
        self.frame_7.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_7.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_7.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_7.setObjectName("frame_7")
        self.gridLayout_7 = QtWidgets.QGridLayout(self.frame_7)
        self.gridLayout_7.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_7.setObjectName("gridLayout_7")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.label_3 = QtWidgets.QLabel(self.frame_7)
        self.label_3.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_3.setFont(font)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setObjectName("label_3")
        self.verticalLayout_3.addWidget(self.label_3)
        self.edgeDetectionImage = ImageView(self.frame_7)
        self.edgeDetectionImage.setObjectName("edgeDetectionImage")
        self.verticalLayout_3.addWidget(self.edgeDetectionImage)
        self.edgeDetectionOptions = QtWidgets.QComboBox(self.frame_7)
        self.edgeDetectionOptions.setObjectName("edgeDetectionOptions")
        self.edgeDetectionOptions.addItem("")
        self.edgeDetectionOptions.addItem("")
        self.edgeDetectionOptions.addItem("")
        self.verticalLayout_3.addWidget(self.edgeDetectionOptions)
        self.gridLayout_7.addLayout(self.verticalLayout_3, 0, 0, 1, 1)
        self.horizontalLayout_2.addWidget(self.frame_7)
        self.frame_8 = QtWidgets.QFrame(self.frame_6)
        self.frame_8.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_8.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_8.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_8.setObjectName("frame_8")
        self.gridLayout_8 = QtWidgets.QGridLayout(self.frame_8)
        self.gridLayout_8.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_8.setObjectName("gridLayout_8")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout()
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.label_4 = QtWidgets.QLabel(self.frame_8)
        self.label_4.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignCenter)
        self.label_4.setObjectName("label_4")
        self.verticalLayout_4.addWidget(self.label_4)
        self.freqeuncyFilteredImage = ImageView(self.frame_8)
        self.freqeuncyFilteredImage.setObjectName("freqeuncyFilteredImage")
        self.verticalLayout_4.addWidget(self.freqeuncyFilteredImage)
        self.frequancyFiltersOptions = QtWidgets.QComboBox(self.frame_8)
        self.frequancyFiltersOptions.setObjectName("frequancyFiltersOptions")
        self.frequancyFiltersOptions.addItem("")
        self.frequancyFiltersOptions.addItem("")
        self.verticalLayout_4.addWidget(self.frequancyFiltersOptions)
        self.gridLayout_8.addLayout(self.verticalLayout_4, 0, 0, 1, 1)
        self.horizontalLayout_2.addWidget(self.frame_8)
        self.gridLayout_6.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)
        self.verticalLayout_17.addWidget(self.frame_6)
        self.frame_9 = QtWidgets.QFrame(self.frame_12)
        self.frame_9.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.frame_9.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_9.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_9.setObjectName("frame_9")
        self.gridLayout_9 = QtWidgets.QGridLayout(self.frame_9)
        self.gridLayout_9.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_9.setObjectName("gridLayout_9")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.frame_10 = QtWidgets.QFrame(self.frame_9)
        self.frame_10.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_10.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_10.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_10.setObjectName("frame_10")
        self.gridLayout_10 = QtWidgets.QGridLayout(self.frame_10)
        self.gridLayout_10.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_10.setObjectName("gridLayout_10")
        self.verticalLayout_5 = QtWidgets.QVBoxLayout()
        self.verticalLayout_5.setObjectName("verticalLayout_5")
        self.label_5 = QtWidgets.QLabel(self.frame_10)
        self.label_5.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_5.setFont(font)
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
        self.label_5.setObjectName("label_5")
        self.verticalLayout_5.addWidget(self.label_5)
        self.equalizedImage = ImageView(self.frame_10)
        self.equalizedImage.setObjectName("equalizedImage")
        self.verticalLayout_5.addWidget(self.equalizedImage)
        self.gridLayout_10.addLayout(self.verticalLayout_5, 0, 0, 1, 1)
        self.horizontalLayout_3.addWidget(self.frame_10)
        self.frame_11 = QtWidgets.QFrame(self.frame_9)
        self.frame_11.setMinimumSize(QtCore.QSize(0, 0))
        self.frame_11.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_11.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_11.setObjectName("frame_11")
        self.gridLayout_11 = QtWidgets.QGridLayout(self.frame_11)
        self.gridLayout_11.setContentsMargins(-1, 1, -1, 1)
        self.gridLayout_11.setObjectName("gridLayout_11")
        self.verticalLayout_6 = QtWidgets.QVBoxLayout()
        self.verticalLayout_6.setObjectName("verticalLayout_6")
        self.label_6 = QtWidgets.QLabel(self.frame_11)
        self.label_6.setMaximumSize(QtCore.QSize(16777215, 25))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_6.setFont(font)
        self.label_6.setAlignment(QtCore.Qt.AlignCenter)
        self.label_6.setObjectName("label_6")
        self.verticalLayout_6.addWidget(self.label_6)
        self.normalizedImage = ImageView(self.frame_11)
        self.normalizedImage.setObjectName("normalizedImage")
        self.verticalLayout_6.addWidget(self.normalizedImage)
        self.gridLayout_11.addLayout(self.verticalLayout_6, 0, 0, 1, 1)
        self.horizontalLayout_3.addWidget(self.frame_11)
        self.gridLayout_9.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
        self.verticalLayout_17.addWidget(self.frame_9)
        self.gridLayout_19.addLayout(self.verticalLayout_17, 0, 0, 1, 1)
        self.horizontalLayout_8.addWidget(self.frame_12)
        self.gridLayout_20.addLayout(self.horizontalLayout_8, 0, 0, 1, 1)
        self.gridLayout.addWidget(self.frame, 0, 0, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1216, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label_7.setText(_translate("MainWindow", "Original Image"))
        self.label_8.setText(_translate("MainWindow", "Gray Scale Image"))
        self.label_9.setText(_translate("MainWindow", "Histogram"))
        self.label_11.setText(_translate("MainWindow", "Channels"))
        self.label_12.setText(_translate("MainWindow", "Image 1"))
        self.label_13.setText(_translate("MainWindow", "Image 2"))
        self.label_10.setText(_translate("MainWindow", "Mixed Image"))
        self.label_14.setText(_translate("MainWindow", "Local Threshold"))
        self.label_15.setText(_translate("MainWindow", "Global Threshold"))
        self.label.setText(_translate("MainWindow", "Noisy Image"))
        self.noiseOptions.setItemText(0, _translate("MainWindow", "Uniform"))
        self.noiseOptions.setItemText(1, _translate("MainWindow", "Guassian"))
        self.noiseOptions.setItemText(2, _translate("MainWindow", "Salt & Pepper"))
        self.filtersOptions.setItemText(0, _translate("MainWindow", "Average"))
        self.filtersOptions.setItemText(1, _translate("MainWindow", "Guassian"))
        self.filtersOptions.setItemText(2, _translate("MainWindow", "Median"))
        self.label_2.setText(_translate("MainWindow", "Filtered Image"))
        self.label_3.setText(_translate("MainWindow", "Image Edges"))
        self.edgeDetectionOptions.setItemText(0, _translate("MainWindow", "Sobel"))
        self.edgeDetectionOptions.setItemText(1, _translate("MainWindow", "Roberts"))
        self.edgeDetectionOptions.setItemText(2, _translate("MainWindow", "Prewitt"))
        self.label_4.setText(_translate("MainWindow", "Frequancy Filters"))
        self.frequancyFiltersOptions.setItemText(0, _translate("MainWindow", "LPF"))
        self.frequancyFiltersOptions.setItemText(1, _translate("MainWindow", "HPF"))
        self.label_5.setText(_translate("MainWindow", "Equalized Image"))
        self.label_6.setText(_translate("MainWindow", "Normalized Image"))
Example #4
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(681, 463)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8("brain_icon2.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.graphicsView = ImageView(self.centralwidget)
        self.graphicsView.setMinimumSize(QtCore.QSize(450, 0))
        self.graphicsView.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.graphicsView.setObjectName(_fromUtf8("graphicsView"))
        self.horizontalLayout.addWidget(self.graphicsView)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.btnLeft = QtGui.QPushButton(self.centralwidget)
        self.btnLeft.setObjectName(_fromUtf8("btnLeft"))
        self.horizontalLayout_2.addWidget(self.btnLeft)
        self.btnRight = QtGui.QPushButton(self.centralwidget)
        self.btnRight.setObjectName(_fromUtf8("btnRight"))
        self.horizontalLayout_2.addWidget(self.btnRight)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        self.listInfo = QtGui.QListWidget(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.listInfo.sizePolicy().hasHeightForWidth())
        self.listInfo.setSizePolicy(sizePolicy)
        self.listInfo.setObjectName(_fromUtf8("listInfo"))
        self.verticalLayout_2.addWidget(self.listInfo)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.btnXtra = QtGui.QPushButton(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.btnXtra.sizePolicy().hasHeightForWidth())
        self.btnXtra.setSizePolicy(sizePolicy)
        self.btnXtra.setObjectName(_fromUtf8("btnXtra"))
        self.horizontalLayout_3.addWidget(self.btnXtra)
        self.verticalLayout_2.addLayout(self.horizontalLayout_3)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.hSlider = QtGui.QSlider(self.centralwidget)
        self.hSlider.setOrientation(QtCore.Qt.Horizontal)
        self.hSlider.setObjectName(_fromUtf8("hSlider"))
        self.verticalLayout.addWidget(self.hSlider)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menuBar = QtGui.QMenuBar(MainWindow)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 681, 21))
        self.menuBar.setObjectName(_fromUtf8("menuBar"))
        self.menuFile = QtGui.QMenu(self.menuBar)
        self.menuFile.setObjectName(_fromUtf8("menuFile"))
        MainWindow.setMenuBar(self.menuBar)
        self.actionSelecionar_Pasta = QtGui.QAction(MainWindow)
        self.actionSelecionar_Pasta.setObjectName(_fromUtf8("actionSelecionar_Pasta"))
        self.menuFile.addAction(self.actionSelecionar_Pasta)
        self.menuBar.addAction(self.menuFile.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
        self.btnLeft.setText(_translate("MainWindow", "<", None))
        self.btnRight.setText(_translate("MainWindow", ">", None))
        self.btnXtra.setText(_translate("MainWindow", "Outras funções", None))
        self.menuFile.setTitle(_translate("MainWindow", "File", None))
        self.actionSelecionar_Pasta.setText(_translate("MainWindow", "Selecionar Pasta", None))
Example #5
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1237, 838)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        MainWindow.setMinimumSize(QtCore.QSize(1237, 811))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(69, 78, 81))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(57, 65, 67))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(30, 34, 36))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(69, 78, 81))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(57, 65, 67))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(30, 34, 36))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(69, 78, 81))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(57, 65, 67))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(30, 34, 36))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(23, 26, 27))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(46, 52, 54))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
        MainWindow.setPalette(palette)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        font.setPointSize(16)
        MainWindow.setFont(font)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("Icons/icons8-mixer-logo-512.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        icon.addPixmap(QtGui.QPixmap("Icons/icons8-mixer-logo-512.png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
        MainWindow.setWindowIcon(icon)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.frame = QtWidgets.QFrame(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
        self.frame.setSizePolicy(sizePolicy)
        self.frame.setFrameShape(QtWidgets.QFrame.Box)
        self.frame.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.frame.setObjectName("frame")
        self.gridLayout = QtWidgets.QGridLayout(self.frame)
        self.gridLayout.setObjectName("gridLayout")
        self.gridLayout_5 = QtWidgets.QGridLayout()
        self.gridLayout_5.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.img2Load = QtWidgets.QPushButton(self.frame)
        self.img2Load.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap("Icons/icons8-file-256.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.img2Load.setIcon(icon1)
        self.img2Load.setIconSize(QtCore.QSize(20, 20))
        self.img2Load.setFlat(True)
        self.img2Load.setProperty("image", 2)
        self.img2Load.setObjectName("img2Load")
        self.gridLayout_5.addWidget(self.img2Load, 2, 1, 1, 1)
        self.imageOneOrigin = ImageView(self.frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.imageOneOrigin.sizePolicy().hasHeightForWidth())
        self.imageOneOrigin.setSizePolicy(sizePolicy)
        self.imageOneOrigin.setMinimumSize(QtCore.QSize(0, 0))
        self.imageOneOrigin.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.imageOneOrigin.setSizeIncrement(QtCore.QSize(0, 0))
        self.imageOneOrigin.setObjectName("imageOneOrigin")
        self.gridLayout_5.addWidget(self.imageOneOrigin, 1, 0, 1, 1)
        self.imageOneMods = ImageView(self.frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.imageOneMods.sizePolicy().hasHeightForWidth())
        self.imageOneMods.setSizePolicy(sizePolicy)
        self.imageOneMods.setMinimumSize(QtCore.QSize(0, 0))
        self.imageOneMods.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.imageOneMods.setSizeIncrement(QtCore.QSize(0, 0))
        self.imageOneMods.setObjectName("imageOneMods")
        self.gridLayout_5.addWidget(self.imageOneMods, 1, 2, 1, 1)
        self.label_2 = QtWidgets.QLabel(self.frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        font.setPointSize(20)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.label_2.setFont(font)
        self.label_2.setFrameShape(QtWidgets.QFrame.Box)
        self.label_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.label_2.setObjectName("label_2")
        self.gridLayout_5.addWidget(self.label_2, 2, 0, 1, 1)
        self.image2Cmbx = QtWidgets.QComboBox(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.image2Cmbx.setFont(font)
        self.image2Cmbx.setProperty("image", 2)
        self.image2Cmbx.setObjectName("image2Cmbx")
        self.image2Cmbx.addItem("")
        self.image2Cmbx.addItem("")
        self.image2Cmbx.addItem("")
        self.image2Cmbx.addItem("")
        self.gridLayout_5.addWidget(self.image2Cmbx, 2, 2, 1, 1)
        self.image1Cmbx = QtWidgets.QComboBox(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.image1Cmbx.setFont(font)
        self.image1Cmbx.setProperty("image", 1)
        self.image1Cmbx.setObjectName("image1Cmbx")
        self.image1Cmbx.addItem("")
        self.image1Cmbx.addItem("")
        self.image1Cmbx.addItem("")
        self.image1Cmbx.addItem("")
        self.gridLayout_5.addWidget(self.image1Cmbx, 0, 2, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(13, 201, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_5.addItem(spacerItem, 1, 1, 1, 1)
        self.label = QtWidgets.QLabel(self.frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        font.setPointSize(20)
        self.label.setFont(font)
        self.label.setMouseTracking(True)
        self.label.setFrameShape(QtWidgets.QFrame.Box)
        self.label.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.label.setTextFormat(QtCore.Qt.RichText)
        self.label.setObjectName("label")
        self.gridLayout_5.addWidget(self.label, 0, 0, 1, 1)
        self.img1Load = QtWidgets.QPushButton(self.frame)
        self.img1Load.setText("")
        self.img1Load.setIcon(icon1)
        self.img1Load.setIconSize(QtCore.QSize(20, 20))
        self.img1Load.setFlat(True)
        self.img1Load.setProperty("image", 1)
        self.img1Load.setObjectName("img1Load")
        self.gridLayout_5.addWidget(self.img1Load, 0, 1, 1, 1)
        self.imageTwoOrigin = ImageView(self.frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.imageTwoOrigin.sizePolicy().hasHeightForWidth())
        self.imageTwoOrigin.setSizePolicy(sizePolicy)
        self.imageTwoOrigin.setMinimumSize(QtCore.QSize(0, 0))
        self.imageTwoOrigin.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.imageTwoOrigin.setSizeIncrement(QtCore.QSize(0, 0))
        self.imageTwoOrigin.setObjectName("imageTwoOrigin")
        self.gridLayout_5.addWidget(self.imageTwoOrigin, 3, 0, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(13, 200, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_5.addItem(spacerItem1, 3, 1, 1, 1)
        self.imageTwoMods = ImageView(self.frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.imageTwoMods.sizePolicy().hasHeightForWidth())
        self.imageTwoMods.setSizePolicy(sizePolicy)
        self.imageTwoMods.setMinimumSize(QtCore.QSize(0, 0))
        self.imageTwoMods.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.imageTwoMods.setSizeIncrement(QtCore.QSize(0, 0))
        self.imageTwoMods.setObjectName("imageTwoMods")
        self.gridLayout_5.addWidget(self.imageTwoMods, 3, 2, 1, 1)
        self.gridLayout.addLayout(self.gridLayout_5, 0, 0, 1, 1)
        self.line_2 = QtWidgets.QFrame(self.frame)
        self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_2.setObjectName("line_2")
        self.gridLayout.addWidget(self.line_2, 0, 1, 1, 1)
        self.gridLayout_2 = QtWidgets.QGridLayout()
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.gridLayout_3 = QtWidgets.QGridLayout()
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.slider1 = QtWidgets.QSlider(self.frame)
        self.slider1.setMinimum(0)
        self.slider1.setMaximum(10)
        self.slider1.setPageStep(1)
        self.slider1.setProperty("value", 9)
        self.slider1.setSliderPosition(9)
        self.slider1.setOrientation(QtCore.Qt.Horizontal)
        self.slider1.setObjectName("slider1")
        self.gridLayout_3.addWidget(self.slider1, 0, 2, 1, 1)
        self.mixerCmbx1 = QtWidgets.QComboBox(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.mixerCmbx1.setFont(font)
        self.mixerCmbx1.setObjectName("mixerCmbx1")
        self.mixerCmbx1.addItem("")
        self.mixerCmbx1.addItem("")
        self.gridLayout_3.addWidget(self.mixerCmbx1, 0, 1, 1, 1)
        self.label_4 = QtWidgets.QLabel(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.label_4.setFont(font)
        self.label_4.setFrameShape(QtWidgets.QFrame.Box)
        self.label_4.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.label_4.setObjectName("label_4")
        self.gridLayout_3.addWidget(self.label_4, 0, 0, 1, 1)
        self.component1 = QtWidgets.QComboBox(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.component1.setFont(font)
        self.component1.setObjectName("component1")
        self.component1.addItem("")
        self.component1.addItem("")
        self.component1.addItem("")
        self.gridLayout_3.addWidget(self.component1, 1, 2, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout_3, 1, 1, 1, 1)
        self.mixerOutput = QtWidgets.QComboBox(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.mixerOutput.setFont(font)
        self.mixerOutput.setObjectName("mixerOutput")
        self.mixerOutput.addItem("")
        self.mixerOutput.addItem("")
        self.gridLayout_2.addWidget(self.mixerOutput, 0, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.label_3.setFont(font)
        self.label_3.setFrameShape(QtWidgets.QFrame.Box)
        self.label_3.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.label_3.setObjectName("label_3")
        self.gridLayout_2.addWidget(self.label_3, 0, 0, 1, 1)
        self.gridLayout_4 = QtWidgets.QGridLayout()
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.label_8 = QtWidgets.QLabel(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.label_8.setFont(font)
        self.label_8.setFrameShape(QtWidgets.QFrame.Box)
        self.label_8.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.label_8.setObjectName("label_8")
        self.gridLayout_4.addWidget(self.label_8, 0, 0, 1, 1)
        self.mixerCmbx2 = QtWidgets.QComboBox(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.mixerCmbx2.setFont(font)
        self.mixerCmbx2.setObjectName("mixerCmbx2")
        self.mixerCmbx2.addItem("")
        self.mixerCmbx2.addItem("")
        self.gridLayout_4.addWidget(self.mixerCmbx2, 0, 1, 1, 1)
        self.slider2 = QtWidgets.QSlider(self.frame)
        self.slider2.setMinimum(0)
        self.slider2.setMaximum(10)
        self.slider2.setPageStep(1)
        self.slider2.setProperty("value", 9)
        self.slider2.setSliderPosition(9)
        self.slider2.setOrientation(QtCore.Qt.Horizontal)
        self.slider2.setObjectName("slider2")
        self.gridLayout_4.addWidget(self.slider2, 0, 2, 1, 1)
        self.component2 = QtWidgets.QComboBox(self.frame)
        font = QtGui.QFont()
        font.setFamily("Sarai")
        self.component2.setFont(font)
        self.component2.setObjectName("component2")
        self.component2.addItem("")
        self.component2.addItem("")
        self.component2.addItem("")
        self.gridLayout_4.addWidget(self.component2, 1, 2, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout_4, 2, 1, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_2.addItem(spacerItem2, 1, 0, 1, 1)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_2.addItem(spacerItem3, 2, 0, 1, 1)
        self.gridLayout.addLayout(self.gridLayout_2, 0, 2, 1, 1)
        self.verticalLayout.addWidget(self.frame)
        self.line = QtWidgets.QFrame(self.centralwidget)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.verticalLayout.addWidget(self.line)
        self.frame1 = QtWidgets.QFrame(self.centralwidget)
        self.frame1.setFrameShape(QtWidgets.QFrame.Box)
        self.frame1.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.frame1.setObjectName("frame1")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.frame1)
        self.gridLayout_6.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.label_6 = QtWidgets.QLabel(self.frame1)
        self.label_6.setMaximumSize(QtCore.QSize(16777215, 20))
        font = QtGui.QFont()
        font.setFamily("Sarai")
        font.setPointSize(20)
        self.label_6.setFont(font)
        self.label_6.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.label_6.setFrameShadow(QtWidgets.QFrame.Plain)
        self.label_6.setAlignment(QtCore.Qt.AlignCenter)
        self.label_6.setObjectName("label_6")
        self.gridLayout_6.addWidget(self.label_6, 0, 1, 1, 1)
        self.label_5 = QtWidgets.QLabel(self.frame1)
        self.label_5.setMaximumSize(QtCore.QSize(16777215, 20))
        font = QtGui.QFont()
        font.setFamily("Sarai")
        font.setPointSize(20)
        self.label_5.setFont(font)
        self.label_5.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.label_5.setFrameShadow(QtWidgets.QFrame.Plain)
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
        self.label_5.setObjectName("label_5")
        self.gridLayout_6.addWidget(self.label_5, 0, 0, 1, 1)
        self.output2 = ImageView(self.frame1)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.output2.sizePolicy().hasHeightForWidth())
        self.output2.setSizePolicy(sizePolicy)
        self.output2.setMinimumSize(QtCore.QSize(0, 0))
        self.output2.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.output2.setObjectName("output2")
        self.gridLayout_6.addWidget(self.output2, 1, 1, 1, 1)
        self.output1 = ImageView(self.frame1)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.output1.sizePolicy().hasHeightForWidth())
        self.output1.setSizePolicy(sizePolicy)
        self.output1.setMinimumSize(QtCore.QSize(0, 0))
        self.output1.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.output1.setObjectName("output1")
        self.gridLayout_6.addWidget(self.output1, 1, 0, 1, 1)
        self.verticalLayout.addWidget(self.frame1)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        self.component2.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "PhaseMonster"))
        self.label_2.setText(_translate("MainWindow", "Image 2 "))
        self.image2Cmbx.setItemText(0, _translate("MainWindow", "Magnitude"))
        self.image2Cmbx.setItemText(1, _translate("MainWindow", "Phase"))
        self.image2Cmbx.setItemText(2, _translate("MainWindow", "Real Component"))
        self.image2Cmbx.setItemText(3, _translate("MainWindow", "Imaginary Component"))
        self.image1Cmbx.setItemText(0, _translate("MainWindow", "Magnitude"))
        self.image1Cmbx.setItemText(1, _translate("MainWindow", "Phase"))
        self.image1Cmbx.setItemText(2, _translate("MainWindow", "Real Component"))
        self.image1Cmbx.setItemText(3, _translate("MainWindow", "Imaginary Component"))
        self.label.setText(_translate("MainWindow", "Image 1"))
        self.mixerCmbx1.setItemText(0, _translate("MainWindow", "Image 1"))
        self.mixerCmbx1.setItemText(1, _translate("MainWindow", "Image 2 "))
        self.label_4.setText(_translate("MainWindow", "Component 1"))
        self.component1.setItemText(0, _translate("MainWindow", "Magnitude"))
        self.component1.setItemText(1, _translate("MainWindow", "Real Component"))
        self.component1.setItemText(2, _translate("MainWindow", "Uniform Magnitude"))
        self.mixerOutput.setItemText(0, _translate("MainWindow", "Output 1"))
        self.mixerOutput.setItemText(1, _translate("MainWindow", "Output 2"))
        self.label_3.setText(_translate("MainWindow", "Mixer Output"))
        self.label_8.setText(_translate("MainWindow", "Component 2"))
        self.mixerCmbx2.setItemText(0, _translate("MainWindow", "Image 1"))
        self.mixerCmbx2.setItemText(1, _translate("MainWindow", "Image 2 "))
        self.component2.setItemText(0, _translate("MainWindow", "Phase"))
        self.component2.setItemText(1, _translate("MainWindow", "Imaginary Component"))
        self.component2.setItemText(2, _translate("MainWindow", "Uniform Phase "))
        self.label_6.setText(_translate("MainWindow", "Output 2"))
        self.label_5.setText(_translate("MainWindow", "Output 1"))
Example #6
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1015, 588)
        font = QtGui.QFont()
        font.setPointSize(8)
        MainWindow.setFont(font)
        MainWindow.setStyleSheet("background-color: rgb(255, 242, 238);")
        MainWindow.setDocumentMode(False)
        MainWindow.setTabShape(QtWidgets.QTabWidget.Rounded)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.MinimumExpanding,
            QtWidgets.QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.centralwidget.sizePolicy().hasHeightForWidth())
        self.centralwidget.setSizePolicy(sizePolicy)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.gridLayout_3 = QtWidgets.QGridLayout()
        self.gridLayout_3.setSizeConstraint(
            QtWidgets.QLayout.SetDefaultConstraint)
        self.gridLayout_3.setContentsMargins(15, -1, 15, 0)
        self.gridLayout_3.setHorizontalSpacing(2)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.label = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Arial Nova Cond")
        font.setPointSize(14)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.label.setObjectName("label")
        self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1,
                                    QtCore.Qt.AlignRight)
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Arial Nova Cond")
        font.setPointSize(14)
        font.setBold(True)
        font.setWeight(75)
        self.label_2.setFont(font)
        self.label_2.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.label_2.setObjectName("label_2")
        self.gridLayout_3.addWidget(self.label_2, 0, 3, 1, 1,
                                    QtCore.Qt.AlignLeft)
        self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.pushButton_2.sizePolicy().hasHeightForWidth())
        self.pushButton_2.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Myriad Pro Light")
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.pushButton_2.setFont(font)
        self.pushButton_2.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_2.setStyleSheet(
            "   border-style: outset;\n"
            "    border-width: 2px;\n"
            "    border-radius: 10px;\n"
            "    border-color: green;\n"
            "    min-width: 10em;\n"
            "    padding: 6px;\n"
            "background-color: rgb(255, 162, 115);")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("images/photo.png"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.pushButton_2.setIcon(icon)
        self.pushButton_2.setIconSize(QtCore.QSize(30, 35))
        self.pushButton_2.setAutoDefault(False)
        self.pushButton_2.setFlat(False)
        self.pushButton_2.setObjectName("pushButton_2")
        self.gridLayout_3.addWidget(self.pushButton_2, 0, 1, 1, 2,
                                    QtCore.Qt.AlignHCenter)
        self.horizontalLayout_9 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_9.setSizeConstraint(
            QtWidgets.QLayout.SetDefaultConstraint)
        self.horizontalLayout_9.setContentsMargins(-1, -1, 0, -1)
        self.horizontalLayout_9.setObjectName("horizontalLayout_9")
        self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_10.setObjectName("horizontalLayout_10")
        self.graphicsView = ImageView(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.graphicsView.sizePolicy().hasHeightForWidth())
        self.graphicsView.setSizePolicy(sizePolicy)
        self.graphicsView.setMaximumSize(QtCore.QSize(457, 244))
        self.graphicsView.setObjectName("graphicsView")
        self.horizontalLayout_10.addWidget(self.graphicsView)
        self.horizontalLayout_9.addLayout(self.horizontalLayout_10)
        self.line = QtWidgets.QFrame(self.centralwidget)
        self.line.setFrameShape(QtWidgets.QFrame.VLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.horizontalLayout_9.addWidget(self.line)
        self.horizontalLayout_12 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_12.setObjectName("horizontalLayout_12")
        self.graphicsView_2 = ImageView(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.graphicsView_2.sizePolicy().hasHeightForWidth())
        self.graphicsView_2.setSizePolicy(sizePolicy)
        self.graphicsView_2.setMaximumSize(QtCore.QSize(457, 244))
        self.graphicsView_2.setObjectName("graphicsView_2")
        self.horizontalLayout_12.addWidget(self.graphicsView_2)
        self.horizontalLayout_9.addLayout(self.horizontalLayout_12)
        self.gridLayout_3.addLayout(self.horizontalLayout_9, 1, 0, 1, 4)
        self.horizontalLayout_2.addLayout(self.gridLayout_3)
        self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 1)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.gridLayout_2 = QtWidgets.QGridLayout()
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.graphicsView3 = FigureCanvas(Figure())
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.MinimumExpanding,
            QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.graphicsView3.sizePolicy().hasHeightForWidth())
        self.graphicsView3.setSizePolicy(sizePolicy)
        self.graphicsView3.setMinimumSize(QtCore.QSize(0, 192))
        self.graphicsView3.setObjectName("graphicsView3")
        self.gridLayout_2.addWidget(self.graphicsView3, 3, 4, 1, 1)
        self.line_3 = QtWidgets.QFrame(self.centralwidget)
        self.line_3.setStyleSheet("background-color: rgb(255, 242, 238);\n"
                                  "color: rgb(0, 0, 127);")
        self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_3.setObjectName("line_3")
        self.gridLayout_2.addWidget(self.line_3, 3, 3, 1, 1)
        self.line_2 = QtWidgets.QFrame(self.centralwidget)
        self.line_2.setStyleSheet("background-color: rgb(255, 242, 238);")
        self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_2.setObjectName("line_2")
        self.gridLayout_2.addWidget(self.line_2, 3, 1, 1, 1)
        self.graphicsView1 = FigureCanvas(Figure())
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.MinimumExpanding,
            QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.graphicsView1.sizePolicy().hasHeightForWidth())
        self.graphicsView1.setSizePolicy(sizePolicy)
        self.graphicsView1.setMinimumSize(QtCore.QSize(0, 192))
        self.graphicsView1.setObjectName("graphicsView1")
        self.gridLayout_2.addWidget(self.graphicsView1, 3, 0, 1, 1)
        self.graphicsView2 = FigureCanvas(Figure())
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.MinimumExpanding,
            QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.graphicsView2.sizePolicy().hasHeightForWidth())
        self.graphicsView2.setSizePolicy(sizePolicy)
        self.graphicsView2.setMinimumSize(QtCore.QSize(0, 192))
        self.graphicsView2.setObjectName("graphicsView2")
        self.gridLayout_2.addWidget(self.graphicsView2, 3, 2, 1, 1)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_3.sizePolicy().hasHeightForWidth())
        self.label_3.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Rockwell Nova")
        font.setPointSize(8)
        font.setBold(True)
        font.setWeight(75)
        self.label_3.setFont(font)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setObjectName("label_3")
        self.horizontalLayout_4.addWidget(self.label_3)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem)
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_4.sizePolicy().hasHeightForWidth())
        self.label_4.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Rockwell Nova")
        font.setPointSize(8)
        font.setBold(True)
        font.setWeight(75)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignCenter)
        self.label_4.setWordWrap(False)
        self.label_4.setObjectName("label_4")
        self.horizontalLayout_4.addWidget(self.label_4)
        spacerItem1 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem1)
        self.label_5 = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_5.sizePolicy().hasHeightForWidth())
        self.label_5.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("Rockwell Nova")
        font.setPointSize(8)
        font.setBold(True)
        font.setWeight(75)
        self.label_5.setFont(font)
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
        self.label_5.setWordWrap(False)
        self.label_5.setObjectName("label_5")
        self.horizontalLayout_4.addWidget(self.label_5)
        self.gridLayout_2.addLayout(self.horizontalLayout_4, 0, 2, 1, 3)
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setEnabled(True)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.pushButton.sizePolicy().hasHeightForWidth())
        self.pushButton.setSizePolicy(sizePolicy)
        self.pushButton.setMinimumSize(QtCore.QSize(296, 0))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 162, 115))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        self.pushButton.setPalette(palette)
        font = QtGui.QFont()
        font.setFamily("Myriad Pro Light")
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.pushButton.setFont(font)
        self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.pushButton.setMouseTracking(True)
        self.pushButton.setFocusPolicy(QtCore.Qt.ClickFocus)
        self.pushButton.setAcceptDrops(False)
        self.pushButton.setToolTip("")
        self.pushButton.setToolTipDuration(-1)
        self.pushButton.setStatusTip("")
        self.pushButton.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.pushButton.setAutoFillBackground(False)
        self.pushButton.setStyleSheet("   border-style: outset;\n"
                                      "    border-width: 2px;\n"
                                      "    border-radius: 10px;\n"
                                      "    border-color: green;\n"
                                      "    min-width: 20em;\n"
                                      "    padding: 6px;\n"
                                      "background-color: rgb(255, 162, 115);")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap("images/icons8-plot-80.png"),
                        QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton.setIcon(icon1)
        self.pushButton.setIconSize(QtCore.QSize(40, 35))
        self.pushButton.setDefault(False)
        self.pushButton.setFlat(False)
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout_5.addWidget(self.pushButton)
        self.gridLayout_2.addLayout(self.horizontalLayout_5, 0, 0, 1, 1)
        self.horizontalLayout.addLayout(self.gridLayout_2)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem2, 1, 0, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label.setText(_translate("MainWindow", "Original Image "))
        self.label_2.setText(_translate("MainWindow", "K-Space"))
        self.pushButton_2.setToolTip(
            _translate(
                "MainWindow",
                "<html><head/><body><p align=\"center\">load image to be transformed to k-space</p></body></html>"
            ))
        self.pushButton_2.setText(_translate("MainWindow", "Load Image"))
        self.label_3.setText(_translate("MainWindow", "No Change : W= 63 MHz"))
        self.label_4.setText(
            _translate("MainWindow", "Positive Change(+1T) : W= 105 MHz"))
        self.label_5.setText(
            _translate("MainWindow", "Negative Change(-1T) : W= 21 MHz"))
        self.pushButton.setText(
            _translate("MainWindow", "Plot Non-Uniformity Trajectory"))