Export modified DICOM image set

187 views
Skip to first unread message

Dominic Rafferty

unread,
Jul 22, 2020, 1:25:30 PM7/22/20
to CERR FORUM
Hello,

I am new to CERR and am interested to know if it may be useful in helping to solve a problem I have. I would like to be able to define a structure in a CT image set, and override the density of the structure to a given value. I would then like to be able to export the CT data as a DICOM image set, but with the voxel intensities in the images modified to reflect the assigned densities. This is with the intention that I can then feed these modified DICOM images into DOSXYZNRC via CTCREATE. I am curious if anyone has used CERR for this purpose and is aware of how I would go about doing this?

Many thanks


iy...@mskcc.org

unread,
Jul 22, 2020, 5:13:17 PM7/22/20
to cerr-...@googlegroups.com

Hi Dominic,

 

Here’s a sample script to replace the values within the ROI:

 

global planC;

strNum = 1;    %Replace with structure # of interest

%Get associated scan array

scanNum = getStructureAssociatedScan(strNum,planC);

scan3M = getScanArray(scanNum,planC);

%Get structure mask

mask3M = getStrMask(strNum,planC);

%Replace values within mask with assigned densities

scan3M(mask3M) = density3M(mask3M);

 

where density3M is a matrix of the same size as the original scan array, populated with the values you want to assign within the structure mask.

 

Hope this helps.

 

Aditi

--
You received this message because you are subscribed to the Google Groups "CERR FORUM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cerr-forum+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerr-forum/47d99df2-9914-43ab-a2cb-1a99df0c4e4ao%40googlegroups.com.

=====================================================================

Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.

Message has been deleted

Dominic Rafferty

unread,
Sep 28, 2020, 6:32:16 AM9/28/20
to CERR FORUM
Hello Aditi,

Thank you very much for your help. I have managed to get this working now. I am wondering how I can now save these changes and export in DICOM format? I have found the following module in CERR which seems to be relevant, but I am unsure how to use it:

Dominic Rafferty

unread,
Sep 28, 2020, 7:36:56 AM9/28/20
to CERR FORUM
I am attempting to use this function as follows:

export_planC_to_DICOM(planC, '/home/dominic/CERR/')

However I receive the following error message:

Unable to resolve the name org.dcm4che3.data.Attributes.
Error in export_module (line 57)
attr = org.dcm4che3.data.Attributes;
Error in export_CT_IOD (line 63)
    patientattr      = export_module('patient', 'scan', scanS);
Error in export_planC_to_DICOM (line 60)
nNew     = export_CT_IOD(planC, filenameRoot, nWritten);
Error in override_density (line 80)
export_planC_to_DICOM(planC, savepath)

ap...@mskcc.org

unread,
Sep 28, 2020, 7:42:41 AM9/28/20
to cerr-...@googlegroups.com
Can you try running init_ML_DICOM before calling this function. 
To view this discussion on the web visit https://groups.google.com/d/msgid/cerr-forum/4cf01d1c-de9e-49bb-82d8-78d910ff77adn%40googlegroups.com.



*** Only open attachments or links from trusted senders. Report phishing to inf...@mskcc.org ***

mg_info.txt

Dominic Rafferty

unread,
Sep 28, 2020, 8:03:24 AM9/28/20
to CERR FORUM
Excellent! Thank you that works

Dominic Rafferty

unread,
Sep 28, 2020, 12:43:22 PM9/28/20
to CERR FORUM
Hello,

One other question- the line:

scan3M = getScanArray(scanNum,planC);

Seems to give me an array of unsigned integers (data type uint16). As my dicom HU scale goes down to -1000 in the TPS, from which I am exporting the images before importing to CERR, I'm wondering how this is handled by this function? Is it just adding on 1000 to every pixel value? This would seem about right as my max HU in the TPS is around 2940, and when i run the command max(max(max(scan3M))) i get 3940. So to restore to the values in the original DICOM, do I just need to subtract 1000 from every pixel?

Thanks

iy...@mskcc.org

unread,
Sep 28, 2020, 1:17:52 PM9/28/20
to cerr-...@googlegroups.com

Hi Dominic,

 

Thanks for pointing this out. The CT offset should be subtracted before assigning new density values using:

 

indexS = planC{end};

CToffset = planC{indexS.scan}(scanNum).scanInfo(1).CTOffset;

scan3M = double(scan3M) – CToffset;

 

Best,

Reply all
Reply to author
Forward
0 new messages