From Slicer Wiki
Revision as of 19:36, 15 July 2015 by Pinter (talk | contribs) (Added class diagram and latest source code links)
Jump to: navigation, search
Home < Documentation < Labs < Segmentations




  • TODO

Design and implementation

  • TODO
Segmentations module, Visualizing model in 2D and 3D, also showing merged labelmap in 2D
Class diagram


Segmentation modules is part of the SlicerRT extension during development and will be moved to Slicer core when the developments are complete:

Slicer core changes

Future features

  • TODO


  • TODO

Topics to discuss

  • TODO


  • TODO

vtkMRMLLabelMapVolumeNode integration

Slicer core updated, see this commit:

Module update instructions

Module selectors that expect a labelmap volume should be changed


   self.outputSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
   self.outputSelector.addAttribute( "vtkMRMLScalarVolumeNode", "LabelMap", 1)


   self.outputSelector.nodeTypes = ["vtkMRMLLabelMapVolumeNode"]


   self.outputSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
   self.outputSelector.addAttribute( "vtkMRMLScalarVolumeNode", "LabelMap", 0)


   self.outputSelector.nodeTypes = ["vtkMRMLScalarVolumeNode"]
  • Note: This changes the value assigned to nodeTypes from a Tuple with 2 elements to a List with only one element. Additional information on the Tuple syntax can be found here:

CLI modules

CLI modules are not impacted. No change is needed in interface definition XML files or in the module implementation.

Switch between scalar/labelmap volume

Previously it was possible to switch between scalar/labelmap type by changing an attribute value. Now scalar/labelmap volumes are stored in different classes, therefore a new node has to be created for the converted volume. Conversion options:

  • Use the Cast Scalar Volume module to convert between scalar/labelmap volumes.
  • Conversion can be performed by creating a new node for the target representation and passing the image data of the source node to the target node. For example, conversion to labelmap volume:
   scalarVolume = slicer.util.getNode('MRHead')
   labelVolume = slicer.modules.volumes.logic().CreateAndAddLabelVolume(scalarVolume,scalarVolume.GetName()+'-label')