Convert labelmap file in nrrd to RT Struct in dicom format

Skip to first unread message

Apr 22, 2022, 8:28:28 PM4/22/22
to Plastimatch
Hi Greg,

We are trying to evaluate an automated segmentation algorithm in a clinical setting. The segmentation results are saved as labelmaps in nrrd format, so is it possible to use  plastimatch to convert a labelmap to a RT Struct file in dicom format?  A structure set list file and a referenced dicom CT volume will provided. Thanks.


Tim Birtwhistle

Apr 25, 2022, 5:39:07 AM4/25/22
to Plastimatch
Hi J,

I use Plastimatch for something similar, the files I have are in mha format but it sounds like it would work for your data so would be worth a try.  I do it in 2 steps:

# add structures together into one nii file with different weights for each structure
plastimatch add --output niftySS.nii  --weight "1 2 4 8 16" bladder.mha rectum.mha  r_fem_head.mha l_fem_head.mha bowel.mha ;

# convert .nii file to DICOM
plastimatch convert --input-ss-img nifty_SS.nii --referenced-ct . --input-ss-list list.txt --output-dicom DicomSS ; 

list.txt has the values and colour codes for the structures:

0|255 0 255|bladder
1|255 127 0|rectum
2|135 206 235|r_fem_head
3|128 128 192|l_fem_head
4|239 193 7|bowel


Apr 25, 2022, 12:48:18 PM4/25/22
to Plastimatch
Hi Tim,

This is exactly what I want and it works perfectly. Thank you so much for your help and sharing you experience!


Tim Birtwhistle

Apr 26, 2022, 8:25:19 AM4/26/22
to Plastimatch
Thanks James, I'm glad it worked for you.
Reply all
Reply to author
0 new messages