Hi, having this issue trying to convert labelmap volume to a segmentation node.
My labelmap volume here has only 0s and 1s, so theoretically, only one segment will be created running this function.
If I run the following code without specifying segmentIDs, everything works fine:
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(volumeNode, segmentationNode)
The function returns true and expected segment is created with the default name (“jake”)
I want to give the segment a specific ID, so I can call it afterwards by running:
id = 'Fem_P'
ids = vtk.vtkStringArray()
ids.InsertNextValue(id)
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(volumeNode, segmentationNode, ids)
The function returns True and does NOT create segments.
Anyone knows why? Did I do something wrong when creating the vtkStringArray
?
Thanks ahead