Documentation/4.5/FAQ/Segmentation

From Slicer Wiki
Revision as of 00:50, 13 November 2015 by JChris.FillionR (talk | contribs) (Created page with '<noinclude>{{documentation/versioncheck}}</noinclude> <noinclude>__TOC__ ={{#titleparts: {{PAGENAME}} | | -1 }}=</noinclude><includeonly> {{#ifeq: {{#titleparts: {{PAGENAME}} | 3…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home < Documentation < 4.5 < FAQ < Segmentation


For the latest Slicer documentation, visit the read-the-docs.


Segmentation

How to 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.
  • Create a new node for the target representation and pass 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')
   labelVolume.SetAndObserveImageData(scalarVolume.GetImageData())
   slicer.mrmlScene.RemoveNode(scalarVolume)