示例#1
0
    def setup(self):
        self.methodLayout = qt.QHBoxLayout(self)
        self.methodSelectorComboBox = qt.QComboBox()
        self.methodSelectorComboBox.insertItem(
            1, "Single Component Extraction",
            VectorToScalarVolumeLogic.SINGLE_COMPONENT)
        self.methodSelectorComboBox.setItemData(1, 'Extract single component',
                                                qt.Qt.ToolTipRole)
        self.methodSelectorComboBox.insertItem(
            2, "Luminance", VectorToScalarVolumeLogic.LUMINANCE)
        self.methodSelectorComboBox.setItemData(
            2,
            '(RGB,RGBA) Luminance from first three components: 0.30*R + 0.59*G + 0.11*B + 0.0*A)',
            qt.Qt.ToolTipRole)
        self.methodSelectorComboBox.insertItem(
            3, "Average", VectorToScalarVolumeLogic.AVERAGE)
        self.methodSelectorComboBox.setItemData(3,
                                                'Average all the components.',
                                                qt.Qt.ToolTipRole)

        self.methodLayout.addWidget(self.methodSelectorComboBox)
        self.methodLayout.addItem(
            qt.QSpacerItem(40, 20, qt.QSizePolicy.Expanding,
                           qt.QSizePolicy.Minimum))

        # ComponentToExtract
        singleComponentLayout = qt.QHBoxLayout()
        self.componentsComboBox = qt.QComboBox()
        singleComponentLayout.addWidget(self.componentsComboBox)
        singleComponentLayout.addItem(
            qt.QSpacerItem(40, 20, qt.QSizePolicy.Expanding,
                           qt.QSizePolicy.Minimum))
        self.methodLayout.addLayout(singleComponentLayout)
    def setup(self):
        self.methodLayout = qt.QHBoxLayout(self)
        self.methodLayout.setContentsMargins(0, 0, 0, 0)
        self.methodSelectorComboBox = qt.QComboBox()

        self.methodSelectorComboBox.addItem(
            "Luminance", VectorToScalarVolumeLogic.LUMINANCE)
        self.methodSelectorComboBox.setItemData(
            0,
            '(RGB,RGBA) Luminance from first three components: 0.30*R + 0.59*G + 0.11*B + 0.0*A)',
            qt.Qt.ToolTipRole)
        self.methodSelectorComboBox.addItem("Average",
                                            VectorToScalarVolumeLogic.AVERAGE)
        self.methodSelectorComboBox.setItemData(1,
                                                'Average all the components.',
                                                qt.Qt.ToolTipRole)
        self.methodSelectorComboBox.addItem(
            "Single Component Extraction",
            VectorToScalarVolumeLogic.SINGLE_COMPONENT)
        self.methodSelectorComboBox.setItemData(2, 'Extract single component',
                                                qt.Qt.ToolTipRole)

        self.methodLayout.addWidget(self.methodSelectorComboBox)

        # ComponentToExtract
        singleComponentLayout = qt.QHBoxLayout()
        self.componentsComboBox = qt.QComboBox()
        singleComponentLayout.addWidget(self.componentsComboBox)
        self.methodLayout.addLayout(singleComponentLayout)
 def setupIntraopSeriesSelector(self):
   self.intraopSeriesSelector = qt.QComboBox()
   self.intraopSeriesSelector.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum)
   self.intraopSeriesSelector.setMinimumContentsLength(20)
   self.intraopSeriesSelector.setSizeAdjustPolicy(qt.QComboBox().AdjustToMinimumContentsLength)
   self._seriesModel = qt.QStandardItemModel()
   self.intraopSeriesSelector.setModel(self._seriesModel)
示例#4
0
    def segmentationLayout(self):
        self.segmentationFrame = qt.QFrame()
        segmentationFormLayout = qt.QFormLayout(self.segmentationFrame)
        self.segmentationLabellingMethodComboBox = qt.QComboBox()
        self.segmentationLabellingMethodComboBox.addItems(
            ["Unlabelled", "From Segmentation"])
        self.labellingMethod = self.segmentationLabellingMethodComboBox.currentText
        segmentationFormLayout.addWidget(
            self.segmentationLabellingMethodComboBox)

        self.segmentationLabelTypeLineEdit = qt.QLineEdit("Label Title")
        segmentationFormLayout.addWidget(self.segmentationLabelTypeLineEdit)
        self.segmentationLabelTypeLineEdit.visible = False

        self.inputSegmentationSelector = qt.QComboBox()
        self.inputSegmentationSelector.addItems(["Select Input Segmentation"])
        segmentationNodes = slicer.util.getNodesByClass(
            "vtkMRMLSegmentationNode")
        segmentationNodeNames = []
        for segNode in segmentationNodes:
            segmentationNodeNames.append(segNode.GetName())
        self.inputSegmentationSelector.addItems(segmentationNodeNames)
        segmentationFormLayout.addWidget(self.inputSegmentationSelector)
        self.inputSegmentationSelector.visible = False

        self.segmentationLabellingMethodComboBox.connect(
            'currentIndexChanged(int)', self.onLabellingMethodSelected)
示例#5
0
    def __init__(self, parent=None):
        qt.QFrame.__init__(self)

        self.parameterNode = None

        #
        # Parameters area
        #
        self.parametersLayout = qt.QFormLayout(self)
        self.setLayout(self.parametersLayout)

        #
        # Benchmark criterion  combo box
        #
        self.benchmarkCriterionComboBox = qt.QComboBox()
        self.benchmarkCriterionComboBox.addItem(BENCHMARK_CRITERION_ZSCORE)
        self.benchmarkCriterionComboBox.addItem(BENCHMARK_CRITERION_PERCENTILE)
        self.benchmarkCriterionComboBox.setToolTip(
            "Choose the benchmark criterion.")
        self.parametersLayout.addRow("Benchmark criterion ",
                                     self.benchmarkCriterionComboBox)

        #
        # Numerical level for benchmark spin box
        #
        self.numericalLevelSpinBox = qt.QDoubleSpinBox()
        self.numericalLevelSpinBox.setRange(-100, 100)
        self.numericalLevelSpinBox.setSingleStep(0.1)
        self.numericalLevelSpinBox.setToolTip(
            "Choose the numerical level for benchmarking.")
        self.parametersLayout.addRow("Numerical level ",
                                     self.numericalLevelSpinBox)

        #
        # Comparison method combo box
        #
        self.comparisonMethodComboBox = qt.QComboBox()
        self.comparisonMethodComboBox.addItem(COMPARISON_METHOD_MEAN)
        self.comparisonMethodComboBox.addItem(COMPARISON_METHOD_MEDIAN)
        self.comparisonMethodComboBox.addItem(COMPARISON_METHOD_MAXIMUM)
        self.comparisonMethodComboBox.addItem(COMPARISON_METHOD_MINIMUM)
        self.comparisonMethodComboBox.setToolTip(
            "Choose the comparison method.")
        self.parametersLayout.addRow("Comparison method ",
                                     self.comparisonMethodComboBox)

        # connections
        self.benchmarkCriterionComboBox.connect(
            'currentIndexChanged(QString)', self.onBenchmarkCriterionChanged)
        self.numericalLevelSpinBox.connect('valueChanged(double)',
                                           self.onNumericalLevelChanged)
        self.comparisonMethodComboBox.connect('currentIndexChanged(QString)',
                                              self.onComparisonMethodChanged)
示例#6
0
    def setupOptionsFrame(self):

        self.methodSelectorComboBox = qt.QComboBox()
        self.methodSelectorComboBox.addItem("Median", MEDIAN)
        self.methodSelectorComboBox.addItem("Opening (remove extrusions)",
                                            MORPHOLOGICAL_OPENING)
        self.methodSelectorComboBox.addItem("Closing (fill holes)",
                                            MORPHOLOGICAL_CLOSING)
        self.methodSelectorComboBox.addItem("Gaussian", GAUSSIAN)
        self.methodSelectorComboBox.setToolTip(
            '<html>Smoothing methods:<ul style="margin: 0"><li><b>Median:</b> removes small details while keeps smooth contours mostly unchanged.</li><li><b>Opening:</b> removes extrusions smaller than the specified kernel size.</li><li><b>Closing:</b> fills sharp corners and holes smaller than the specified kernel size.</li><li><b>Gaussian:</b> smoothes all contours, tends to shrink the segment.</li></ul></html>'
        )
        self.scriptedEffect.addLabeledOptionsWidget(
            "Smoothing method:", self.methodSelectorComboBox)

        self.kernelSizeMmSpinBox = slicer.qMRMLSpinBox()
        self.kernelSizeMmSpinBox.setMRMLScene(slicer.mrmlScene)
        self.kernelSizeMmSpinBox.setToolTip(
            "Diameter of the neighborhood that will be considered around each voxel. Higher value makes smoothing stronger (more details are suppressed)."
        )
        self.kernelSizeMmSpinBox.quantity = "length"
        self.kernelSizeMmSpinBox.unitAwareProperties &= ~slicer.qMRMLSpinBox.MinimumValue  # disable setting deafult minimum value (it would be a large negative value)
        self.kernelSizeMmSpinBox.minimum = 0.0
        self.kernelSizeMmSpinBox.value = 3.0
        self.kernelSizeMmSpinBox.singleStep = 1.0

        self.kernelSizePixel = qt.QLabel()
        self.kernelSizePixel.setToolTip(
            "Diameter of the neighborhood in pixels. Computed from the segment's spacing and the specified kernel size."
        )

        kernelSizeFrame = qt.QHBoxLayout()
        kernelSizeFrame.addWidget(self.kernelSizePixel)
        kernelSizeFrame.addWidget(self.kernelSizeMmSpinBox)
        self.kernelSizeMmLabel = self.scriptedEffect.addLabeledOptionsWidget(
            "Kernel size:", kernelSizeFrame)

        self.gaussianStandardDeviationMmSpinBox = slicer.qMRMLSpinBox()
        self.gaussianStandardDeviationMmSpinBox.setMRMLScene(slicer.mrmlScene)
        self.gaussianStandardDeviationMmSpinBox.setToolTip(
            "Standard deviation of the Gaussian smoothing filter coefficients. Higher value makes smoothing stronger (more details are suppressed)."
        )
        self.gaussianStandardDeviationMmSpinBox.quantity = "length"
        self.gaussianStandardDeviationMmSpinBox.value = 3.0
        self.gaussianStandardDeviationMmSpinBox.singleStep = 1.0
        self.gaussianStandardDeviationMmLabel = self.scriptedEffect.addLabeledOptionsWidget(
            "Standard deviation:", self.gaussianStandardDeviationMmSpinBox)

        self.applyButton = qt.QPushButton("Apply")
        self.applyButton.objectName = self.__class__.__name__ + 'Apply'
        self.applyButton.setToolTip("Apply smoothing to selected segment")
        self.scriptedEffect.addOptionsWidget(self.applyButton)

        self.methodSelectorComboBox.connect("currentIndexChanged(int)",
                                            self.updateMRMLFromGUI)
        self.kernelSizeMmSpinBox.connect("valueChanged(double)",
                                         self.updateMRMLFromGUI)
        self.gaussianStandardDeviationMmSpinBox.connect(
            "valueChanged(double)", self.updateMRMLFromGUI)
        self.applyButton.connect('clicked()', self.onApply)
示例#7
0
    def setup(self):
        ScriptedLoadableModuleWidget.setup(self)

        # Instantiate and connect widgets ...

        #
        # Parameters Area
        #
        parametersCollapsibleButton = ctk.ctkCollapsibleButton()
        parametersCollapsibleButton.text = "Parameters"
        self.layout.addWidget(parametersCollapsibleButton)

        # Layout within the dummy collapsible button
        parametersFormLayout = qt.QFormLayout(parametersCollapsibleButton)

        #
        # atlas combo box
        #
        self.atlasComboBox = qt.QComboBox()
        parametersFormLayout.addRow("Atlas: ", self.atlasComboBox)

        #
        # Import Button
        #
        self.importButton = qt.QPushButton("Import")
        self.importButton.toolTip = "Import atlas."
        self.importButton.enabled = False
        parametersFormLayout.addRow(self.importButton)

        # connections
        self.importButton.connect('clicked(bool)', self.onImportButton)

        # Add vertical spacer
        self.layout.addStretch(1)
示例#8
0
    def setupControls(self):
        """ setupControls() -> create the widgets for this dialog

        """
        mainframe = qt.QFrame(self)
        self.setMainWidget(mainframe)

        self.quantitySpin = kdeui.KIntNumInput(mainframe)
        self.quantitySpin.setRange(1, 5000, 100, True)

        dblnames = ('aux', 'price', )
        combonames = ('symbol', 'action', 'type', 'exchange', )
        labelnames = ('symbol', 'aux', 'action', 'price', 'exchange', 'type', 
                      'quantity', )

        for name in dblnames:
            name = '%sEdit' % name
            setattr(self, name, kdeui.KDoubleNumInput(mainframe))
            getattr(self, name).setRange(0.0, 150.0, 0.01, True)

        for name in combonames:
            setattr(self, '%sCombo' % name, qt.QComboBox(0, mainframe))

        for name in labelnames:
            setattr(self, '%sLabel' % name, qt.QLabel(mainframe))
示例#9
0
    def __init__(self):
        columnNames = ['Convergence', 'Smoothing Sigmas', 'Shrink Factors']
        layout = CustomTable.__init__(self, columnNames)

        self.view.setItemDelegateForColumn(0, SpinBoxDelegate(self.model))
        self.view.setItemDelegateForColumn(1, SpinBoxDelegate(self.model))
        self.view.setItemDelegateForColumn(2, SpinBoxDelegate(self.model))

        self.smoothingSigmasUnitComboBox = qt.QComboBox()
        self.smoothingSigmasUnitComboBox.addItems(['vox', 'mm'])

        self.convergenceThresholdSpinBox = qt.QSpinBox()

        self.convergenceWindowSizeSpinBox = qt.QSpinBox()

        levelsSettingsFrame = qt.QFrame()
        levelsSettingsFrame.setLayout(qt.QFormLayout())
        levelsSettingsFrame.layout().addRow('Smoothing Sigmas Unit: ',
                                            self.smoothingSigmasUnitComboBox)
        levelsSettingsFrame.layout().addRow('Convergence Threshold (1e-N): ',
                                            self.convergenceThresholdSpinBox)
        levelsSettingsFrame.layout().addRow('Convergence Window Size: ',
                                            self.convergenceWindowSizeSpinBox)

        layout.addWidget(levelsSettingsFrame)
示例#10
0
  def __init__(self, parent):
    self.vLayout = qt.QVBoxLayout(parent)
    self.formLayout = qt.QFormLayout()

    self.componentName = qt.QLineEdit()
    self.formLayout.addRow("Name:", self.componentName)

    self.componentNameValidator = qt.QRegExpValidator(
        qt.QRegExp(r"^[a-zA-Z_][a-zA-Z0-9_]*$"))
    self.componentName.setValidator(self.componentNameValidator)

    self.componentType = qt.QComboBox()
    self.formLayout.addRow("Type:", self.componentType)

    self.destination = ctk.ctkPathLineEdit()
    self.destination.filters = ctk.ctkPathLineEdit.Dirs
    self.formLayout.addRow("Destination:", self.destination)

    self.vLayout.addLayout(self.formLayout)
    self.vLayout.addStretch(1)

    self.buttonBox = qt.QDialogButtonBox()
    self.buttonBox.setStandardButtons(qt.QDialogButtonBox.Ok |
                                      qt.QDialogButtonBox.Cancel)
    self.vLayout.addWidget(self.buttonBox)
示例#11
0
 def makeInterpolationComboBox(self):
     from torchio.transforms.interpolation import Interpolation
     values = [key.name.lower().capitalize() for key in Interpolation]
     comboBox = qt.QComboBox()
     comboBox.addItems(values)
     comboBox.setCurrentIndex(1)  # linear
     comboBox.setToolTip(self.getArgDocstring('image_interpolation'))
     return comboBox
示例#12
0
    def addTransformButton(self):
        self.transformsButton = ctk.ctkCollapsibleButton()
        self.transformsButton.text = 'Transforms'
        self.layout.addWidget(self.transformsButton)
        self.transformsLayout = qt.QFormLayout(self.transformsButton)

        self.transformsComboBox = qt.QComboBox()
        self.transformsLayout.addWidget(self.transformsComboBox)
示例#13
0
 def setupIntraopSeriesSelector(self):
     self.intraopSeriesSelector = qt.QComboBox()
     self.intraopSeriesSelector.setSizePolicy(qt.QSizePolicy.Expanding,
                                              qt.QSizePolicy.Minimum)
     self._seriesModel = qt.QStandardItemModel()
     self.intraopSeriesSelector.setModel(self._seriesModel)
     self.intraopSeriesSelector.setToolTip(
         constants.IntraopSeriesSelectorToolTip)
示例#14
0
    def setupOptionsFrame(self):

        self.methodSelectorComboBox = qt.QComboBox()
        self.methodSelectorComboBox.addItem("Copy", LOGICAL_COPY)
        self.methodSelectorComboBox.addItem("Add", LOGICAL_UNION)
        self.methodSelectorComboBox.addItem("Subtract", LOGICAL_SUBTRACT)
        self.methodSelectorComboBox.addItem("Intersect", LOGICAL_INTERSECT)
        self.methodSelectorComboBox.addItem("Invert", LOGICAL_INVERT)
        self.methodSelectorComboBox.addItem("Clear", LOGICAL_CLEAR)
        self.methodSelectorComboBox.addItem("Fill", LOGICAL_FILL)
        self.methodSelectorComboBox.setToolTip(
            '<html>Available operations:<ul style="margin: 0">'
            '<li><b>Replace by segment:</b> replace the selected segment by the modifier segment.</li>'
            '<li><b>Add segment:</b> add modifier segment to current segment.</li>'
            '<li><b>Subtract segment:</b> subtract region of modifier segment from the selected segment.</li>'
            '<li><b>Intersection with segment:</b> only keeps those regions in the select segment that are common with the modifier segment.</li>'
            '<li><b>Invert:</b> inverts selected segment.</li>'
            '<li><b>Clear:</b> clears selected segment.</li>'
            '<li><b>Fill:</b> completely fills selected segment.</li>')

        self.bypassMaskingCheckBox = qt.QCheckBox("Bypass masking")
        self.bypassMaskingCheckBox.setToolTip(
            "Ignore all masking options and only modify the selected segment.")
        self.bypassMaskingCheckBox.objectName = self.__class__.__name__ + 'BypassMasking'

        operationFrame = qt.QHBoxLayout()
        operationFrame.addWidget(self.methodSelectorComboBox)
        operationFrame.addWidget(self.bypassMaskingCheckBox)
        self.marginSizeMmLabel = self.scriptedEffect.addLabeledOptionsWidget(
            "Operation:", operationFrame)

        self.modifierSegmentSelectorLabel = qt.QLabel("Modifier segment:")
        self.scriptedEffect.addOptionsWidget(self.modifierSegmentSelectorLabel)

        self.modifierSegmentSelector = slicer.qMRMLSegmentsTableView()
        self.modifierSegmentSelector.selectionMode = qt.QAbstractItemView.SingleSelection
        self.modifierSegmentSelector.headerVisible = False
        self.modifierSegmentSelector.visibilityColumnVisible = False
        self.modifierSegmentSelector.opacityColumnVisible = False

        self.modifierSegmentSelector.setMRMLScene(slicer.mrmlScene)
        self.modifierSegmentSelector.setToolTip(
            'Contents of this segment will be used for modifying the selected segment. This segment itself will not be changed.'
        )
        self.scriptedEffect.addOptionsWidget(self.modifierSegmentSelector)

        self.applyButton = qt.QPushButton("Apply")
        self.applyButton.objectName = self.__class__.__name__ + 'Apply'
        self.scriptedEffect.addOptionsWidget(self.applyButton)

        self.applyButton.connect('clicked()', self.onApply)
        self.methodSelectorComboBox.connect("currentIndexChanged(int)",
                                            self.updateMRMLFromGUI)
        self.modifierSegmentSelector.connect(
            "selectionChanged(QItemSelection, QItemSelection)",
            self.updateMRMLFromGUI)
        self.bypassMaskingCheckBox.connect("stateChanged(int)",
                                           self.updateMRMLFromGUI)
示例#15
0
    def setup(self):
        ScriptedLoadableModuleWidget.setup(self)

        # Instantiate and connect widgets ...

        #
        # Parameters Area
        #
        parametersCollapsibleButton = ctk.ctkCollapsibleButton()
        parametersCollapsibleButton.text = "Parameters"
        self.layout.addWidget(parametersCollapsibleButton)

        # Layout within the dummy collapsible button
        parametersFormLayout = qt.QFormLayout(parametersCollapsibleButton)

        #
        # input volume selector
        #
        self.inputSelector = slicer.qMRMLNodeComboBox()
        self.inputSelector.nodeTypes = ["vtkMRMLScalarVolumeNode"]
        self.inputSelector.selectNodeUponCreation = True
        self.inputSelector.addEnabled = False
        self.inputSelector.removeEnabled = False
        self.inputSelector.noneEnabled = False
        self.inputSelector.showHidden = False
        self.inputSelector.showChildNodeTypes = False
        self.inputSelector.setMRMLScene(slicer.mrmlScene)
        self.inputSelector.setToolTip("Pick the input to the algorithm.")
        parametersFormLayout.addRow("Input Volume: ", self.inputSelector)

        #
        # Combo box to choose the machine
        #
        self.machineNameSelector = qt.QComboBox()
        self.machineNameSelector.toolTip = "Select the name of the machine."
        self.machineNameSelector.addItem("Tomotherapy 1")
        self.machineNameSelector.addItem("Tomotherapy 2")
        parametersFormLayout.addRow("Machine's name: ",
                                    self.machineNameSelector)

        #
        # Apply Button
        #
        self.applyButton = qt.QPushButton("Apply")
        self.applyButton.toolTip = "Run the algorithm."
        self.applyButton.enabled = False
        parametersFormLayout.addRow(self.applyButton)

        # connections
        self.applyButton.connect('clicked(bool)', self.onApplyButton)
        self.inputSelector.connect("currentNodeChanged(vtkMRMLNode*)",
                                   self.onSelect)

        # Add vertical spacer
        self.layout.addStretch(1)

        # Refresh Apply button state
        self.onSelect()
示例#16
0
 def _addPresetsCombo(self):
   self._presets = self.deviceClass.getPresets()
   self._presetCombo = qt.QComboBox()
   if self._presets:
     for model, properties in self._presets.items():
       values = "; ".join([properties[parameter] for parameter, attributes in self.deviceClass.getParameters().items()])
       self._presetCombo.addItem("{} | {{ {} }}".format(model, values))
     self._presetCombo.connect("currentIndexChanged(QString)", self.onPresetSelected)
     self.layout().addRow("Presets:", self._presetCombo)
示例#17
0
    def settingsPanelEntry(panel, parent):
        """Create a settings panel entry for this plugin class.
    It is added to the DICOM panel of the application settings
    by the DICOM module.
    """
        formLayout = qt.QFormLayout(parent)

        readersComboBox = qt.QComboBox()
        for approach in DICOMScalarVolumePluginClass.readerApproaches():
            readersComboBox.addItem(approach)
        readersComboBox.toolTip = (
            "Preferred back end.  Archetype was used by default in Slicer before June of 2017."
            "Change this setting if data that previously loaded stops working (and report an issue)."
        )
        formLayout.addRow("DICOM reader approach:", readersComboBox)
        panel.registerProperty("DICOM/ScalarVolume/ReaderApproach",
                               readersComboBox, "currentIndex",
                               str(qt.SIGNAL("currentIndexChanged(int)")))

        importFormatsComboBox = ctk.ctkComboBox()
        importFormatsComboBox.toolTip = (
            "Enable adding non-linear transform to regularize images acquired irregular geometry:"
            " non-rectilinear grid (such as tilted gantry CT acquisitions) and non-uniform slice spacing."
            " If no regularization is applied then image may appear distorted if it was acquired with irregular geometry."
        )
        importFormatsComboBox.addItem("default (none)", "default")
        importFormatsComboBox.addItem("none", "none")
        importFormatsComboBox.addItem("apply regularization transform",
                                      "transform")
        # in the future additional option, such as "resample" may be added
        importFormatsComboBox.currentIndex = 0
        formLayout.addRow("Acquisition geometry regularization:",
                          importFormatsComboBox)
        panel.registerProperty(
            "DICOM/ScalarVolume/AcquisitionGeometryRegularization",
            importFormatsComboBox, "currentUserDataAsString",
            str(qt.SIGNAL("currentIndexChanged(int)")),
            "DICOM examination settings",
            ctk.ctkSettingsPanel.OptionRequireRestart)
        # DICOM examination settings are cached so we need to restart to make sure changes take effect

        allowLoadingByTimeCheckBox = qt.QCheckBox()
        allowLoadingByTimeCheckBox.toolTip = (
            "Offer loading of individual slices or group of slices"
            " that were acquired at a specific time (content or trigger time)."
            " If this option is enabled then a large number of loadable items may be displayed in the Advanced section of DICOM browser."
        )
        formLayout.addRow("Allow loading subseries by time:",
                          allowLoadingByTimeCheckBox)
        allowLoadingByTimeMapper = ctk.ctkBooleanMapper(
            allowLoadingByTimeCheckBox, "checked",
            str(qt.SIGNAL("toggled(bool)")))
        panel.registerProperty("DICOM/ScalarVolume/AllowLoadingByTime",
                               allowLoadingByTimeMapper, "valueAsInt",
                               str(qt.SIGNAL("valueAsIntChanged(int)")),
                               "DICOM examination settings",
                               ctk.ctkSettingsPanel.OptionRequireRestart)
示例#18
0
 def __init__(self, parent, name, *args, **kwargs):
     qt.QHBox.__init__(self, parent, name)
     self.setName(name)
     self.setSpacing(0)
     hb = qt.QHBox(self)
     self._lstr = qt.QLabel("Perspective", hb, "perspective_label")
     self._lcombo = qt.QComboBox(hb, 'Perspective_ComboBox')
     self.connect(self._lcombo, qt.SIGNAL('activated(int)'),
                  parent.setActivePerspective)
示例#19
0
 def __init__(self, parent=None):
     super(ConfigurationPage, self).__init__(parent)
     configGroup = qt.QHGroupBox("Server configuration", self)
     serverLabel = qt.QLabel("Server:", configGroup)
     serverCombo = qt.QComboBox(configGroup)
     serverCombo.insertItem("Trolltech (Australia)")
     serverCombo.insertItem("Trolltech (Germany)")
     serverCombo.insertItem("Trolltech (Norway)")
     serverCombo.insertItem("Trolltech (People's Republic of China)")
     serverCombo.insertItem("Trolltech (USA)")
示例#20
0
    def __init__(self,
                 parent,
                 titleType=Label,
                 valueType=Label,
                 orientation=Horizontal):
        qt.QWidget.__init__(self, parent)

        self.__valueList = []
        self.__titleList = []

        self.orientation = orientation
        self.titleType = titleType
        self.valueType = valueType

        if self.orientation == QubValue.Horizontal:
            self.layout = qt.QHBoxLayout(self)
        else:
            self.layout = qt.QVBoxLayout(self)

        if self.titleType == QubValue.Combo:
            self.titleWidget = qt.QComboBox(self)
            self.connect(self.titleWidget, qt.SIGNAL("activated(int)"),
                         self.__activatedType)
        else:
            self.titleWidget = qt.QLabel(self)
        self.layout.addWidget(self.titleWidget)

        self.layout.addSpacing(5)

        if self.valueType == QubValue.Combo:
            self.valueWidget = qt.QComboBox(self)
            self.connect(self.valueWidget, qt.SIGNAL("activated(int)"),
                         self.__activatedValue)
        elif self.valueType == QubValue.Text:
            self.valueWidget = qt.QLineEdit(self)
            self.connect(self.valueWidget, qt.SIGNAL("returnPressed()"),
                         self.__returnPressed)
        else:
            self.valueWidget = qt.QLabel(self)
            self.valueWidget.setFrameShape(qt.QFrame.NoFrame)
            self.valueWidget.setFrameShadow(qt.QFrame.Plain)
        self.layout.addWidget(self.valueWidget)
示例#21
0
    def setup(self):
        ScriptedLoadableModuleWidget.setup(self)

        # Instantiate and connect widgets ...

        #
        # Parameters Area
        #
        parametersCollapsibleButton = ctk.ctkCollapsibleButton()
        parametersCollapsibleButton.text = "Parameters"
        self.layout.addWidget(parametersCollapsibleButton)

        # Layout within the dummy collapsible button
        parametersFormLayout = qt.QFormLayout(parametersCollapsibleButton)

        #
        # atlases directory
        #
        self.atlasDirectoryButton = ctk.ctkDirectoryButton()
        parametersFormLayout.addRow("Directory: ", self.atlasDirectoryButton)

        #
        # atlas combo box
        #
        self.atlasComboBox = qt.QComboBox()
        parametersFormLayout.addRow("Atlas: ", self.atlasComboBox)

        #
        # Import Button
        #
        self.importButton = qt.QPushButton("Import")
        self.importButton.toolTip = "Import atlas."
        self.importButton.enabled = False
        parametersFormLayout.addRow(self.importButton)

        # connections
        self.importButton.connect('clicked(bool)', self.onImportButton)
        self.atlasDirectoryButton.directoryChanged.connect(
            self.onAtlasDirectoryChanged)
        #self.inputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect)
        #self.outputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect)

        # Add vertical spacer
        self.layout.addStretch(1)

        # Refresh dir

        modulePath = os.path.split(__file__)[0]
        with open(
                os.path.join(modulePath, 'Resources', 'previousDirectory.txt'),
                'r') as f:
            directory = f.readlines()[0]
        self.atlasDirectoryButton.directory = directory if os.path.isdir(
            directory) else '.'
示例#22
0
    def __init__(self, parent=None, name=None, fl=0):
        CreateTaskBase.__init__(self, parent, name, fl, "Workflow")

        # Data attributes
        self.workflow_hwobj = None
        self.workflows = {}

        self.init_models()

        # Layout
        v_layout = qt.QVBoxLayout(self, 2, 5, "main_v_layout")

        self._workflow_type_gbox = qt.QVGroupBox("Workflow type", self,
                                                 "workflow_rtype")

        self._workflow_cbox = qt.QComboBox(self._workflow_type_gbox)

        self._data_path_gbox = qt.QVGroupBox("Data location", self,
                                             "data_path_gbox")
        self._data_path_widget = DataPathWidget(self._data_path_gbox,
                                                data_model=self._path_template,
                                                layout="vertical")

        self._data_path_widget.data_path_widget_layout.child(
            "file_name_label").setText("")
        self._data_path_widget.data_path_widget_layout.child(
            "file_name_value_label").hide()

        # self._grid_widget = MxLookupScanBrick.MxLookupScanBrick(self, 'grid_widget')

        v_layout.addWidget(self._workflow_type_gbox)
        v_layout.addWidget(self._data_path_gbox)
        # v_layout.addWidget(self._grid_widget)
        v_layout.addStretch()

        self.connect(
            self._data_path_widget.data_path_widget_layout.child(
                "prefix_ledit"),
            qt.SIGNAL("textChanged(const QString &)"),
            self._prefix_ledit_change,
        )

        self.connect(
            self._data_path_widget.data_path_widget_layout.child(
                "run_number_ledit"),
            qt.SIGNAL("textChanged(const QString &)"),
            self._run_number_ledit_change,
        )

        self.connect(
            self._data_path_widget,
            qt.PYSIGNAL("path_template_changed"),
            self.handle_path_conflict,
        )
示例#23
0
  def setupOptionsFrame(self):

    self.methodSelectorComboBox = qt.QComboBox()
    self.methodSelectorComboBox.addItem("Median", MEDIAN)
    self.methodSelectorComboBox.addItem("Opening (remove extrusions)", MORPHOLOGICAL_OPENING)
    self.methodSelectorComboBox.addItem("Closing (fill holes)", MORPHOLOGICAL_CLOSING)
    self.methodSelectorComboBox.addItem("Gaussian", GAUSSIAN)
    self.methodSelectorComboBox.addItem("Joint smoothing", JOINT_TAUBIN)
    self.scriptedEffect.addLabeledOptionsWidget("Smoothing method:", self.methodSelectorComboBox)

    self.kernelSizeMmSpinBox = slicer.qMRMLSpinBox()
    self.kernelSizeMmSpinBox.setMRMLScene(slicer.mrmlScene)
    self.kernelSizeMmSpinBox.setToolTip("Diameter of the neighborhood that will be considered around each voxel. Higher value makes smoothing stronger (more details are suppressed).")
    self.kernelSizeMmSpinBox.quantity = "length"
    self.kernelSizeMmSpinBox.minimum = 0.0
    self.kernelSizeMmSpinBox.value = 3.0
    self.kernelSizeMmSpinBox.singleStep = 1.0

    self.kernelSizePixel = qt.QLabel()
    self.kernelSizePixel.setToolTip("Diameter of the neighborhood in pixels. Computed from the segment's spacing and the specified kernel size.")

    kernelSizeFrame = qt.QHBoxLayout()
    kernelSizeFrame.addWidget(self.kernelSizeMmSpinBox)
    kernelSizeFrame.addWidget(self.kernelSizePixel)
    self.kernelSizeMmLabel = self.scriptedEffect.addLabeledOptionsWidget("Kernel size:", kernelSizeFrame)

    self.gaussianStandardDeviationMmSpinBox = slicer.qMRMLSpinBox()
    self.gaussianStandardDeviationMmSpinBox.setMRMLScene(slicer.mrmlScene)
    self.gaussianStandardDeviationMmSpinBox.setToolTip("Standard deviation of the Gaussian smoothing filter coefficients. Higher value makes smoothing stronger (more details are suppressed).")
    self.gaussianStandardDeviationMmSpinBox.quantity = "length"
    self.gaussianStandardDeviationMmSpinBox.value = 3.0
    self.gaussianStandardDeviationMmSpinBox.singleStep = 1.0
    self.gaussianStandardDeviationMmLabel = self.scriptedEffect.addLabeledOptionsWidget("Standard deviation:", self.gaussianStandardDeviationMmSpinBox)

    self.jointTaubinSmoothingFactorSlider = ctk.ctkSliderWidget()
    self.jointTaubinSmoothingFactorSlider.setToolTip("Higher value means stronger smoothing.")
    self.jointTaubinSmoothingFactorSlider.minimum = 0.01
    self.jointTaubinSmoothingFactorSlider.maximum = 1.0
    self.jointTaubinSmoothingFactorSlider.value = 0.5
    self.jointTaubinSmoothingFactorSlider.singleStep = 0.01
    self.jointTaubinSmoothingFactorSlider.pageStep = 0.1
    self.jointTaubinSmoothingFactorLabel = self.scriptedEffect.addLabeledOptionsWidget("Smoothing factor:", self.jointTaubinSmoothingFactorSlider)

    self.applyButton = qt.QPushButton("Apply")
    self.applyButton.objectName = self.__class__.__name__ + 'Apply'
    self.applyButton.setToolTip("Apply smoothing to selected segment")
    self.scriptedEffect.addOptionsWidget(self.applyButton)

    self.methodSelectorComboBox.connect("currentIndexChanged(int)", self.updateMRMLFromGUI)
    self.kernelSizeMmSpinBox.connect("valueChanged(double)", self.updateMRMLFromGUI)
    self.gaussianStandardDeviationMmSpinBox.connect("valueChanged(double)", self.updateMRMLFromGUI)
    self.jointTaubinSmoothingFactorSlider.connect("valueChanged(double)", self.updateMRMLFromGUI)
    self.applyButton.connect('clicked()', self.onApply)
示例#24
0
    def open(self):
        self.studyLabel = qt.QLabel('Send %d items to destination' %
                                    len(self.files))
        self.layout().addWidget(self.studyLabel)

        # Send Parameters
        self.dicomFrame = qt.QFrame(self)
        self.dicomFormLayout = qt.QFormLayout()
        self.dicomFrame.setLayout(self.dicomFormLayout)

        self.settings = qt.QSettings()

        self.protocolSelectorCombobox = qt.QComboBox()
        self.protocolSelectorCombobox.addItems(["DIMSE", "DICOMweb"])
        self.protocolSelectorCombobox.setCurrentText(
            self.settings.value('DICOM/Send/Protocol', 'DIMSE'))
        self.protocolSelectorCombobox.currentIndexChanged.connect(
            self.onProtocolSelectorChange)
        self.dicomFormLayout.addRow("Protocol: ",
                                    self.protocolSelectorCombobox)

        self.serverAETitleEdit = qt.QLineEdit()
        self.serverAETitleEdit.setToolTip("AE Title")
        self.serverAETitleEdit.text = self.settings.value(
            'DICOM/Send/AETitle', 'CTK')
        self.dicomFormLayout.addRow("AE Title: ", self.serverAETitleEdit)
        # Enable AET only for DIMSE
        self.serverAETitleEdit.enabled = self.protocolSelectorCombobox.currentText == 'DIMSE'

        self.serverAddressLineEdit = qt.QLineEdit()
        self.serverAddressLineEdit.setToolTip(
            "Address includes hostname and port number in standard URL format (hostname:port)."
        )
        self.serverAddressLineEdit.text = self.settings.value(
            'DICOM/Send/URL', '')
        self.dicomFormLayout.addRow("Destination Address: ",
                                    self.serverAddressLineEdit)

        self.layout().addWidget(self.dicomFrame)

        # button box
        self.bbox = qt.QDialogButtonBox(self)
        self.bbox.addButton(self.bbox.Ok)
        self.bbox.addButton(self.bbox.Cancel)
        self.bbox.accepted.connect(self.onOk)
        self.bbox.rejected.connect(self.onCancel)
        self.layout().addWidget(self.bbox)

        self.progressBar = qt.QProgressBar(self.parent().window())
        self.progressBar.hide()
        self.dicomFormLayout.addRow(self.progressBar)

        qt.QDialog.open(self)
示例#25
0
    def setupOptionsFrame(self):

        # Autoscroll range slider
        self.autoscrollRangeSlider = slicer.qMRMLSliderWidget()
        self.autoscrollRangeSlider.setMRMLScene(slicer.mrmlScene)
        self.autoscrollRangeSlider.minimum = 0
        self.autoscrollRangeSlider.maximum = 10
        self.autoscrollRangeSlider.value = 5
        self.autoscrollRangeSlider.setToolTip(
            'How many slices you would like to autoscroll up and down')
        self.scriptedEffect.addLabeledOptionsWidget("Slice range:",
                                                    self.autoscrollRangeSlider)

        # Autoscroll speed slider
        self.autoscrollSpeedSlider = slicer.qMRMLSliderWidget()
        self.autoscrollSpeedSlider.setMRMLScene(slicer.mrmlScene)
        self.autoscrollSpeedSlider.minimum = 1
        self.autoscrollSpeedSlider.maximum = 100
        self.autoscrollSpeedSlider.value = 20
        self.autoscrollSpeedSlider.setToolTip(
            'How many slices you want to autoscroll per second')
        self.scriptedEffect.addLabeledOptionsWidget("Slice speed:",
                                                    self.autoscrollSpeedSlider)

        # Input view selector
        self.sliceNodeSelector = qt.QComboBox()
        self.sliceNodeSelector.setToolTip(
            "This slice will be excluded during autoscrolling.")
        self.scriptedEffect.addLabeledOptionsWidget("Exclude view:",
                                                    self.sliceNodeSelector)

        # Start button
        self.applyButton = qt.QPushButton("Start")
        self.applyButton.objectName = self.__class__.__name__ + 'Start'
        self.applyButton.setToolTip("Start/Stop autoscrolling (Alt+C)")
        self.scriptedEffect.addOptionsWidget(self.applyButton)

        # Set Hotkeys
        self.hotkey = qt.QShortcut(qt.QKeySequence("Alt+C"),
                                   slicer.util.mainWindow())
        self.hotkey2 = qt.QShortcut(qt.QKeySequence("Ctrl+Alt+C"),
                                    slicer.util.mainWindow())

        # Connections
        self.applyButton.connect('clicked()', self.onApply)
        self.sliceNodeSelector.connect("currentIndexChanged(int)",
                                       self.updateGUIFromMRML)
        self.hotkey.connect('activated()', self.autoscrollHotkey)
        self.hotkey2.connect('activated()', self.openSettings)

        # Initialize variables
        self.setupVariables()
示例#26
0
    def setupOptionsFrame(self):

        self.methodSelectorComboBox = qt.QComboBox()
        self.methodSelectorComboBox.addItem("Copy", LOGICAL_COPY)
        self.methodSelectorComboBox.addItem("Add", LOGICAL_UNION)
        self.methodSelectorComboBox.addItem("Subtract", LOGICAL_SUBTRACT)
        self.methodSelectorComboBox.addItem("Intersect", LOGICAL_INTERSECT)
        self.methodSelectorComboBox.addItem("Invert", LOGICAL_INVERT)
        self.methodSelectorComboBox.addItem("Clear", LOGICAL_CLEAR)
        self.methodSelectorComboBox.addItem("Fill", LOGICAL_FILL)
        self.methodSelectorComboBox.setToolTip(
            'Click <dfn>Show details</dfn> link above for description of operations.'
        )

        self.bypassMaskingCheckBox = qt.QCheckBox("Bypass masking")
        self.bypassMaskingCheckBox.setToolTip(
            "Ignore all masking options and only modify the selected segment.")
        self.bypassMaskingCheckBox.objectName = self.__class__.__name__ + 'BypassMasking'

        self.applyButton = qt.QPushButton("Apply")
        self.applyButton.objectName = self.__class__.__name__ + 'Apply'

        operationFrame = qt.QHBoxLayout()
        operationFrame.addWidget(self.methodSelectorComboBox)
        operationFrame.addWidget(self.applyButton)
        operationFrame.addWidget(self.bypassMaskingCheckBox)
        self.marginSizeMmLabel = self.scriptedEffect.addLabeledOptionsWidget(
            "Operation:", operationFrame)

        self.modifierSegmentSelectorLabel = qt.QLabel("Modifier segment:")
        self.scriptedEffect.addOptionsWidget(self.modifierSegmentSelectorLabel)

        self.modifierSegmentSelector = slicer.qMRMLSegmentsTableView()
        self.modifierSegmentSelector.selectionMode = qt.QAbstractItemView.SingleSelection
        self.modifierSegmentSelector.headerVisible = False
        self.modifierSegmentSelector.visibilityColumnVisible = False
        self.modifierSegmentSelector.opacityColumnVisible = False

        self.modifierSegmentSelector.setMRMLScene(slicer.mrmlScene)
        self.modifierSegmentSelector.setToolTip(
            'Contents of this segment will be used for modifying the selected segment. This segment itself will not be changed.'
        )
        self.scriptedEffect.addOptionsWidget(self.modifierSegmentSelector)

        self.applyButton.connect('clicked()', self.onApply)
        self.methodSelectorComboBox.connect("currentIndexChanged(int)",
                                            self.updateMRMLFromGUI)
        self.modifierSegmentSelector.connect(
            "selectionChanged(QItemSelection, QItemSelection)",
            self.updateMRMLFromGUI)
        self.bypassMaskingCheckBox.connect("stateChanged(int)",
                                           self.updateMRMLFromGUI)
示例#27
0
    def __init__(self, parent=None):
        qt.QFrame.__init__(self)

        self.parameterNode = None

        #
        # Parameters area
        #
        self.parametersLayout = qt.QFormLayout(self)
        self.setLayout(self.parametersLayout)

        #
        # Scaling method combo box
        #
        self.scalingMethodComboBox = qt.QComboBox()
        self.scalingMethodComboBox.addItem(SCALING_METHOD_ZSCORE)
        self.scalingMethodComboBox.addItem(SCALING_METHOD_PERCENTILE)
        self.scalingMethodComboBox.addItem(SCALING_METHOD_RAW)
        self.scalingMethodComboBox.setToolTip("Choose the scaling method.")
        self.parametersLayout.addRow("Scaling method ",
                                     self.scalingMethodComboBox)

        #
        # Aggregation method combo box
        #
        self.aggregationMethodComboBox = qt.QComboBox()
        self.aggregationMethodComboBox.addItem(AGGREGATION_METHOD_MEAN)
        self.aggregationMethodComboBox.addItem(AGGREGATION_METHOD_MEDIAN)
        self.aggregationMethodComboBox.addItem(AGGREGATION_METHOD_MAXIMUM)
        self.aggregationMethodComboBox.setToolTip(
            "Choose the aggregation method.")
        self.parametersLayout.addRow("Aggregation method ",
                                     self.aggregationMethodComboBox)

        # connections
        self.scalingMethodComboBox.connect('currentIndexChanged(QString)',
                                           self.onScalingMethodChanged)
        self.aggregationMethodComboBox.connect('currentIndexChanged(QString)',
                                               self.onAggregationMethodChanged)
  def setupOptionsFrame(self):
    SegmentEditorThresholdEffect.setupOptionsFrame(self)

    # Hide threshold options
    self.applyButton.setHidden(True)
    self.useForPaintButton.setHidden(True)

    # Add diameter selector
    self.minimumDiameterSpinBox = slicer.qMRMLSpinBox()
    self.minimumDiameterSpinBox.setMRMLScene(slicer.mrmlScene)
    self.minimumDiameterSpinBox.quantity = "length"
    self.minimumDiameterSpinBox.value = 3.0
    self.minimumDiameterSpinBox.singleStep = 0.5
    self.minimumDiameterSpinBox.setToolTip("Minimum diameter of the structure. Regions that are connected to the selected point by a bridge"
      " that this is thinner than this size will be excluded to prevent unwanted leaks through small holes.")
    self.kernelSizePixel = qt.QLabel()
    self.kernelSizePixel.setToolTip("Minimum diameter of the structure in pixels. Computed from the segment's spacing and the specified feature size.")
    minimumDiameterFrame = qt.QHBoxLayout()
    minimumDiameterFrame.addWidget(self.minimumDiameterSpinBox)
    minimumDiameterFrame.addWidget(self.kernelSizePixel)
    self.minimumDiameterMmLabel = self.scriptedEffect.addLabeledOptionsWidget("Minimum diameter:", minimumDiameterFrame)
    self.scriptedEffect.addOptionsWidget(minimumDiameterFrame)

    # Add algorithm options
    self.segmentationAlgorithmSelector = qt.QComboBox()
    self.segmentationAlgorithmSelector.addItem(SEGMENTATION_ALGORITHM_MASKING)
    self.segmentationAlgorithmSelector.addItem(SEGMENTATION_ALGORITHM_GROWCUT)
    self.segmentationAlgorithmSelector.addItem(SEGMENTATION_ALGORITHM_WATERSHED)
    self.scriptedEffect.addLabeledOptionsWidget("Segmentation algorithm: ", self.segmentationAlgorithmSelector)

    # Add feature size selector
    self.featureSizeSpinBox = slicer.qMRMLSpinBox()
    self.featureSizeSpinBox.setMRMLScene(slicer.mrmlScene)
    self.featureSizeSpinBox.quantity = "length"
    self.featureSizeSpinBox.value = 3.0
    self.featureSizeSpinBox.singleStep = 0.5
    self.featureSizeSpinBox.setToolTip("Spatial smoothness constraint used for WaterShed. Larger values result in smoother extracted surface.")
    self.scriptedEffect.addLabeledOptionsWidget("Feature size: ", self.featureSizeSpinBox)

    # Add ROI options
    self.roiSelector = slicer.qMRMLNodeComboBox()
    self.roiSelector.nodeTypes = ['vtkMRMLMarkupsROINode', 'vtkMRMLAnnotationROINode']
    self.roiSelector.noneEnabled = True
    self.roiSelector.setMRMLScene(slicer.mrmlScene)
    self.scriptedEffect.addLabeledOptionsWidget("ROI: ", self.roiSelector)

    # Connections
    self.minimumDiameterSpinBox.connect("valueChanged(double)", self.updateMRMLFromGUI)
    self.featureSizeSpinBox.connect("valueChanged(double)", self.updateMRMLFromGUI)
    self.segmentationAlgorithmSelector.connect("currentIndexChanged(int)", self.updateMRMLFromGUI)
    def setupOptionsFrame(self):
        SegmentEditorThresholdEffect.setupOptionsFrame(self)

        # Hide threshold options
        self.applyButton.setHidden(True)
        self.useForPaintButton.setHidden(True)

        # Add feature options
        self.minimumMinimumFeatureSize = slicer.qMRMLSpinBox()
        self.minimumMinimumFeatureSize.setMRMLScene(slicer.mrmlScene)
        self.minimumMinimumFeatureSize.quantity = "length"
        self.minimumMinimumFeatureSize.value = 3.0
        self.minimumMinimumFeatureSize.singleStep = 0.5
        self.kernelSizePixel = qt.QLabel()
        self.kernelSizePixel.setToolTip(
            "Minimum size of features in pixels. Computed from the segment's spacing and the specified feature size."
        )
        featureSizeFrame = qt.QHBoxLayout()
        featureSizeFrame.addWidget(self.minimumMinimumFeatureSize)
        featureSizeFrame.addWidget(self.kernelSizePixel)
        self.featureSizeMmLabel = self.scriptedEffect.addLabeledOptionsWidget(
            "Feature size:", featureSizeFrame)
        self.scriptedEffect.addOptionsWidget(featureSizeFrame)

        # Add algorithm options
        self.segmentationAlgorithmSelector = qt.QComboBox()
        self.segmentationAlgorithmSelector.addItem(
            SEGMENTATION_ALGORITHM_MASKING)
        self.segmentationAlgorithmSelector.addItem(
            SEGMENTATION_ALGORITHM_GROWCUT)
        self.segmentationAlgorithmSelector.addItem(
            SEGMENTATION_ALGORITHM_WATERSHED)
        self.scriptedEffect.addLabeledOptionsWidget(
            "Segmentation algorithm: ", self.segmentationAlgorithmSelector)

        # Add ROI options
        self.roiSelector = slicer.qMRMLNodeComboBox()
        self.roiSelector.nodeTypes = ['vtkMRMLAnnotationROINode']
        self.roiSelector.noneEnabled = True
        self.roiSelector.setMRMLScene(slicer.mrmlScene)
        self.scriptedEffect.addLabeledOptionsWidget("ROI: ", self.roiSelector)

        # Connections
        self.minimumMinimumFeatureSize.connect("valueChanged(double)",
                                               self.updateMRMLFromGUI)
        self.segmentationAlgorithmSelector.connect("currentIndexChanged(int)",
                                                   self.updateMRMLFromGUI)
示例#30
0
    def settingsPanelEntry(panel, parent):
        """Create a settings panel entry for this plugin class.
    It is added to the DICOM panel of the application settings
    by the DICOM module.
    """
        formLayout = qt.QFormLayout(parent)
        readersComboBox = qt.QComboBox()
        for approach in DICOMScalarVolumePluginClass.readerApproaches():
            readersComboBox.addItem(approach)

        readersComboBox.toolTip = "Preferred back end.  Archetype was used by default in Slicer before June of 2017.  Change this setting if data that previously loaded stops working (and report an issue)."

        formLayout.addRow("DICOM reader approach:", readersComboBox)

        panel.registerProperty("DICOM/ScalarVolume/ReaderApproach",
                               readersComboBox, "currentIndex",
                               str(qt.SIGNAL("currentIndexChanged(int)")))