I have a lot of RTstructs that I need to convert to binary label maps. I tried using the scripts for exporting to label map in the repository here (Documentation/4.8/ScriptRepository - Slicer Wiki)
here is the code:
seg = getNode(‘Segmentation’)
labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass(‘vtkMRMLLabelMapVolumeNode’)
slicer.modules.segmentations.logic().ExportAllSegmentsToLabelmapNode(seg, labelmapVolumeNode)
Oh great, thanks. I think I figured out how to do what I was thinking but I can use this.
I just tried to use it in my command line (windows 10), it doesn’t seem to do anything. How are the files supposed to be? Currently they are all dicoms in their own folders (each RTstruct is in its own folder, same with the reference CT). I tried moving them all to the same folder and it didn’t work Here is how I called it:
Hi, have you tried using the following code to convert segmentation map to a labelmap using your reference volume to determine the dimensions of the labelmap?:
seg = getNode(‘Segmentation’)
reference = getNode (‘InputVolume’) # this will be the volume the segmentation was drawn on
labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass(‘vtkMRMLLabelMapVolumeNode’)