segmentation masks to RT struct

Skip to first unread message

Michael Lempart

Dec 10, 2020, 7:06:32 PM12/10/20
to Plastimatch
Hi all,

Iam trying to convert segmentation masks to RT struct DICOM files, where pixel (or voxel) values ca be 0 (background), 1 (segmentation 1), 2 (segmentation 2) or 3(segmentation 3).

It works just fine with a single structure, but if I try to convert all three masks to a common RT struct file, one structure (3) is missing, though it seems like plastimatch combines mask 2 and 3.

Does anyone have had this kind of issue?

Thanks in advance,




Dec 11, 2020, 2:58:35 AM12/11/20
Hi Mike, 

I found something similar to this. I think the DICOM converter is expecting the mask values to be powers of two so it thinks segmentation 3 is a combination of 1 and 2. This is useful when the structures might overlap. One way around this would be to change the pixel values of the mask if you can. If segmentation 3 had the value 4 it should work.

You might need to alter your list file too if the structure labels don't agree with what you expect but that might not be necessary. 


You received this message because you are subscribed to the Google Groups "Plastimatch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Michael Lempart

Dec 11, 2020, 2:46:14 PM12/11/20
Hi Tim and thanks for your reply!

I will give it a try and I think you might be right. I observed that one structure in the RT struct dcm seems to be a combination of two of the masks. 



Sharp, Gregory C.

Dec 11, 2020, 2:55:33 PM12/11/20

Hi Michael,


The --output-ss-img option does indeed use a separate bit for each structure as Tim says.  This allows overlapping structures.


To do what you want, you should use --output-labelmap.  This does not support overlapping structures, and gives you the contours as 1, 2, 3, etc.




From: 'Michael Lempart' via Plastimatch <>
Sent: Friday, December 11, 2020 2:46 PM
Subject: Re: [Plastimatch] segmentation masks to RT struct


        External Email - Use Caution        

The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Reply all
Reply to author
0 new messages