本文整理汇总了Python中slicer.qMRMLNodeComboBox函数的典型用法代码示例。如果您正苦于以下问题:Python qMRMLNodeComboBox函数的具体用法?Python qMRMLNodeComboBox怎么用?Python qMRMLNodeComboBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qMRMLNodeComboBox函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
self.logic = ScreenCaptureLogic()
self.logic.logCallback = self.addLog
self.viewNodeType = None
self.animationMode = None
self.createdOutputFile = None
self.snapshotIndex = 0 # this counter is used for determining file names for single-image snapshots
self.snapshotOutputDir = None
self.snapshotFileNamePattern = None
# Instantiate and connect widgets ...
#
# Input area
#
self.inputCollapsibleButton = ctk.ctkCollapsibleButton()
self.inputCollapsibleButton.text = "Input"
self.layout.addWidget(self.inputCollapsibleButton)
inputFormLayout = qt.QFormLayout(self.inputCollapsibleButton)
# Input view selector
self.viewNodeSelector = slicer.qMRMLNodeComboBox()
self.viewNodeSelector.nodeTypes = ["vtkMRMLSliceNode", "vtkMRMLViewNode"]
self.viewNodeSelector.addEnabled = False
self.viewNodeSelector.removeEnabled = False
self.viewNodeSelector.noneEnabled = False
self.viewNodeSelector.showHidden = False
self.viewNodeSelector.showChildNodeTypes = False
self.viewNodeSelector.setMRMLScene( slicer.mrmlScene )
self.viewNodeSelector.setToolTip("This slice or 3D view will be updated during capture."
"Only this view will be captured unless 'Capture of all views' option in output section is enabled." )
inputFormLayout.addRow("Master view: ", self.viewNodeSelector)
# Mode
self.animationModeWidget = qt.QComboBox()
self.animationModeWidget.setToolTip("Select the property that will be adjusted")
inputFormLayout.addRow("Animation mode:", self.animationModeWidget)
# Slice start offset position
self.sliceStartOffsetSliderLabel = qt.QLabel("Start sweep offset:")
self.sliceStartOffsetSliderWidget = ctk.ctkSliderWidget()
self.sliceStartOffsetSliderWidget.singleStep = 30
self.sliceStartOffsetSliderWidget.minimum = -100
self.sliceStartOffsetSliderWidget.maximum = 100
self.sliceStartOffsetSliderWidget.value = 0
self.sliceStartOffsetSliderWidget.setToolTip("Start slice sweep offset.")
inputFormLayout.addRow(self.sliceStartOffsetSliderLabel, self.sliceStartOffsetSliderWidget)
# Slice end offset position
self.sliceEndOffsetSliderLabel = qt.QLabel("End sweep offset:")
self.sliceEndOffsetSliderWidget = ctk.ctkSliderWidget()
self.sliceEndOffsetSliderWidget.singleStep = 5
self.sliceEndOffsetSliderWidget.minimum = -100
self.sliceEndOffsetSliderWidget.maximum = 100
self.sliceEndOffsetSliderWidget.value = 0
self.sliceEndOffsetSliderWidget.setToolTip("End slice sweep offset.")
inputFormLayout.addRow(self.sliceEndOffsetSliderLabel, self.sliceEndOffsetSliderWidget)
# 3D rotation range
self.rotationSliderLabel = qt.QLabel("Rotation range:")
self.rotationSliderWidget = ctk.ctkRangeWidget()
self.rotationSliderWidget.singleStep = 5
self.rotationSliderWidget.minimum = -180
self.rotationSliderWidget.maximum = 180
self.rotationSliderWidget.minimumValue = -180
self.rotationSliderWidget.maximumValue = 180
self.rotationSliderWidget.setToolTip("View rotation range, relative to current view orientation.")
inputFormLayout.addRow(self.rotationSliderLabel, self.rotationSliderWidget)
# 3D rotation axis
self.rotationAxisLabel = qt.QLabel("Rotation axis:")
self.rotationAxisWidget = ctk.ctkRangeWidget()
self.rotationAxisWidget = qt.QComboBox()
self.rotationAxisWidget.addItem("Yaw", AXIS_YAW)
self.rotationAxisWidget.addItem("Pitch", AXIS_PITCH)
inputFormLayout.addRow(self.rotationAxisLabel, self.rotationAxisWidget)
# Sequence browser node selector
self.sequenceBrowserNodeSelectorLabel = qt.QLabel("Sequence:")
self.sequenceBrowserNodeSelectorWidget = slicer.qMRMLNodeComboBox()
self.sequenceBrowserNodeSelectorWidget.nodeTypes = ["vtkMRMLSequenceBrowserNode"]
self.sequenceBrowserNodeSelectorWidget.addEnabled = False
self.sequenceBrowserNodeSelectorWidget.removeEnabled = False
self.sequenceBrowserNodeSelectorWidget.noneEnabled = False
self.sequenceBrowserNodeSelectorWidget.showHidden = False
self.sequenceBrowserNodeSelectorWidget.setMRMLScene( slicer.mrmlScene )
self.sequenceBrowserNodeSelectorWidget.setToolTip( "Items defined by this sequence browser will be replayed." )
inputFormLayout.addRow(self.sequenceBrowserNodeSelectorLabel, self.sequenceBrowserNodeSelectorWidget)
# Sequence start index
self.sequenceStartItemIndexLabel = qt.QLabel("Start index:")
self.sequenceStartItemIndexWidget = ctk.ctkSliderWidget()
self.sequenceStartItemIndexWidget.minimum = 0
self.sequenceStartItemIndexWidget.decimals = 0
self.sequenceStartItemIndexWidget.setToolTip("First item in the sequence to capture.")
inputFormLayout.addRow(self.sequenceStartItemIndexLabel, self.sequenceStartItemIndexWidget)
#.........这里部分代码省略.........
开发者ID:gregsharp,项目名称:Slicer,代码行数:101,代码来源:ScreenCapture.py
示例2: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
# [TODO]
# Si potrebbe avere un file di configurazione che contiene eventualmente un path alla colorlut
# Se non e'vuoto allora lo prendo se no prendo questo di default
self.lutPath = os.path.join(slicer.app.slicerHome, "share/FreeSurfer/FreeSurferColorLUT20120827.txt")
print self.lutPath
# [END TODO]
self.zonedetectionCB = ctk.ctkCollapsibleButton()
self.zonedetectionCB.text = "Brain Zone Detection"
self.layout.addWidget(self.zonedetectionCB)
self.zoneDetectionLayout = qt.QFormLayout(self.zonedetectionCB)
### Select Atlas
self.atlasInputSelector = slicer.qMRMLNodeComboBox()
self.atlasInputSelector.nodeTypes = (("vtkMRMLScalarVolumeNode"), "")
self.atlasInputSelector.addAttribute("vtkMRMLScalarVolumeNode", "LabelMap", 0)
self.atlasInputSelector.selectNodeUponCreation = True
self.atlasInputSelector.addEnabled = False
self.atlasInputSelector.removeEnabled = False
self.atlasInputSelector.noneEnabled = True
self.atlasInputSelector.showHidden = False
self.atlasInputSelector.showChildNodeTypes = False
self.atlasInputSelector.setMRMLScene(slicer.mrmlScene)
self.atlasInputSelector.setToolTip("Pick the volumetric Atlas.")
self.zoneDetectionLayout.addRow("Volumetric parcels: ", self.atlasInputSelector)
self.dialog = qt.QFileDialog()
self.dialog.setFileMode(qt.QFileDialog.AnyFile)
self.dialog.setToolTip("Pick the input to the algorithm.")
self.fidsSelectorZone = slicer.qMRMLNodeComboBox()
self.fidsSelectorZone.nodeTypes = (("vtkMRMLMarkupsFiducialNode"), "")
self.fidsSelectorZone.selectNodeUponCreation = False
self.fidsSelectorZone.addEnabled = False
self.fidsSelectorZone.removeEnabled = False
self.fidsSelectorZone.noneEnabled = True
self.fidsSelectorZone.setMRMLScene(slicer.mrmlScene)
self.fidsSelectorZone.setToolTip("Select a fiducial list")
self.zoneDetectionLayout.addRow("Fiducial : ", self.fidsSelectorZone)
self.ROISize = qt.QLineEdit("7")
self.ROISize.setToolTip("Define side length of cubic region centered in contact centroid")
self.ROISize.setInputMask("D")
# Run Zone Detection button
self.zoneButton = qt.QPushButton("Apply")
self.zoneButton.toolTip = "Run the algorithm."
self.zoneButton.enabled = True
self.zoneDetectionLayout.addRow("Cubic Region Side Length:", self.ROISize)
self.zoneDetectionLayout.addRow(self.zoneButton)
# connections
self.zoneButton.connect("clicked(bool)", self.onZoneButton)
开发者ID:mnarizzano,项目名称:SEEGA,代码行数:59,代码来源:BrainZoneDetector.py
示例3: setup
def setup(self):
# Instantiate and connect widgets ...
# Collapsible button
parametersCollapsibleButton = ctk.ctkCollapsibleButton()
parametersCollapsibleButton.text = "Parameters"
self.layout.addWidget(parametersCollapsibleButton)
# Layout within the parameters collapsible button
parametersFormLayout = qt.QFormLayout(parametersCollapsibleButton)
# fiber
self.fiberSelector = slicer.qMRMLNodeComboBox(parametersCollapsibleButton)
self.fiberSelector.nodeTypes = ["vtkMRMLFiberBundleNode"]
self.fiberSelector.selectNodeUponCreation = False
self.fiberSelector.addEnabled = False
self.fiberSelector.removeEnabled = False
self.fiberSelector.noneEnabled = True
self.fiberSelector.showHidden = False
self.fiberSelector.showChildNodeTypes = False
self.fiberSelector.setMRMLScene(slicer.mrmlScene)
self.fiberSelector.setToolTip("Pick the fiber bundle to be converted.")
parametersFormLayout.addRow("Fiber Bundle", self.fiberSelector)
# label map
self.labelSelector = slicer.qMRMLNodeComboBox(parametersCollapsibleButton)
self.labelSelector.nodeTypes = ["vtkMRMLLabelMapVolumeNode"]
self.labelSelector.selectNodeUponCreation = False
self.labelSelector.addEnabled = False
self.labelSelector.removeEnabled = False
self.labelSelector.noneEnabled = True
self.labelSelector.showHidden = False
self.labelSelector.showChildNodeTypes = False
self.labelSelector.setMRMLScene(slicer.mrmlScene)
self.labelSelector.setToolTip(
"Pick the target label volume. Must already exists in order to define sampling grid. If needed, create one in the Editor module based on template volume."
)
parametersFormLayout.addRow("Target LabelMap", self.labelSelector)
# label value
self.labelValue = qt.QSpinBox(parametersCollapsibleButton)
self.labelValue.setToolTip("The numerical value for the rasterized fiber label.")
self.labelValue.setValue(1)
parametersFormLayout.addRow("Label Value", self.labelValue)
# apply
self.applyButton = qt.QPushButton(parametersCollapsibleButton)
self.applyButton.text = "Apply"
parametersFormLayout.addWidget(self.applyButton)
self.applyButton.connect("clicked()", self.onApply)
# Add vertical spacer
self.layout.addStretch(1)
开发者ID:kanampalli,项目名称:Slicer,代码行数:54,代码来源:FiberBundleToLabelMap.py
示例4: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
# Add margin to the sides
self.layout.setContentsMargins(4,0,4,0)
#
# Parameter Combobox
#
self.parameterSelector = slicer.qMRMLNodeComboBox()
self.parameterLabel = qt.QLabel("Parameter set: ")
self.parameterSelector.nodeTypes = ["vtkMRMLSegmentEditorNode"]
self.parameterSelector.removeEnabled = False
self.parameterSelector.showHidden = True
self.parameterSelector.setMRMLScene( slicer.mrmlScene )
self.parameterLayout = qt.QHBoxLayout()
self.parameterLayout.addWidget(self.parameterLabel)
self.parameterLayout.addWidget(self.parameterSelector)
self.layout.addLayout(self.parameterLayout)
self.parameterSelector.connect('currentNodeChanged(vtkMRMLNode*)', self.parameterNodeChanged)
#
# Segment editor widget
#
import qSlicerSegmentationsModuleWidgetsPythonQt
self.editor = qSlicerSegmentationsModuleWidgetsPythonQt.qMRMLSegmentEditorWidget()
# Set parameter node first so that the automatic selections made when the scene is set are saved
self.selectParameterNode()
self.editor.setMRMLScene(slicer.mrmlScene)
self.layout.addWidget(self.editor)
# Connect observers to scene events
self.addObserver(slicer.mrmlScene, slicer.mrmlScene.StartCloseEvent, self.onSceneStartClose)
self.addObserver(slicer.mrmlScene, slicer.mrmlScene.EndCloseEvent, self.onSceneEndClose)
self.addObserver(slicer.mrmlScene, slicer.mrmlScene.EndImportEvent, self.onSceneEndImport)
开发者ID:ming-hai,项目名称:SlicerRT,代码行数:35,代码来源:SegmentEditor.py
示例5: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
# Collapsible button
self.selectionCollapsibleButton = ctk.ctkCollapsibleButton()
self.selectionCollapsibleButton.text = "Selection"
self.layout.addWidget(self.selectionCollapsibleButton)
# Layout within the collapsible button
self.formLayout = qt.QFormLayout(self.selectionCollapsibleButton)
#
# the volume selectors
#
self.inputFrame = qt.QFrame(self.selectionCollapsibleButton)
self.inputFrame.setLayout(qt.QHBoxLayout())
self.formLayout.addWidget(self.inputFrame)
self.inputSelector = qt.QLabel("Input Vector Volume: ", self.inputFrame)
self.inputFrame.layout().addWidget(self.inputSelector)
self.inputSelector = slicer.qMRMLNodeComboBox(self.inputFrame)
self.inputSelector.nodeTypes = ["vtkMRMLVectorVolumeNode"]
self.inputSelector.addEnabled = False
self.inputSelector.removeEnabled = False
self.inputSelector.setMRMLScene( slicer.mrmlScene )
self.inputFrame.layout().addWidget(self.inputSelector)
self.outputFrame = qt.QFrame(self.selectionCollapsibleButton)
self.outputFrame.setLayout(qt.QHBoxLayout())
self.formLayout.addWidget(self.outputFrame)
self.outputSelector = qt.QLabel("Output Scalar Volume: ", self.outputFrame)
self.outputFrame.layout().addWidget(self.outputSelector)
self.outputSelector = slicer.qMRMLNodeComboBox(self.outputFrame)
self.outputSelector.nodeTypes = ["vtkMRMLScalarVolumeNode"]
self.outputSelector.setMRMLScene( slicer.mrmlScene )
self.outputSelector.addEnabled = True
self.outputSelector.renameEnabled = True
self.outputSelector.baseName = "Scalar Volume"
self.outputFrame.layout().addWidget(self.outputSelector)
# Apply button
self.applyButton = qt.QPushButton("Apply")
self.applyButton.toolTip = "Run Convert the vector to scalar."
self.formLayout.addWidget(self.applyButton)
self.applyButton.connect('clicked(bool)', self.onApply)
# Add vertical spacer
self.layout.addStretch(1)
开发者ID:kingofpanda,项目名称:Slicer,代码行数:47,代码来源:VectorToScalarVolume.py
示例6: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
self.layout.addStretch(1)
#surfaceModel model selector
self.surfaceModelSelector = slicer.qMRMLNodeComboBox()
self.surfaceModelSelector.nodeTypes = ["vtkMRMLModelNode"]
self.surfaceModelSelector.selectNodeUponCreation = True
self.surfaceModelSelector.addEnabled = False
self.surfaceModelSelector.removeEnabled = False
self.surfaceModelSelector.noneEnabled = False
self.surfaceModelSelector.showHidden = False
self.surfaceModelSelector.showChildNodeTypes = True
self.surfaceModelSelector.setMRMLScene( slicer.mrmlScene)
self.surfaceModelSelector.setToolTip("Load a ")
self.layout.addWidget(self.addRow("Surface Model: ", self.surfaceModelSelector))
#Centerline model selector (temporarily)
self.centerlineSelector = slicer.qMRMLNodeComboBox()
self.centerlineSelector.nodeTypes = ["vtkMRMLModelNode"]
self.centerlineSelector.selectNodeUponCreation = True
self.centerlineSelector.addEnabled = True
self.centerlineSelector.removeEnabled = True
self.centerlineSelector.noneEnabled = True
self.centerlineSelector.showHidden = False
self.centerlineSelector.showChildNodeTypes = False
self.centerlineSelector.setMRMLScene( slicer.mrmlScene)
self.centerlineSelector.setToolTip("Set a model node for the output centerline")
self.layout.addWidget(self.addRow("Centerline Output: ", self.centerlineSelector))
self.layout.addWidget(qt.QLabel("Some way to set the source and target points will be needed"))
self.layout.addWidget(qt.QLabel(" "))
#A button to perform the desired action
self.applyButton = qt.QPushButton("Run")
self.applyButton.enabled = False
self.layout.addWidget(self.addRow("Run: ", self.applyButton))
self.layout.addStretch(1)
#Connections
self.applyButton.connect('clicked(bool)', self.onApplyButton)
self.surfaceModelSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect)
self.centerlineSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect)
开发者ID:mschumak,项目名称:ProjectWeek2018,代码行数:45,代码来源:CenterlineFromSurface.py
示例7: setup
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 = ["vtkMRMLVectorVolumeNode"]
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 histogram." )
parametersFormLayout.addRow("Input Volume: ", self.inputSelector)
#
# check box to trigger taking screen shots for later use in tutorials
#
self.enableScreenshotsFlagCheckBox = qt.QCheckBox()
self.enableScreenshotsFlagCheckBox.checked = 0
self.enableScreenshotsFlagCheckBox.setToolTip("If checked, take screen shots for tutorials. Use Save Data to write them to disk.")
parametersFormLayout.addRow("Enable Screenshots", self.enableScreenshotsFlagCheckBox)
#
# 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()
开发者ID:SBU-BMI,项目名称:SlicerOpenCV,代码行数:55,代码来源:SlicerOpenCVSelfTest.py
示例8: createComboBox
def createComboBox(self, **kwargs):
combobox = slicer.qMRMLNodeComboBox()
combobox.addEnabled = False
combobox.removeEnabled = False
combobox.noneEnabled = True
combobox.showHidden = False
for key, value in kwargs.iteritems():
if hasattr(combobox, key):
setattr(combobox, key, value)
else:
logging.error("qMRMLNodeComboBox does not have attribute %s" % key)
combobox.setMRMLScene(slicer.mrmlScene)
return combobox
开发者ID:rcc-uchicago,项目名称:PCampReview,代码行数:13,代码来源:mixins.py
示例9: setup
def setup(self):
# Collapsible button
self.avgvolumesCollapsibleButton = ctk.ctkCollapsibleButton()
self.avgvolumesCollapsibleButton.text = "Average Scalar Volumes"
self.layout.addWidget(self.avgvolumesCollapsibleButton)
# Layout within the averaging collapsible button
self.avgvolumesFormLayout = qt.QFormLayout(self.avgvolumesCollapsibleButton)
#
# the volume selector
#
self.inputFrame = qt.QFrame(self.avgvolumesCollapsibleButton)
self.inputFrame.setLayout(qt.QHBoxLayout())
self.avgvolumesFormLayout.addWidget(self.inputFrame)
self.inputSelector = qt.QLabel("Select input nodes: ", self.inputFrame)
self.inputFrame.layout().addWidget(self.inputSelector)
self.inputSelector = slicer.qMRMLCheckableNodeComboBox(self.inputFrame)
self.inputSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
self.inputSelector.addEnabled = True
self.inputSelector.removeEnabled = True
self.inputSelector.setMRMLScene( slicer.mrmlScene )
self.inputFrame.layout().addWidget(self.inputSelector)
self.outputFrame = qt.QFrame(self.avgvolumesCollapsibleButton)
self.outputFrame.setLayout(qt.QHBoxLayout())
self.avgvolumesFormLayout.addWidget(self.outputFrame)
self.outputSelector = qt.QLabel("Select output reference volume ", self.outputFrame)
self.outputFrame.layout().addWidget(self.outputSelector)
self.outputSelector = slicer.qMRMLNodeComboBox(self.outputFrame)
self.outputSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
self.outputSelector.setMRMLScene( slicer.mrmlScene )
self.outputFrame.layout().addWidget(self.outputSelector)
# Ok button
okButton = qt.QPushButton("Ok")
okButton.toolTip = "Average selected volumes"
self.avgvolumesFormLayout.addWidget(okButton)
okButton.connect('clicked(bool)', self.onApply)
# Add vertical spacer
self.layout.addStretch(1)
# Set local var as instance attribute
self.okButton = okButton
开发者ID:ysuter,项目名称:new-modules,代码行数:48,代码来源:avg_selected_images.py
示例10: setup
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)
#
# fiducials
#
self.Fiducials = slicer.qMRMLNodeComboBox()
self.Fiducials.nodeTypes = ( ("vtkMRMLMarkupsFiducialNode"), "" )
self.Fiducials.selectNodeUponCreation = True
self.Fiducials.addEnabled = False
self.Fiducials.removeEnabled = False
self.Fiducials.noneEnabled = False
self.Fiducials.showHidden = False
self.Fiducials.showChildNodeTypes = False
self.Fiducials.setMRMLScene( slicer.mrmlScene )
self.Fiducials.setToolTip( "Pick the fiducials." )
parametersFormLayout.addRow("Fiducials: ", self.Fiducials)
#
# Apply Button
#
self.applyButton = qt.QPushButton("Apply")
self.applyButton.toolTip = "Run the algorithm."
self.applyButton.enabled = True
parametersFormLayout.addRow(self.applyButton)
# connections
self.applyButton.connect('clicked(bool)', self.onApplyButton)
# Add vertical spacer
self.layout.addStretch(1)
# Refresh Apply button state
self.onSelect()
开发者ID:dscorza,项目名称:slicer_modules_trials,代码行数:46,代码来源:surgeonEyeView.py
示例11: create
def create(self):
"""create the segmentation helper box"""
#
# Master Frame
#
self.masterFrame = qt.QFrame(self.parent)
self.masterFrame.setLayout(qt.QVBoxLayout())
self.parent.layout().addWidget(self.masterFrame)
#
# the master volume selector
#
self.masterSelectorFrame = qt.QFrame(self.parent)
self.masterSelectorFrame.objectName = 'MasterVolumeFrame'
self.masterSelectorFrame.setLayout(qt.QHBoxLayout())
self.masterFrame.layout().addWidget(self.masterSelectorFrame)
self.masterSelectorLabel = qt.QLabel("Master Volume: ", self.masterSelectorFrame)
self.masterSelectorLabel.setToolTip( "Select the master volume (background grayscale scalar volume node)")
self.masterSelectorFrame.layout().addWidget(self.masterSelectorLabel)
self.masterSelector = slicer.qMRMLNodeComboBox(self.masterSelectorFrame)
self.masterSelector.objectName = 'MasterVolumeNodeSelector'
# TODO
self.masterSelector.nodeTypes = ["vtkMRMLScalarVolumeNode"]
self.masterSelector.selectNodeUponCreation = False
self.masterSelector.addEnabled = False
self.masterSelector.removeEnabled = False
self.masterSelector.noneEnabled = True
self.masterSelector.showHidden = False
self.masterSelector.showChildNodeTypes = False
self.masterSelector.setMRMLScene( slicer.mrmlScene )
# TODO: need to add a QLabel
# self.masterSelector.SetLabelText( "Master Volume:" )
self.masterSelector.setToolTip( "Pick the master structural volume to define the segmentation. A label volume with the with \"%s\" appended to the name will be created if it doesn't already exist." % self.mergeVolumePostfix)
self.masterSelectorFrame.layout().addWidget(self.masterSelector)
#
# merge label name and set button
#
self.mergeSelectorFrame = qt.QFrame(self.masterFrame)
self.mergeSelectorFrame.objectName = 'MergeVolumeFrame'
self.mergeSelectorFrame.setLayout(qt.QHBoxLayout())
self.masterFrame.layout().addWidget(self.mergeSelectorFrame)
mergeNameToolTip = "Composite label map containing the merged structures (be aware that merge operations will overwrite any edits applied to this volume)"
self.mergeNameLabel = qt.QLabel("Merge Volume: ", self.mergeSelectorFrame)
self.mergeNameLabel.setToolTip( mergeNameToolTip )
self.mergeSelectorFrame.layout().addWidget(self.mergeNameLabel)
self.mergeSelector = slicer.qMRMLNodeComboBox(self.mergeSelectorFrame)
self.mergeSelector.objectName = 'MergeVolumeNodeSelector'
self.mergeSelector.setToolTip( mergeNameToolTip )
self.mergeSelector.nodeTypes = ["vtkMRMLLabelMapVolumeNode"]
self.mergeSelector.addEnabled = False
self.mergeSelector.removeEnabled = False
self.mergeSelector.noneEnabled = False
self.mergeSelector.showHidden = False
self.mergeSelector.showChildNodeTypes = False
self.mergeSelector.setMRMLScene( slicer.mrmlScene )
self.mergeSelectorFrame.layout().addWidget(self.mergeSelector)
self.newMergeVolumeAction = qt.QAction("Create new LabelMapVolume", self.mergeSelector)
self.newMergeVolumeAction.connect("triggered()", self.newMerge)
self.mergeSelector.addMenuAction(self.newMergeVolumeAction)
#
# Structures Frame
#
self.structuresFrame = ctk.ctkCollapsibleGroupBox(self.masterFrame)
self.structuresFrame.objectName = 'PerStructureVolumesFrame'
self.structuresFrame.title = "Per-Structure Volumes"
self.structuresFrame.collapsed = True
self.structuresFrame.setLayout(qt.QVBoxLayout())
self.masterFrame.layout().addWidget(self.structuresFrame)
self.structureListWidget = LabelStructureListWidget()
self.structureListWidget.mergeVolumePostfix = self.mergeVolumePostfix
self.structuresFrame.layout().addWidget(self.structureListWidget)
#
# signals, slots, and observers
#
# signals/slots on qt widgets are automatically when
# this class destructs, but observers of the scene must be explicitly
# removed in the destuctor
# node selected
self.masterSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect)
self.mergeSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onMergeSelect)
# so buttons will initially be disabled
self.master = None
self.structureListWidget.updateStructures()
开发者ID:BRAINSia,项目名称:Slicer,代码行数:97,代码来源:HelperBox.py
示例12: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
# Instantiate and connect widgets ...
### Parameters Area
inputCollapsibleButton = ctk.ctkCollapsibleButton()
inputCollapsibleButton.text = "Input"
self.layout.addWidget(inputCollapsibleButton)
# Layout within the dummy collapsible button
inputFormLayout = qt.QFormLayout(inputCollapsibleButton)
# fixed landmarks (mrml input)
self.fixedLandmarks = slicer.qMRMLNodeComboBox()
self.fixedLandmarks.nodeTypes = ["vtkMRMLMarkupsFiducialNode"]
self.fixedLandmarks.selectNodeUponCreation = True
self.fixedLandmarks.addEnabled = False
self.fixedLandmarks.removeEnabled = False
self.fixedLandmarks.noneEnabled = True
self.fixedLandmarks.showHidden = False
self.fixedLandmarks.renameEnabled = True
self.fixedLandmarks.setMRMLScene( slicer.mrmlScene )
self.fixedLandmarks.setToolTip( "Landmarks on fixed image." )
inputFormLayout.addRow("Fixed landmarks: ", self.fixedLandmarks)
# fixed landmarks (directory input)
self.fixedLandmarksDirectory = ctk.ctkDirectoryButton()
self.fixedLandmarksDirectory.directory = qt.QDir.homePath()
inputFormLayout.addRow("", self.fixedLandmarksDirectory)
# moving landmarks (mrml input)
self.movingLandmarks = slicer.qMRMLNodeComboBox()
self.movingLandmarks.nodeTypes = ["vtkMRMLMarkupsFiducialNode"]
self.movingLandmarks.selectNodeUponCreation = True
self.movingLandmarks.addEnabled = False
self.movingLandmarks.removeEnabled = False
self.movingLandmarks.noneEnabled = True
self.movingLandmarks.showHidden = False
self.movingLandmarks.showChildNodeTypes = False
self.movingLandmarks.setMRMLScene( slicer.mrmlScene )
self.movingLandmarks.setToolTip( "Landmarks on moving image." )
inputFormLayout.addRow("Moving landmarks: ", self.movingLandmarks)
self.view = qt.QTableView()
self.view.sortingEnabled = True
self.parent.layout().addWidget(self.view)
# moving landmarks (directory input)
self.movingLandmarksDirectory = ctk.ctkDirectoryButton()
self.movingLandmarksDirectory.directory = qt.QDir.homePath()
inputFormLayout.addRow("", self.movingLandmarksDirectory)
# Apply Button
self.applyButton = qt.QPushButton("Apply")
self.applyButton.toolTip = "Run the algorithm."
self.applyButton.enabled = True
self.layout.addWidget(self.applyButton)
### Output Area
outputCollapsibleButton = ctk.ctkCollapsibleButton()
outputCollapsibleButton.text = "Output statistics"
self.layout.addWidget(outputCollapsibleButton)
# Layout within the dummy collapsible button
outputFormLayout = qt.QFormLayout(outputCollapsibleButton)
# output statistics
buttonLayout = qt.QHBoxLayout()
self.averageError = qt.QLineEdit()
self.averageErrorValue = 1
self.averageError.setToolTip( "Average landmark separation" )
buttonLayout.addWidget(self.averageError)
outputFormLayout.addRow("Average error:", buttonLayout)
buttonLayout = qt.QHBoxLayout()
self.Variance = qt.QLineEdit()
self.VarianceValue = 1
self.Variance.setToolTip( "Variance" )
buttonLayout.addWidget(self.Variance)
outputFormLayout.addRow("Variance:", buttonLayout)
buttonLayout = qt.QHBoxLayout()
self.stDev = qt.QLineEdit()
self.stDevValue = 1
self.stDev.setToolTip( "Standard deviation" )
buttonLayout.addWidget(self.stDev)
outputFormLayout.addRow("Standard deviation:", buttonLayout)
# model and view for stats table
self.view = qt.QTableView()
self.view.sortingEnabled = True
self.parent.layout().addWidget(self.view)
# connections
self.fixedLandmarks.connect("currentNodeChanged(vtkMRMLNode*)", self.onFixedLandmarksSelect)
self.movingLandmarks.connect("currentNodeChanged(vtkMRMLNode*)", self.onMovingLandmarksSelect)
self.applyButton.connect('clicked(bool)', self.onMismatchErrorApply)
开发者ID:Sunderlandkyl,项目名称:SlicerRT,代码行数:99,代码来源:PlmMismatchError.py
示例13: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
# Instantiate and connect widgets ...
#
# INPUTS Area
#
inputsCollapsibleButton = ctk.ctkCollapsibleButton()
inputsCollapsibleButton.text = "Inputs"
self.layout.addWidget(inputsCollapsibleButton)
inputsFormLayout = qt.QVBoxLayout(inputsCollapsibleButton)
#
# 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 volume for geometry viewing." )
#
# Algorithm segmentation volume selector
#
self.algorithmSegmentation = slicer.qMRMLNodeComboBox()
self.algorithmSegmentation.nodeTypes = ["vtkMRMLLabelMapVolumeNode"]
self.algorithmSegmentation.selectNodeUponCreation = True
self.algorithmSegmentation.addEnabled = False
self.algorithmSegmentation.removeEnabled = False
self.algorithmSegmentation.noneEnabled = False
self.algorithmSegmentation.showHidden = False
self.algorithmSegmentation.showChildNodeTypes = False
self.algorithmSegmentation.setMRMLScene( slicer.mrmlScene )
self.algorithmSegmentation.setToolTip( "Pick the algorithm segmentation to evaluate." )
#
# Volumes group box
#
self.inputVolumesLayout = qt.QFormLayout()
self.inputVolumesLayout.addRow("Input volume: ", self.inputSelector)
self.inputVolumesLayout.addRow("Algorithm segmentation: ", self.algorithmSegmentation)
self.volumesGroupBox = qt.QGroupBox()
self.volumesGroupBox.setTitle("Volumes")
self.volumesGroupBox.setLayout(self.inputVolumesLayout)
inputsFormLayout.addWidget(self.volumesGroupBox)
#
# Configuration file selector
#
fileLayout = qt.QHBoxLayout()
self.configFile = qt.QLineEdit()
self.configFile.setReadOnly(True)
self.configFileButton = qt.QPushButton()
self.configFileButton.setText("Select File")
fileLayout.addWidget(self.configFile)
fileLayout.addWidget(self.configFileButton)
#
# Manual segmentations directory
#
directoryLayout = qt.QHBoxLayout()
self.directory = qt.QLineEdit()
self.directory.setReadOnly(True)
self.directoryButton = qt.QPushButton()
self.directoryButton.setText("Select Directory")
directoryLayout.addWidget(self.directory)
directoryLayout.addWidget(self.directoryButton)
#
# Paths group box
#
self.inputFilePathsLayout = qt.QFormLayout()
self.inputFilePathsLayout.addRow("PLUS configuration file: ", fileLayout)
self.inputFilePathsLayout.addRow("Manual segmentations directory: ", directoryLayout)
self.pathsGroupBox = qt.QGroupBox()
self.pathsGroupBox.setTitle("Paths")
self.pathsGroupBox.setLayout(self.inputFilePathsLayout)
inputsFormLayout.addWidget(self.pathsGroupBox)
#
# False negative distance value
#
self.falseNegativeDistance = qt.QSpinBox()
self.falseNegativeDistance.setMinimum(0)
self.falseNegativeDistance.setSuffix(" mm")
#
# Parameters group box
#
self.inputParametersLayout = qt.QFormLayout()
self.inputParametersLayout.addRow("False negative distance: ", self.falseNegativeDistance)
self.parametersGroupBox = qt.QGroupBox()
self.parametersGroupBox.setTitle("Parameters")
self.parametersGroupBox.setLayout(self.inputParametersLayout)
#.........这里部分代码省略.........
开发者ID:Mattel,项目名称:USBoneSegmentation,代码行数:101,代码来源:USGeometry.py
示例14: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
self.logic = VectorToScalarVolumeLogic()
# This will use createParameterNode with the provided default options
self.setParameterNode(self.logic.getParameterNode())
# Collapsible button
self.selectionCollapsibleButton = ctk.ctkCollapsibleButton()
self.selectionCollapsibleButton.text = "Selection"
self.layout.addWidget(self.selectionCollapsibleButton)
# Layout within the "Selection" collapsible button
parametersFormLayout = qt.QFormLayout(self.selectionCollapsibleButton)
#
# the volume selectors
#
self.inputSelector = slicer.qMRMLNodeComboBox()
self.inputSelector.nodeTypes = ["vtkMRMLVectorVolumeNode"]
self.inputSelector.addEnabled = False
self.inputSelector.removeEnabled = False
self.inputSelector.setMRMLScene(slicer.mrmlScene)
parametersFormLayout.addRow("Input Vector Volume: ", self.inputSelector)
self.outputSelector = slicer.qMRMLNodeComboBox()
self.outputSelector.nodeTypes = ["vtkMRMLScalarVolumeNode"]
self.outputSelector.hideChildNodeTypes = ["vtkMRMLVectorVolumeNode"]
self.outputSelector.setMRMLScene(slicer.mrmlScene)
self.outputSelector.addEnabled = True
self.outputSelector.renameEnabled = True
self.outputSelector.baseName = "Scalar Volume"
parametersFormLayout.addRow("Output Scalar Volume: ", self.outputSelector)
#
# Options to extract single components
#
self.conversionMethodWidget = VectorToScalarVolumeConversionMethodWidget()
parametersFormLayout.addRow("Conversion Method: ", self.conversionMethodWidget)
# Apply button
self.applyButton = qt.QPushButton("Apply")
self.applyButton.toolTip = "Run Convert the vector to scalar."
parametersFormLayout.addRow(self.applyButton)
# Parameter set selector (inspired by SegmentStatistics.py)
self.parameterNodeSelector = slicer.qMRMLNodeComboBox()
self.parameterNodeSelector.nodeTypes = (("vtkMRMLScriptedModuleNode"), "")
self.parameterNodeSelector.addAttribute("vtkMRMLScriptedModuleNode", "ModuleName", "VectorToScalarVolume")
self.parameterNodeSelector.selectNodeUponCreation = True
self.parameterNodeSelector.addEnabled = True
self.parameterNodeSelector.renameEnabled = True
self.parameterNodeSelector.removeEnabled = True
self.parameterNodeSelector.noneEnabled = False
self.parameterNodeSelector.showHidden = True
self.parameterNodeSelector.showChildNodeTypes = False
self.parameterNodeSelector.baseName = "VectorToScalarVolume"
self.parameterNodeSelector.setMRMLScene(slicer.mrmlScene)
self.parameterNodeSelector.toolTip = "Pick parameter set"
parametersFormLayout.addRow("Parameter set: ", self.parameterNodeSelector)
# Add vertical spacer
self.layout.addStretch(1)
# Connections
self.parameterNodeSelector.connect('currentNodeChanged(vtkMRMLNode*)', self.setParameterNode)
self.parameterNodeSelector.connect('currentNodeChanged(vtkMRMLNode*)', self.updateGuiFromMRML)
# updateParameterNodeFromGui
self.inputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.updateParameterNodeFromGui)
self.outputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.updateParameterNodeFromGui)
self.applyButton.connect('clicked(bool)', self.onApply)
# conversion widget
self.conversionMethodWidget.methodSelectorComboBox.connect('currentIndexChanged(int)',
lambda currentIndex:
self.conversionMethodWidget.setGuiBasedOnOptions(
self.conversionMethodWidget.methodSelectorComboBox.itemData(currentIndex),
self.inputVolumeNode())
)
self.conversionMethodWidget.methodSelectorComboBox.connect('currentIndexChanged(int)', self.updateParameterNodeFromGui)
self.conversionMethodWidget.componentsComboBox.connect('currentIndexChanged(int)', self.updateParameterNodeFromGui)
# The parameter node had defaults at creation, propagate them to the GUI.
self.updateGuiFromMRML()
开发者ID:andrewfzheng,项目名称:Slicer,代码行数:85,代码来源:VectorToScalarVolume.py
示例15: setup
def setup(self):
ScriptedLoadableModuleWidget.setup(self)
# Instantiate and connect widgets ...
### Input Area
inputCollapsibleButton = ctk.ctkCollapsibleButton()
inputCollapsibleButton.text = "Input"
self.layout.addWidget(inputCollapsibleButton)
# Layout within the dummy collapsible button
inputFormLayout = qt.QFormLayout(inputCollapsibleButton)
# vf image (mrml input)
self.vfMRMLSelector = slicer.qMRMLNodeComboBox()
self.vfMRMLSelector.nodeTypes = ["vtkMRMLVectorVolumeNode"]
self.vfMRMLSelector.selectNodeUponCreation = True
self.vfMRMLSelector.addEnabled = False
self.vfMRMLSelector.removeEnabled = False
self.vfMRMLSelector.noneEnabled = True
self.vfMRMLSelector.showHidden = False
self.vfMRMLSelector.setMRMLScene(slicer.mrmlScene)
self.vfMRMLSelector.setToolTip("Pick the input to the algorithm.")
inputFormLayout.addRow("Vector Field image: ", self.vfMRMLSelector)
# variables
self.minJacobianValue = 1
self.maxJacobianValue = 1
# vf image (directory input)
self.vfInputDirectory = ctk.ctkDirectoryButton()
self.vfInputDirectory.directory = qt.QDir.homePath()
inputFormLayout.addRow("Input Directory:", self.vfInputDirectory)
# Fixed image (for geometry info)
self.fixedImage = slicer.qMRMLNodeComboBox()
self.fixedImage.nodeTypes = ["vtkMRMLScalarVolumeNode"]
self.fixedImage.setMRMLScene(slicer.mrmlScene)
self.fixedImage.selectNodeUponCreation = True
self.fixedImage.addEnabled = False
self.fixedImage.renameEnabled = True
self.fixedImage.noneEnabled = True
self.fixedImage.setToolTip("Output image of Jacobian matrix.vtkSlicerPlastimatchModuleLogicPython")
inputFormLayout.addRow("Fixed image (for geometry info): ", self.fixedImage)
# Apply Button
self.applyButton = qt.QPushButton("Apply")
self.applyButton.toolTip = "Run the algorithm."
self.applyButton.enabled = True
self.layout.addWidget(self.applyButton)
### Output Area
outputCollapsibleButton = ctk.ctkCollapsibleButton()
outputCollapsibleButton.text = "Output"
self.layout.addWidget(outputCollapsibleButton)
# Layout within the dummy collapsible button
outputFormLayout = qt.QFormLayout(outputCollapsibleButton)
# Jacobian image (mrml output)
self.outputJacobian = slicer.qMRMLNodeComboBox()
self.outputJacobian.nodeTypes = ["vtkMRMLScalarVolumeNode"]
self.outputJacobian.setMRMLScene(slicer.mrmlScene)
self.outputJacobian.addEnabled = True
self.outputJacobian.renameEnabled = True
# self.outputJacobian.layout().addWidget(self.outputSelector)
self.outputJacobian.setToolTip("Output image of Jacobian matrix.vtkSlicerPlastimatchModuleLogicPython")
outputFormLayout.addRow("Jacobian image: ", self.outputJacobian)
# output directory selector
# self.outputDirectory = ctk.ctkDirectoryButton()
# self.outputDirectory.directory = qt.QDir.homePath()
# outputFormLayout.addRow("Output Directory: ", self.outputDirectory)
# output statistics
buttonLayout = q
|
请发表评论