conversion of dicom RT to nifti

956 views
Skip to first unread message

David Gutman

unread,
Oct 21, 2011, 11:44:27 AM10/21/11
to plast...@googlegroups.com

So I am trying to convert DICOM-RT's to nifti files using the below command--- I could have sworn I got this to work a couple of weeks ago last time I was working on this...


Anyway..

./plastimatch convert --input AXIAL_T2_FLAIR/ARGO_FLAIR_MASK.dcm --output-ss-img my_test.nii.gz --output-ss-list argo_test.txt --dicom-dir AXIAL_T2_FLAIR/1.3.6.1.4.1.14519.5.2.1.1706.4001.166909646801864710106680106577/

Plastimatch did not seem to like/recognize the dicom-dir option.... (it just returns the help file)

the only documented flag I saw that seemed close was:

 --referenced-ct <arg>     dicom directory used to set UIDs and metadata

but when I used that one .. it just set the metadata... didn't actually make the image in the same dimensions as the input DCM file...

Of note... if I run the command WITHOUT the --dicom-dir flag... it seems to mostly run.. although I am wondering if the itk exception is causing a problem?  Again these input files are DICOM_RT files...


bash ./run_plastimatch_command.sh
ITK exception.

itk::ExceptionObject (0x298dad0)
Location: "void itk::GDCMImageIO::InternalReadImageInformation(std::ifstream&)"
File: /IMAGING_SCRATCH/TCGA_DICOM_CACHE/SCRIPTS/plastimatch/itk_3.18/InsightToolkit-3.18.0/Code/IO/itkGDCMImageIO.cxx
Line: 803
Description: itk::ERROR: GDCMImageIO(0x298bdb0): Could not read header from file: /IMAGING_SCRATCH/TCGA_DICOM_CACHE/TCGA_DATA/MASK_EXPORT/TCGA-02-0003/AXIAL_T2_FLAIR/ARGO_FLAIR_MASK.dcm
Reason: Success


RRN = [1 ], RDC = [119\0\255 ]
Loading complete.
Loading RDD
Patient ID = Not Supplied^
Found RTSTRUCT!
PIH is:
Origin = 24.5898 -11.132 30.4
Size = 512 512 4
Spacing = 0.0656891 0.0656891 6.5
Direction = 1 0 0 0 1 0 0 0 1
Rtds_warp: Convert ss_img to cxt.
Rtds_warp: Apply dicom_dir.
Rtds_warp: Set geometry from PIH.
Rtds_warp: Set rasterization geometry.
rast_dim = 512 512 4
rast_offset = 24.5898 -11.132 30.4
rast_spacing = 0.0656891 0.0656891 6.5
Rtds_warp: warp and save ss.
Warp_and_save_ss: m_ss_image->rasterize
Rasterizing...
Converting...
Finished rasterization.
Warp_and_save_ss: save_ss_img
save_ss_img: save_ss_image
Trying to write image to /IMAGING_SCRATCH/TCGA_DICOM_CACHE/plastimatch_run_scripts/argo_test.nrrd
save_ss_img: save_ss_list
Done.
Finished!



--
David A Gutman, M.D. Ph.D.
Assistant Professor of Biomedical Informatics
Senior Research Scientist, Center for Comprehensive Informatics
Emory University School of Medicine

Greg Sharp

unread,
Oct 23, 2011, 10:42:01 AM10/23/11
to plast...@googlegroups.com

Hi David,

Yes, --dicom-dir is no more. As you already noticed,
the --referenced-ct option is for setting the DICOM UIDs.
You only need it if you are converting into DICOM-RT.

Setting the resolution of rasterized DICOM-RT structure sets
is rather tricky. The contours have a natural resolution in
the z direction, but not in the (x,y) plane.

If the referenced CT is in the same directory as the structure
set it should be automatically detected, and the rasterization
geometry should match. If not, you can specify rasterization
geometry using the --fixed option. For example:

./plastimatch convert --input AXIAL_T2_FLAIR/ARGO_FLAIR_MASK.dcm
--output-ss-img my_test.nii.gz --output-ss-list argo_test.txt

--fixed
AXIAL_T2_FLAIR/1.3.6.1.4.1.14519.5.2.1.1706.4001.166909646801864710106680106577/

Regarding the ITK exception, you can safely ignore it.
ITK likes to throw exceptions.

Greg

David Gutman

unread,
Oct 23, 2011, 10:50:55 AM10/23/11
to plast...@googlegroups.com
aaah ok great----  I saw the --fixed option but didn't realize you could pass it a directory... I thought you had to pass it "numbers"...

Thanks

dg
Reply all
Reply to author
Forward
0 new messages