Skip to content

Commit 8fec8bd

Browse files
committed
ENH: improved control over IO volume types
It is now possible to add custom volume types to node selectors: `slicer.modules.SimpleFiltersInstance.scalarVolumeNodeClasses=['...']`
1 parent 92e8db0 commit 8fec8bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SimpleFilters/SimpleFilters.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class SimpleFilters:
3232
import inspect
3333
__file__ = inspect.getframeinfo(inspect.currentframe())[0]
3434

35+
scalarVolumeNodeClasses = ["vtkMRMLScalarVolumeNode", "vtkMRMLLabelMapVolumeNode"]
3536
ICON_DIR = os.path.dirname(os.path.realpath(__file__)) + '/Resources/Icons/'
3637
JSON_DIR = os.path.dirname(os.path.realpath(__file__)) + '/Resources/json/'
3738

@@ -842,7 +843,7 @@ def create(self, json):
842843

843844
self.outputSelector = slicer.qMRMLNodeComboBox()
844845
self.widgets.append(self.outputSelector)
845-
self.outputSelector.nodeTypes = ["vtkMRMLScalarVolumeNode", "vtkMRMLLabelMapVolumeNode"]
846+
self.outputSelector.nodeTypes = SimpleFilters.scalarVolumeNodeClasses
846847
self.outputSelector.selectNodeUponCreation = True
847848
self.outputSelector.addEnabled = True
848849
self.outputSelector.removeEnabled = False
@@ -884,7 +885,7 @@ def create(self, json):
884885
def createInputWidget(self,n, noneEnabled=False):
885886
inputSelector = slicer.qMRMLNodeComboBox()
886887
self.widgets.append(inputSelector)
887-
inputSelector.nodeTypes = ["vtkMRMLScalarVolumeNode", "vtkMRMLLabelMapVolumeNode"]
888+
inputSelector.nodeTypes = SimpleFilters.scalarVolumeNodeClasses
888889
inputSelector.selectNodeUponCreation = True
889890
inputSelector.addEnabled = False
890891
inputSelector.removeEnabled = False

0 commit comments

Comments
 (0)