I have a labelmap volume node with only 1 label and I am using a custom LUT for it. When I convert the labelmap volume node to a segmentation node, the segment inside does not respect the colour table name for that label, but rather, it names it after the node name.
If the labelmap volume node has 2 labels or more, and a custom LUT is loaded, converting to a segmentation node will create segments that respect the colour table name for those labels.
I think this behaviour should be changed! What do you guys think?
Thanks for reporting! I’ll take a look at it.
I am facing similar issue when I try to ExportSegmentsToLabelmapNode or ImportLabelmapToSegmentationNode with only one segment programmatically. The labelmap node ignores the provided color table and when doing “ImportLabelmapToSegmentationNode” makes a default segmentID with name labelmapvolume (this is after I ImportLabelmapToSegmentationNode). The workaround I do for this issue so far is to
- Make new segment
- Deepcopy new segment by newSegment->DeepCopy()
- Remove old segment, name new segment as per the required segment ID and add to segmentation node
This workaround is working so far but would like to know if there is any fix for this issue. Thanks
I’ve just checked and this works well in latest Slicer Preview Release. If the latest preview release does not work as you expect then please describe the exact steps you perform. What do you mean by “the labelmap node ignores the provided color table”? What did you do, what did you expect to happen, and what happened instead?
Hi @lassoan, the issue is exactly as shown in screenshot by the thread creator. It is like the segment ID does not matches the color table color name when there is only one segment even when I try to set the colortable node to the display node from SetAndObserveColorNodeID. I tried manually setting the name of segment but it only changes the name tag but does not change segment ID. I hope this makes it more clear. I will try with latest preview release and let you know.
@lassoan @kpopuri Thank you, tested it and the issue is fixed.