View Revisions: Issue #4391

Summary 0004391: Problems loading and rendering segmentations
Revision 2017-07-03 17:59 by fepegar
Steps To Reproduce

Load the attached file as a Labelmap with Freesurfer labels, export to segmentation, save it, close scene and load the segmentation. Some segments don't have opacity 1 anymore, and they have rendering artifacts.

Or load the file into Slicer and paste this code:

import os
import vtkSegmentationCorePython

labelmapVolumeNode = getNode('freesurfer-label')
segmentationNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSegmentationNode')
segmentationNode.CreateDefaultDisplayNodes()
segmentation = segmentationNode.GetSegmentation()
segmentation.SetMasterRepresentationName(vtkSegmentationCorePython.vtkSegmentationConverter.GetSegmentationClosedSurfaceRepresentationName())
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(labelmapVolumeNode, segmentationNode)
path = os.path.join(tempDirectory(), 'segmentation.seg.vtm')
saveNode(segmentationNode, path)
displayNode = segmentationNode.GetDisplayNode()
# print displayNode

slicer.mrmlScene.Clear(0)
segmentationNode = loadSegmentation(path, returnNode=True)[1]
displayNode = segmentationNode.GetDisplayNode()
# print displayNode
Revision 2017-07-03 03:43 by fepegar
Steps To Reproduce

Load the attached file as a Labelmap with Freesurfer labels, export to segmentation, save it, close scene and load the segmentation. Some segments don't have opacity 1 anymore, and they have rendering artifacts.

Or load the file into Slicer and paste this code:
import os
import vtkSegmentationCorePython

labelmapVolumeNode = getNode('freesurfer-label')
segmentationNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSegmentationNode')
segmentationNode.CreateDefaultDisplayNodes()
segmentation = segmentationNode.GetSegmentation()
segmentation.SetMasterRepresentationName(vtkSegmentationCorePython.vtkSegmentationConverter.GetSegmentationClosedSurfaceRepresentationName())
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(labelmapVolumeNode, segmentationNode)
path = os.path.join(tempDirectory(), 'segmentation.seg.vtm')
saveNode(segmentationNode, path)
displayNode = segmentationNode.GetDisplayNode()

print displayNode

slicer.mrmlScene.Clear(0)
segmentationNode = loadSegmentation(path, returnNode=True)[1]
displayNode = segmentationNode.GetDisplayNode()

print displayNode