Beispiel #1
0
    def setup_ui(self):
        hbox = QHBoxLayout()

        self.view = MyGraphicsView(self.project)
        hbox.addWidget(self.view)

        vbox = QVBoxLayout()
        vbox.addWidget(QLabel('Choose video:'))
        self.listview = QListView()
        self.listview.setStyleSheet('QListView::item { height: 26px; }')
        vbox.addWidget(self.listview)

        pb = QPushButton('Connectivity Diagram')
        pb.clicked.connect(self.connectivity_diagram)
        vbox.addWidget(pb)

        vbox.addWidget(qtutil.separator())

        vbox2 = QVBoxLayout()
        w = QWidget()
        w.setLayout(vbox2)
        vbox.addWidget(w)

        vbox.addWidget(qtutil.separator())
        vbox.addWidget(QLabel('ROIs'))
        self.roi_list = QListView()
        vbox.addWidget(self.roi_list)

        hbox.addLayout(vbox)
        hbox.setStretch(0, 1)
        hbox.setStretch(1, 0)
        self.setLayout(hbox)
    def setup_ui(self):
        vbox_view = QVBoxLayout()
        vbox_view.addWidget(self.view)
        self.view.vb.setCursor(Qt.CrossCursor)
        self.left.setLayout(vbox_view)

        vbox = QVBoxLayout()
        self.new_json_pb.clicked.connect(self.new_json)
        vbox.addWidget(self.new_json_pb)
        self.video_list.setStyleSheet('QListView::item { height: 26px; }')
        self.video_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.video_list.setEditTriggers(QAbstractItemView.NoEditTriggers)
        vbox.addWidget(self.video_list)
        vbox.addWidget(qtutil.separator())
        vbox.addWidget(self.origin_label)
        self.shift_pb.clicked.connect(self.shift_to_this)
        vbox.addWidget(self.shift_pb)
        vbox.addWidget(QLabel('Data imported to this project after shift'))
        self.list_shifted.setStyleSheet('QListView::item { height: 26px; }')
        self.list_shifted.setSelectionMode(QAbstractItemView.SingleSelection)
        vbox.addWidget(self.list_shifted)
        self.right.setLayout(vbox)
        splitter = QSplitter(Qt.Horizontal)
        splitter.setHandleWidth(3)
        splitter.setStyleSheet('QSplitter::handle {background: #cccccc;}')
        splitter.addWidget(self.left)
        splitter.addWidget(self.right)
        hbox_global = QHBoxLayout()
        hbox_global.addWidget(splitter)
        self.setLayout(hbox_global)
 def setup_ui(self):
     super().setup_ui()
     self.vbox.addWidget(self.load_table_pb)
     self.vbox.addWidget(self.table_widget)
     self.vbox.addWidget(self.update_table_pb)
     self.vbox.addWidget(self.special_warning_pb)
     self.vbox.addWidget(qtutil.separator())
     self.vbox.addWidget(QLabel('ROIs'))
     self.vbox.addWidget(self.roi_list)
Beispiel #4
0
 def setup_ui(self):
   super().setup_ui()
   self.vbox.addWidget(self.load_table_pb )
   self.vbox.addWidget(self.table_widget)
   self.vbox.addWidget(self.update_table_pb)
   self.vbox.addWidget(self.special_warning_pb)
   self.vbox.addWidget(qtutil.separator())
   self.vbox.addWidget(QLabel('ROIs'))
   self.vbox.addWidget(self.roi_list)
Beispiel #5
0
    def setup_ui(self):
        vbox_view = QVBoxLayout()
        vbox_view.addWidget(self.view)
        self.view.vb.crosshair_visible = False
        self.left.setLayout(vbox_view)

        vbox = QVBoxLayout()
        list_of_manips = pfs.get_list_of_project_manips(self.project)
        self.toolbutton = pfs.add_combo_dropdown(self, list_of_manips)
        self.toolbutton.activated.connect(self.refresh_video_list_via_combo_box)
        vbox.addWidget(self.toolbutton)
        vbox.addWidget(QLabel('Select video:'))
        self.video_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.video_list.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.video_list.setStyleSheet('QListView::item { height: 26px; }')
        vbox.addWidget(self.video_list)
        vbox.addWidget(qtutil.separator())
        vbox.addWidget(mue.InfoWidget('Click shift to select multiple ROIs. Drag to reorder.'))
        vbox.addWidget(QLabel('Select ROIs:'))
        self.roi_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.roi_list.setAcceptDrops(True)
        self.roi_list.setDragEnabled(True)
        self.roi_list.setDropIndicatorShown(True)
        self.roi_list.setDragDropMode(QAbstractItemView.DragDrop)
        self.roi_list.setDragDropOverwriteMode(False)
        vbox.addWidget(self.roi_list)
        vbox.addWidget(QLabel('Choose colormap:'))
        # todo: colormap list should be dealt with in a seperate script
        self.cm_comboBox.addItem("jet")
        self.cm_comboBox.addItem("coolwarm")
        self.cm_comboBox.addItem("PRGn")
        self.cm_comboBox.addItem("seismic")
        self.cm_comboBox.addItem("viridis")
        self.cm_comboBox.addItem("inferno")
        self.cm_comboBox.addItem("plasma")
        self.cm_comboBox.addItem("magma")
        vbox.addWidget(self.cm_comboBox)
        self.cm_comboBox.activated[str].connect(self.cm_choice)
        pb = QPushButton('Connectivity &Matrix')
        pb.clicked.connect(self.connectivity_triggered)
        vbox.addWidget(pb)
        pb = QPushButton('Save all open matrices to csv')
        pb.clicked.connect(self.save_open_dialogs_to_csv)
        vbox.addWidget(pb)
        self.right.setLayout(vbox)

        splitter = QSplitter(Qt.Horizontal)
        splitter.setHandleWidth(3)
        splitter.setStyleSheet('QSplitter::handle {background: #cccccc;}')
        splitter.addWidget(self.left)
        splitter.addWidget(self.right)
        hbox_global = QHBoxLayout()
        hbox_global.addWidget(splitter)
        self.setLayout(hbox_global)
 def setup_ui(self):
     super().setup_ui()
     self.vbox.addWidget(QLabel("Export Framerate (Hz)"))
     self.vbox.addWidget(self.framerate_sb)
     self.framerate_sb.setMinimum(1)
     self.framerate_sb.setMaximum(99999)
     self.vbox.addWidget(QLabel("Export dtype"))
     for t in constants.DTYPES:
         self.cb_dtype.addItem(t)
     self.vbox.addWidget(self.cb_dtype)
     self.vbox.addWidget(self.export_pb)
     self.vbox.addWidget(qtutil.separator())
     self.vbox.addWidget(self.export_filetype_cb)
     self.export_filetype_cb.addItems(['.avi', '.tif', '.raw'])
     self.vbox.addWidget(self.export_bulk_pb)
Beispiel #7
0
 def setup_ui(self):
     super().setup_ui()
     self.vbox.addWidget(QLabel("Export Framerate (Hz)"))
     self.vbox.addWidget(self.framerate_sb)
     self.framerate_sb.setMinimum(1)
     self.framerate_sb.setMaximum(99999)
     self.vbox.addWidget(QLabel("Export dtype"))
     for t in constants.DTYPES:
         self.cb_dtype.addItem(t)
     self.vbox.addWidget(self.cb_dtype)
     self.vbox.addWidget(self.export_pb)
     self.vbox.addWidget(qtutil.separator())
     self.vbox.addWidget(self.export_filetype_cb)
     self.export_filetype_cb.addItems(['.avi', '.tif', '.raw'])
     self.vbox.addWidget(self.export_bulk_pb)
Beispiel #8
0
  def setup_ui(self):
    vbox_view = QVBoxLayout()
    vbox_view.addWidget(self.view)
    self.left.setLayout(vbox_view)

    vbox = QVBoxLayout()
    list_of_manips = pfs.get_list_of_project_manips(self.project)
    self.toolbutton = pfs.add_combo_dropdown(self, list_of_manips)
    self.toolbutton.activated.connect(self.refresh_video_list_via_combo_box)
    vbox.addWidget(self.toolbutton)
    vbox.addWidget(QLabel('Choose video:'))
    self.video_list = QListView()
    self.video_list.setStyleSheet('QListView::item { height: 26px; }')
    self.video_list.setEditTriggers(QAbstractItemView.NoEditTriggers)
    vbox.addWidget(self.video_list)
    pb = QPushButton('Load anatomical coordinates (relative to selected origin)')
    pb.clicked.connect(self.load_ROI_table)
    vbox.addWidget(pb)
    vbox.addWidget(self.table_widget)
    self.table_widget.itemChanged.connect(self.update_auto_rois)
    pb = QPushButton('Add these ROIs to project')
    pb.clicked.connect(self.auto_ROI)
    vbox.addWidget(pb)
    # vbox2 = QVBoxLayout()
    # w = QWidget()
    # w.setLayout(vbox2)
    # vbox.addWidget(w)
    vbox.addWidget(qtutil.separator())
    vbox.addWidget(QLabel('ROIs'))
    self.roi_list = QListView()
    vbox.addWidget(self.roi_list)
    self.right.setLayout(vbox)

    splitter = QSplitter(Qt.Horizontal)
    splitter.setHandleWidth(3)
    splitter.setStyleSheet('QSplitter::handle {background: #cccccc;}')
    splitter.addWidget(self.left)
    splitter.addWidget(self.right)
    hbox_global = QHBoxLayout()
    hbox_global.addWidget(splitter)
    self.setLayout(hbox_global)
Beispiel #9
0
  def setup_ui(self):
    vbox = QVBoxLayout()

    ## Related to importing Raws
    self.setWindowTitle('Import Raw File')

    #vbox.addWidget(QLabel('Set the size all data are to be rescaled to'))

    grid = QGridLayout()
    grid.addWidget(QLabel('Set channel and scale factor used for all imported data'), 0, 0)

    # grid.addWidget(QLabel('Width:'), 0, 0)
    # self.rescale_width = QSpinBox()
    # self.rescale_width.setMinimum(1)
    # self.rescale_width.setMaximum(1024)
    # self.rescale_width.setValue(256)
    # grid.addWidget(self.rescale_width, 0, 1)
    #
    # grid.addWidget(QLabel('Height:'), 1, 0)
    # self.rescale_height = QSpinBox()
    # self.rescale_height.setMinimum(1)
    # self.rescale_height.setMaximum(1024)
    # self.rescale_height.setValue(256)
    # grid.addWidget(self.rescale_height, 1, 1)

    grid.addWidget(QLabel('Scale Factor:'), 1, 0)
    self.scale_factor = QDoubleSpinBox()
    self.scale_factor.setSingleStep(0.25)
    self.scale_factor.setMinimum(0.25)
    self.scale_factor.setMaximum(1.00)
    self.scale_factor.setValue(1.0)
    grid.addWidget(self.scale_factor, 1, 1)

    grid.addWidget(QLabel('Channel:'), 2, 0)
    self.channel = QSpinBox()
    self.channel.setMinimum(1)
    self.channel.setMaximum(3)
    self.channel.setValue(2)
    grid.addWidget(self.channel, 2, 1)

    grid.addWidget(qtutil.separator(), 3, 0)
    grid.addWidget(qtutil.separator(), 3, 1)
    grid.addWidget(QLabel('Set paramaters for all imported raws'), 4, 0)
    grid.addWidget(QLabel('All raws will be rescaled and specified channel imported upon conversion'), 5, 0)
    grid.addWidget(QLabel('Width:'), 6, 0)
    self.sb_width = QSpinBox()
    self.sb_width.setMinimum(1)
    self.sb_width.setMaximum(1024)
    self.sb_width.setValue(256)
    grid.addWidget(self.sb_width, 6, 1)
    grid.addWidget(QLabel('Height:'), 7, 0)
    self.sb_height = QSpinBox()
    self.sb_height.setMinimum(1)
    self.sb_height.setMaximum(1024)
    self.sb_height.setValue(256)
    grid.addWidget(self.sb_height, 7, 1)
    grid.addWidget(QLabel('Number of channels:'), 8, 0)
    self.sb_channel = QSpinBox()
    self.sb_channel.setMinimum(1)
    self.sb_channel.setMaximum(3)
    self.sb_channel.setValue(3)
    grid.addWidget(self.sb_channel, 8, 1)
    grid.addWidget(QLabel('dtype:'), 9, 0)
    self.cb_dtype = QComboBox()
    for t in 'uint8', 'float32', 'float64':
      self.cb_dtype.addItem(t)
    grid.addWidget(self.cb_dtype, 9, 1)
    grid.addWidget(qtutil.separator(), 10, 0)
    grid.addWidget(qtutil.separator(), 10, 1)
    vbox.addLayout(grid)
    vbox.addStretch()

    self.setLayout(vbox)
    self.resize(400, 220)

    vbox.addWidget(mue.WarningWidget('Warning. This application has not yet been memory optimized for conversion.'
                                     ' We advise you only import files no larger than 1/4 of your memory'))
    pb = QPushButton('New Video')
    pb.clicked.connect(self.new_video)
    vbox.addWidget(pb)

    self.listview = QListView()
    self.listview.setStyleSheet('QListView::item { height: 26px; }')
    self.listview.setSelectionMode(QAbstractItemView.NoSelection)
    vbox.addWidget(self.listview)

    vbox.addStretch()
    self.setLayout(vbox)
    def setup_ui(self):
        vbox = QVBoxLayout()

        ## Related to importing Raws
        self.setWindowTitle('Import Raw File')
        grid = QGridLayout()
        grid.addWidget(
            QLabel('Set channel and scale factor used for all imported data'),
            0, 0)

        grid.addWidget(QLabel('Scale Factor:'), 1, 0)
        self.scale_factor = QDoubleSpinBox()
        self.scale_factor.setSingleStep(0.25)
        self.scale_factor.setMinimum(0.25)
        self.scale_factor.setMaximum(1.00)
        self.scale_factor.setValue(1.0)
        grid.addWidget(self.scale_factor, 1, 1)

        grid.addWidget(qtutil.separator(), 2, 0)
        grid.addWidget(qtutil.separator(), 2, 1)

        grid.addWidget(
            QLabel('This section only applies to imported raw files.'), 3, 0)
        grid.addWidget(
            QLabel(
                'All imported raws will also be rescaled using the above value'
            ), 4, 0)

        grid.addWidget(QLabel('Width:'), 5, 0)
        self.sb_width = QSpinBox()
        self.sb_width.setMinimum(1)
        self.sb_width.setMaximum(1024)
        self.sb_width.setValue(256)
        grid.addWidget(self.sb_width, 5, 1)
        grid.addWidget(QLabel('Height:'), 6, 0)
        self.sb_height = QSpinBox()
        self.sb_height.setMinimum(1)
        self.sb_height.setMaximum(1024)
        self.sb_height.setValue(256)
        grid.addWidget(self.sb_height, 6, 1)
        grid.addWidget(QLabel('Number of channels in raw:'), 7, 0)
        self.sb_channel = QSpinBox()
        self.sb_channel.setMinimum(1)
        self.sb_channel.setMaximum(3)
        self.sb_channel.setValue(3)
        grid.addWidget(self.sb_channel, 7, 1)

        grid.addWidget(QLabel('Channel in raw to be imported:'), 8, 0)
        self.channel = QSpinBox()
        self.channel.setMinimum(1)
        self.channel.setMaximum(3)
        self.channel.setValue(2)
        grid.addWidget(self.channel, 8, 1)

        grid.addWidget(QLabel('Raw dtype:'), 9, 0)
        self.cb_dtype = QComboBox()
        for t in 'uint8', 'float32', 'float64':
            self.cb_dtype.addItem(t)
        grid.addWidget(self.cb_dtype, 9, 1)
        grid.addWidget(qtutil.separator(), 10, 0)
        grid.addWidget(qtutil.separator(), 10, 1)
        vbox.addLayout(grid)

        self.setLayout(vbox)
        self.resize(400, 220)

        vbox.addWidget(
            cqt.WarningWidget(
                'Warning. This application has not been memory optimized for conversion.'
                ' We advise you only import raw or tiff files no larger than 1/4 of your memory. '
                'e.g. If you have 8GB RAM then we recommend not importing a raw or tiff larger '
                'than 2GB. It may or may not freeze your system otherwise.'
                '\n \n'
                'Press the button below to proceed once all parameters above have been set.'
            ))
        pb = QPushButton('Import Image Stack(s)')
        pb.clicked.connect(self.execute_primary_function)
        vbox.addWidget(pb)

        self.listview = QListView()
        self.listview.setStyleSheet('QListView::item { height: 26px; }')
        self.listview.setSelectionMode(QAbstractItemView.NoSelection)
        vbox.addWidget(self.listview)

        vbox.addStretch()
        self.setLayout(vbox)
Beispiel #11
0
    def setup_ui(self):
        super().setup_ui()
        self.vbox.addWidget(qtutil.separator())

        def min_handler(max_of_min):
            self.ref_no_min.setMaximum(max_of_min)
        def max_handler(min_of_max):
            self.ref_no_max.setMinimum(min_of_max)
        self.ref_no_min.valueChanged[int].connect(max_handler)
        self.ref_no_max.valueChanged[int].connect(min_handler)
        hbox = QHBoxLayout()
        self.vbox.addWidget(QLabel('Set range averaged over to compute reference frame'))
        self.ref_no_min.setMinimum(0)
        self.ref_no_min.setMaximum(1400)
        self.ref_no_min.setValue(0)
        hbox.addWidget(self.ref_no_min)
        to = QLabel('to')
        to.setAlignment(Qt.AlignCenter)
        hbox.addWidget(to)
        self.ref_no_max.setMaximum(1000000)
        self.ref_no_max.setValue(1000)
        hbox.addWidget(self.ref_no_max)
        self.vbox.addLayout(hbox)

        self.vbox.addWidget(self.ref_button)
        self.vbox.addWidget(qtutil.separator())
        max_cut_off = 100000
        self.vbox.addWidget(QLabel('Choose single frame in stack that is matched with reference frame'))
        self.ref_no.setMinimum(0)
        self.ref_no.setMaximum(max_cut_off)
        self.ref_no.setValue(400)
        self.vbox.addWidget(self.ref_no)

        hbox = QHBoxLayout()
        self.scaling_checkbox.setChecked(False)
        hbox.addWidget(self.scaling_checkbox)

        self.rotation_checkbox.setChecked(True)
        hbox.addWidget(self.rotation_checkbox)
        self.vbox.addLayout(hbox)
        self.vbox.addWidget(qtutil.separator())

        self.vbox.addWidget(self.shift_btn)
        self.vbox.addWidget(QLabel('translation vector, rotation angle (in degrees) and isotropic scale factor'))
        # self.vbox.addWidget(self.shift_table)

        hbox = QHBoxLayout()
        hbox.addWidget(QLabel(self.Labels.x_shift_label))
        hbox.addWidget(QLabel(self.Labels.y_shift_label))
        hbox.addWidget(QLabel(self.Labels.rotation_shift_label))
        hbox.addWidget(QLabel(self.Labels.scale_shift_label))
        self.vbox.addLayout(hbox)
        hbox = QHBoxLayout()
        hbox.addWidget(self.tvec_x_sb)
        hbox.addWidget(self.tvec_y_sb)
        hbox.addWidget(self.rotation_sb)
        hbox.addWidget(self.scale_sb)
        self.tvec_x_sb.setDecimals(16)
        self.tvec_x_sb.setRange(-1000000, 1000000)
        self.tvec_y_sb.setDecimals(16)
        self.tvec_y_sb.setRange(-1000000, 1000000)
        self.rotation_sb.setDecimals(16)
        self.rotation_sb.setRange(-1000000, 1000000)
        self.scale_sb.setDecimals(16)
        self.scale_sb.setRange(-1000000, 1000000)
        self.vbox.addLayout(hbox)
        self.vbox.addWidget(self.use_shift_checkbox)
        self.use_shift_checkbox.setChecked(False)
        self.vbox.addWidget(qtutil.separator())

        self.vbox.addWidget(self.main_button)
Beispiel #12
0
 def setup_ui(self):
     super().setup_ui()
     self.vbox.addWidget(qtutil.separator())
     self.vbox.addWidget(QLabel("Matrix Math Functions"))
     hbox = QHBoxLayout()
     hbox.addWidget(self.avg_mat_pb)
     hbox.addWidget(self.sub_mat_pb)
     self.vbox.addLayout(hbox)
     self.vbox.addWidget(qtutil.separator())
     self.vbox.addWidget(cqt.InfoWidget('Note that rois can be dragged and dropped in the list but that the order '
                                        'in which they are *selected* determines how the matrix is ordered. The '
                                        'first selected ROI is placed at the top of the matrix. '
                                        'Dragging and dropping is for convenience so you can organize your desired '
                                        'order and then shift select them from top to bottom to quickly have your '
                                        'desired matrix ordering.'))
     hbox = QHBoxLayout()
     hbox.addWidget(QLabel('Select ROIs:'))
     hbox.addWidget(QLabel('Selected ROIs:'))
     self.vbox.addLayout(hbox)
     self.roi_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
     self.roi_list.setAcceptDrops(True)
     self.roi_list.setDragEnabled(True)
     self.roi_list.setDropIndicatorShown(True)
     self.roi_list.setDragDropMode(QAbstractItemView.InternalMove)
     self.roi_list.setDefaultDropAction(Qt.MoveAction)
     self.roi_list.setDragDropOverwriteMode(False)
     hbox = QHBoxLayout()
     hbox.addWidget(self.roi_list)
     hbox.addWidget(self.selected_rois_list)
     self.vbox.addLayout(hbox)
     self.vbox.addWidget(QLabel(self.Labels.colormap_index_label))
     # todo: colormap list should be dealt with in a separate script
     self.cm_comboBox.addItem("jet")
     self.cm_comboBox.addItem("viridis")
     self.cm_comboBox.addItem("inferno")
     self.cm_comboBox.addItem("plasma")
     self.cm_comboBox.addItem("magma")
     self.cm_comboBox.addItem("coolwarm")
     self.cm_comboBox.addItem("PRGn")
     self.cm_comboBox.addItem("seismic")
     self.vbox.addWidget(self.cm_comboBox)
     hbox = QHBoxLayout()
     hbox.addWidget(QLabel(self.Labels.sb_min_label))
     hbox.addWidget(QLabel(self.Labels.sb_max_label))
     self.vbox.addLayout(hbox)
     hbox = QHBoxLayout()
     hbox.addWidget(self.min_sb)
     hbox.addWidget(self.max_sb)
     def min_handler(max_of_min):
         self.min_sb.setMaximum(max_of_min)
     def max_handler(min_of_max):
         self.max_sb.setMinimum(min_of_max)
     self.min_sb.valueChanged[float].connect(max_handler)
     self.max_sb.valueChanged[float].connect(min_handler)
     self.min_sb.setMinimum(-1.0)
     self.max_sb.setMaximum(1.0)
     self.min_sb.setSingleStep(0.1)
     self.max_sb.setSingleStep(0.1)
     self.vbox.addLayout(hbox)
     self.vbox.addWidget(self.save_pb)
     # self.vbox.addWidget(self.load_pb)
     self.mask_checkbox.setChecked(True)
     self.sem_checkbox.setChecked(False)
     self.vbox.addWidget(self.mask_checkbox)
     self.vbox.addWidget(self.sem_checkbox)
     self.vbox.addWidget(self.cm_pb)
 def setup_ui(self):
     super().setup_ui()
     self.vbox.addWidget(qtutil.separator())
     self.vbox.addWidget(QLabel("Matrix Math Functions"))
     hbox = QHBoxLayout()
     hbox.addWidget(self.avg_mat_pb)
     hbox.addWidget(self.sub_mat_pb)
     self.vbox.addLayout(hbox)
     self.vbox.addWidget(qtutil.separator())
     self.vbox.addWidget(cqt.InfoWidget('Note that rois can be dragged and dropped in the list but that the order '
                                        'in which they are *selected* determines how the matrix is ordered. The '
                                        'first selected ROI is placed at the top of the matrix. '
                                        'Dragging and dropping is for convenience so you can organize your desired '
                                        'order and then shift select them from top to bottom to quickly have your '
                                        'desired matrix ordering.'))
     hbox = QHBoxLayout()
     hbox.addWidget(QLabel('Select ROIs:'))
     hbox.addWidget(QLabel('Selected ROIs:'))
     self.vbox.addLayout(hbox)
     self.roi_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
     self.roi_list.setAcceptDrops(True)
     self.roi_list.setDragEnabled(True)
     self.roi_list.setDropIndicatorShown(True)
     self.roi_list.setDragDropMode(QAbstractItemView.InternalMove)
     self.roi_list.setDefaultDropAction(Qt.MoveAction)
     self.roi_list.setDragDropOverwriteMode(False)
     hbox = QHBoxLayout()
     hbox.addWidget(self.roi_list)
     hbox.addWidget(self.selected_rois_list)
     self.vbox.addLayout(hbox)
     self.vbox.addWidget(QLabel(self.Labels.colormap_index_label))
     # todo: colormap list should be dealt with in a separate script
     self.cm_comboBox.addItem("jet")
     self.cm_comboBox.addItem("viridis")
     self.cm_comboBox.addItem("inferno")
     self.cm_comboBox.addItem("plasma")
     self.cm_comboBox.addItem("magma")
     self.cm_comboBox.addItem("coolwarm")
     self.cm_comboBox.addItem("PRGn")
     self.cm_comboBox.addItem("seismic")
     self.vbox.addWidget(self.cm_comboBox)
     hbox = QHBoxLayout()
     hbox.addWidget(QLabel(self.Labels.sb_min_label))
     hbox.addWidget(QLabel(self.Labels.sb_max_label))
     self.vbox.addLayout(hbox)
     hbox = QHBoxLayout()
     hbox.addWidget(self.min_sb)
     hbox.addWidget(self.max_sb)
     def min_handler(max_of_min):
         self.min_sb.setMaximum(max_of_min)
     def max_handler(min_of_max):
         self.max_sb.setMinimum(min_of_max)
     self.min_sb.valueChanged[float].connect(max_handler)
     self.max_sb.valueChanged[float].connect(min_handler)
     self.min_sb.setMinimum(-1.0)
     self.max_sb.setMaximum(1.0)
     self.min_sb.setSingleStep(0.1)
     self.max_sb.setSingleStep(0.1)
     self.vbox.addLayout(hbox)
     self.vbox.addWidget(self.save_pb)
     # self.vbox.addWidget(self.load_pb)
     self.mask_checkbox.setChecked(True)
     self.sem_checkbox.setChecked(False)
     self.vbox.addWidget(self.mask_checkbox)
     self.vbox.addWidget(self.sem_checkbox)
     self.vbox.addWidget(self.cm_pb)
Beispiel #14
0
    def setup_ui(self):
        super().setup_ui()
        self.vbox.addWidget(qtutil.separator())

        def min_handler(max_of_min):
            self.ref_no_min.setMaximum(max_of_min)
        def max_handler(min_of_max):
            self.ref_no_max.setMinimum(min_of_max)
        self.ref_no_min.valueChanged[int].connect(max_handler)
        self.ref_no_max.valueChanged[int].connect(min_handler)
        hbox = QHBoxLayout()
        self.vbox.addWidget(QLabel('Set range averaged over to compute reference frame'))
        self.ref_no_min.setMinimum(0)
        self.ref_no_min.setMaximum(1400)
        self.ref_no_min.setValue(0)
        hbox.addWidget(self.ref_no_min)
        to = QLabel('to')
        to.setAlignment(Qt.AlignCenter)
        hbox.addWidget(to)
        self.ref_no_max.setMaximum(1000000)
        self.ref_no_max.setValue(1000)
        hbox.addWidget(self.ref_no_max)
        self.vbox.addLayout(hbox)

        self.vbox.addWidget(self.ref_button)
        self.vbox.addWidget(qtutil.separator())
        max_cut_off = 100000
        self.vbox.addWidget(QLabel('Choose single frame in stack that is matched with reference frame'))
        self.ref_no.setMinimum(0)
        self.ref_no.setMaximum(max_cut_off)
        self.ref_no.setValue(400)
        self.vbox.addWidget(self.ref_no)

        hbox = QHBoxLayout()
        self.scaling_checkbox.setChecked(False)
        hbox.addWidget(self.scaling_checkbox)

        self.rotation_checkbox.setChecked(True)
        hbox.addWidget(self.rotation_checkbox)
        self.vbox.addLayout(hbox)
        self.vbox.addWidget(qtutil.separator())

        self.vbox.addWidget(self.shift_btn)
        self.vbox.addWidget(QLabel('translation vector, rotation angle (in degrees) and isotropic scale factor'))
        # self.vbox.addWidget(self.shift_table)

        hbox = QHBoxLayout()
        hbox.addWidget(QLabel(self.Labels.x_shift_label))
        hbox.addWidget(QLabel(self.Labels.y_shift_label))
        hbox.addWidget(QLabel(self.Labels.rotation_shift_label))
        hbox.addWidget(QLabel(self.Labels.scale_shift_label))
        self.vbox.addLayout(hbox)
        hbox = QHBoxLayout()
        hbox.addWidget(self.tvec_x_sb)
        hbox.addWidget(self.tvec_y_sb)
        hbox.addWidget(self.rotation_sb)
        hbox.addWidget(self.scale_sb)
        self.tvec_x_sb.setDecimals(16)
        self.tvec_x_sb.setRange(-1000000, 1000000)
        self.tvec_y_sb.setDecimals(16)
        self.tvec_y_sb.setRange(-1000000, 1000000)
        self.rotation_sb.setDecimals(16)
        self.rotation_sb.setRange(-1000000, 1000000)
        self.scale_sb.setDecimals(16)
        self.scale_sb.setRange(-1000000, 1000000)
        self.vbox.addLayout(hbox)
        self.vbox.addWidget(self.use_shift_checkbox)
        self.use_shift_checkbox.setChecked(False)
        self.vbox.addWidget(qtutil.separator())

        self.vbox.addWidget(self.main_button)