Difference between revisions of "Documentation/4.5/FAQ/Segmentation"
From Slicer Wiki
(Created page with '<noinclude>{{documentation/versioncheck}}</noinclude> <noinclude>__TOC__ ={{#titleparts: {{PAGENAME}} | | -1 }}=</noinclude><includeonly> {{#ifeq: {{#titleparts: {{PAGENAME}} | 3…') |
(No difference)
|
Latest revision as of 00:50, 13 November 2015
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)