Ejemplo n.º 1
0
 def gui(self):
     text_file = get_text_file()
     self.text = open(text_file, 'r').readlines()
     self.keys = self.text[0].split('\t')
     self.gui_reset()
     x_axis_selection = ComboBox()
     y_axis_selection = ComboBox()
     z_axis_selection = ComboBox()
     epsilon = QDoubleSpinBox()
     epsilon.setDecimals(2)
     epsilon.setSingleStep(1)
     min_neighbors = QDoubleSpinBox()
     min_neighbors.setDecimals(2)
     min_neighbors.setSingleStep(1)
     min_cluster = QDoubleSpinBox()
     min_cluster.setDecimals(2)
     min_cluster.setSingleStep(1)
     simulate_check = CheckBox()
     axis_creator(x_axis_selection,
                  y_axis_selection,
                  z_axis_selection,
                  choices=self.keys)
     self.items.append({
         'name': 'x_axis_selection',
         'string': 'x axis',
         'object': x_axis_selection
     })
     self.items.append({
         'name': 'y_axis_selection',
         'string': 'y axis',
         'object': y_axis_selection
     })
     self.items.append({
         'name': 'z_axis_selection',
         'string': 'z axis',
         'object': z_axis_selection
     })
     self.items.append({
         'name': 'epsilon',
         'string': 'Epsilon',
         'object': epsilon
     })
     self.items.append({
         'name': 'min_neighbors',
         'string': 'Minimum neighbors to consider a point',
         'object': min_neighbors
     })
     self.items.append({
         'name': 'min_cluster',
         'string': 'Minimum Cluster Density',
         'object': min_cluster
     })
     self.items.append({
         'name': 'simulate_check',
         'string': 'Simulate Center Proximities',
         'object': simulate_check
     })
     super().gui()
     self.ui.setGeometry(QRect(150, 50, 150, 130))
Ejemplo n.º 2
0
    def gui(self):
        self.gui_reset()

        #combobox
        inputChoice = ComboBox()
        inputChoice.addItem('Current Window')
        inputChoice.addItem('Numpy Array')
        inputChoice.addItem('Batch Process')

        #checkbox
        self.keepOriginalWindow = CheckBox()
        self.keepOriginalWindow.setValue(False)

        #populate GUI
        self.items.append({
            'name': 'inputChoice',
            'string': 'Choose Input Data:',
            'object': inputChoice
        })
        self.items.append({
            'name': 'keepOriginalWindow',
            'string': 'Keep Original Window',
            'object': self.keepOriginalWindow
        })
        super().gui()
 def gui(self):
     self.gui_reset()
     nSteps = pg.SpinBox(int=True, step=1)
     first_volume = pg.SpinBox(int=True, step=1)
     nVolumes = pg.SpinBox(int=True, step=1)
     nVolumes.setMinimum(1)
     ratio_type = ComboBox()
     ratio_type.addItem('average')
     ratio_type.addItem('standard deviation')
     self.items.append({
         'name': 'nSteps',
         'string': 'Number of steps per volume',
         'object': nSteps
     })
     self.items.append({
         'name': 'first_volume',
         'string': 'First Volume',
         'object': first_volume
     })
     self.items.append({
         'name': 'nVolumes',
         'string': 'Number of Volumes',
         'object': nVolumes
     })
     self.items.append({
         'name': 'ratio_type',
         'string': 'Ratio Type',
         'object': ratio_type
     })
     super().gui()
Ejemplo n.º 4
0
    def gui(self):
        self.gui_reset()

        #combobox
        versionChoice = ComboBox()
        #versionChoice.addItem('synapse3D')
        #versionChoice.addItem('synapse3D_batch')
        versionChoice.addItem('synapse3D_version2')
        versionChoice.addItem('synapse3D_version2_batch')
        #versionChoice.addItem('synapse')

        #populate GUI
        self.items.append({
            'name': 'version',
            'string': 'Choose Version:',
            'object': versionChoice
        })
        super().gui()
Ejemplo n.º 5
0
    def gui(self):
        self.gui_reset()

        #combobox
        inputChoice = ComboBox()
        inputChoice.addItem('Current Window')
        inputChoice.addItem('Load file')
        inputChoice.addItem('Numpy Array')
        inputChoice.addItem('Batch Process')

        #checkbox
        self.keepOriginalWindow = CheckBox()
        self.keepOriginalWindow.setValue(False)

        self.preProcess = CheckBox()
        self.preProcess.setValue(g.settings['volumeSlider']['preProcess'])

        self.framesPerVolume = pg.SpinBox(int=True, step=1)
        self.framesPerVolume.setValue(
            g.settings['volumeSlider']['slicesPerVolume'])

        self.framesRemoved = pg.SpinBox(int=True, step=1)
        self.framesRemoved.setValue(
            g.settings['volumeSlider']['slicesDeletedPerVolume'])

        self.framesRemovedStart = pg.SpinBox(int=True, step=1)
        self.framesRemovedStart.setValue(
            g.settings['volumeSlider']['slicesDeletedPerMovie'])

        self.overlay = CheckBox()
        self.overlay.setValue(g.settings['volumeSlider']['overlay'])

        self.overlayStart = pg.SpinBox(int=True, step=1)
        self.overlayStart.setValue(g.settings['volumeSlider']['overlayStart'])

        #populate GUI
        self.items.append({
            'name': 'inputChoice',
            'string': 'Choose Input Data:',
            'object': inputChoice
        })
        self.items.append({
            'name': 'keepOriginalWindow',
            'string': 'Keep Original Window',
            'object': self.keepOriginalWindow
        })

        self.items.append({
            'name': 'spacer',
            'string': '------------ Preprocessing Options --------------',
            'object': None
        })
        self.items.append({
            'name': 'preProcess',
            'string': 'Preprocess Image Stack',
            'object': self.preProcess
        })
        self.items.append({
            'name': 'slicesPerVolume',
            'string': 'Slices per Volume',
            'object': self.framesPerVolume
        })
        self.items.append({
            'name': 'slicesDeletedPerVolume',
            'string': 'Frames to Remove per Volume',
            'object': self.framesRemoved
        })
        self.items.append({
            'name': 'slicesDeletedPerMovie',
            'string': 'Frames to Remove From Start of Stack',
            'object': self.framesRemovedStart
        })

        self.items.append({
            'name': 'spacer',
            'string': '------------    Overlay Options    --------------',
            'object': None
        })
        self.items.append({
            'name': 'overlay',
            'string': 'Overlay Image in Stack',
            'object': self.overlay
        })
        self.items.append({
            'name': 'overlayStart',
            'string': '1st Frame of Overlay',
            'object': self.overlayStart
        })

        super().gui()
    def gui(self):
        self.gui_reset()
        #w=g.win
        w = self.w
        width_units = QtWidgets.QDoubleSpinBox()

        width_pixels = QtWidgets.QSpinBox()
        width_units.setRange(.001, 1000000)
        width_pixels.setRange(1, self.width)

        font_size = QtWidgets.QSpinBox()

        unit = ComboBox()
        unit.addItem('micro')
        unit.addItem('nano')
        unit.addItem('pixels')

        orientation = ComboBox()
        orientation.addItem('horizontal')
        orientation.addItem('vertical')

        color = ComboBox()
        color.addItem("White")
        color.addItem("Black")

        background = ComboBox()
        background.addItem('None')
        background.addItem('Black')
        background.addItem('White')

        location = ComboBox()
        location.addItem('Lower Right')
        location.addItem('Lower Left')
        location.addItem('Top Right')
        location.addItem('Top Left')

        show = CheckBox()
        show_label = CheckBox()

        if hasattr(
                w, 'scaleBarLabel'
        ) and w.scaleBarLabel is not None:  #if the scaleBarLabel already exists
            props = w.scaleBarLabel.flika_properties
            width_units.setValue(props['width_units'])
            width_pixels.setValue(props['width_pixels'])
            unit.setCurrentIndex(color.findText(props['unit']))
            orientation.setCurrentIndex(color.findText(props['orientation']))
            font_size.setValue(props['font_size'])
            color.setCurrentIndex(color.findText(props['color']))
            background.setCurrentIndex(background.findText(
                props['background']))
            location.setCurrentIndex(location.findText(props['location']))
        else:
            font_size.setValue(12)
            width_pixels.setValue(int(w.view.width() / 8))
            width_units.setValue(1)

        show.setChecked(True)
        show_label.setChecked(True)

        self.items.append({'name': 'unit', 'string': 'Units', 'object': unit})
        self.items.append({
            'name': 'width_units',
            'string': 'Width of bar in [Units]',
            'object': width_units
        })
        self.items.append({
            'name': 'width_pixels',
            'string': 'Width of bar in pixels',
            'object': width_pixels
        })
        self.items.append({
            'name': 'font_size',
            'string': 'Font size',
            'object': font_size
        })
        self.items.append({
            'name': 'color',
            'string': 'Color',
            'object': color
        })
        self.items.append({
            'name': 'background',
            'string': 'Background',
            'object': background
        })
        self.items.append({
            'name': 'location',
            'string': 'Location',
            'object': location
        })
        self.items.append({
            'name': 'orientation',
            'string': 'Orientation',
            'object': orientation
        })
        self.items.append({'name': 'show', 'string': 'Show', 'object': show})
        self.items.append({
            'name': 'show_label',
            'string': 'Show label',
            'object': show_label
        })

        super().gui()
        self.preview()