Converting Nifti ROI to Dicom RTSTRUCT

1,256 views
Skip to first unread message

Sudhir Pathak

unread,
Nov 17, 2015, 10:27:13 AM11/17/15
to Plastimatch
Dear All,

I wanted to convert a nifti ROI file (.nii) to dicom RTSTRUCT. I tried to install plastimatch on three different machine (two with ubuntu 14.04 and one with 15.04 )  by compiling plastimatch with ITK4.5 and 3.20.2 and by installing plastimatch from UBUNTU repo. 
I am trying to use this command listed on documentation page:
plastimatch segment \
  --input water_dicom \
  --output-dicom water_dicom \
  --lower-threshold -500


But I don't see any commandline options corresponds to "--output-dicom water_dicom" in compiled or ubuntu repo version. I might be missing something.
Is there any other way to do this?


Thanks a lot,


Sudhir

Paolo Zaffino

unread,
Nov 17, 2015, 10:40:13 AM11/17/15
to plast...@googlegroups.com
Hi Sudhir,
I didn't understand what you want to do.
Do you need to convert a ROI stored in a nifti file into a dicomRT?

Best.
Paolo
--
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 plastimatch...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sudhir Pathak

unread,
Nov 17, 2015, 10:46:52 AM11/17/15
to Plastimatch
Thanks for reply. 
Yes. I have an anatomical ROI from T1 image (as nifti with 0 and 1 label) and wanted to convert to dicomrt RTSTRUCT.

Thanks,

Sudhir 

Paolo Zaffino

unread,
Nov 17, 2015, 11:10:05 AM11/17/15
to plast...@googlegroups.com
Hi Sudhir,
first of all you need to convert you T1 image (I guess it is a nifti file) into dicoms.
To do this, assuming that your T1 file is named "T1.nii.gz", run:
plastimatch convert --input T1.nii.gz --output-dicom T1_dicom

After that, assuming that your ROI files are stored into a folder named "ROIs" you can run:
plastimatch convert --input-prefix ROIs --interpolation nn --referenced-ct T1_dicom --output-dicom ROIs_dicom

and into the folder "ROIs_dicom" (created by plastimatch) you will find the dicomRT.

Let me know if it works.
Best.

Paolo

Sudhir Pathak

unread,
Nov 17, 2015, 2:26:25 PM11/17/15
to Plastimatch
Hello Paolo,

I ran the command, but got an error in the last one: (ROIs contains one file thalamus_label49.nii, T1_dicom have 256 dicom files from first command)

Please let me know your thoughts. I really appreciate your time and help.

Thanks,
Sudhir

plastimatch convert --input-prefix ROIs --interpolation nn --referenced-ct T1_dicom --output-dicom ROIs_dicom
Loading RDD
Best chunck:
  Slices 0 to 255 from (0 to 255)
  Z_loc = 111.789825 111.789825
  Slice spacing = 0.000000
Samp_per_pix: 1
Phot_interp: MONOCHROME2
Bits_alloc: 16
Bits_stored: 16
High_bit: 15
Pixel_rep: 1
S/I = 1.000000/-1024.000000
Image looks ok.  Try to load.
Loading RDD complete
Setting PIH from RDD
PIH is:
Origin = -125.147 111.79 111.79
Size = 256 256 256
Spacing = 1 1 0
Direction = 1 0 0 0 -0 -1 0 1 -0
Rt_study_warp: Convert ss_img to cxt.
Rt_study_warp: Apply dicom_dir.
Rt_study_warp: Set geometry from PIH.
Rt_study_warp: Set rasterization geometry.
Segmentation fault

Sudhir

Sharp, Gregory C.

unread,
Nov 17, 2015, 7:55:27 PM11/17/15
to Plastimatch

Hi Sudhir,

 

Looks like you made plastimatch crash.  That is not nice.

 

Are the data something you could share for testing?

 

Also, please let us know which plastimatch version.

 

Greg

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 Partners Compliance HelpLine at
http://www.partners.org/complianceline . 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.

Sudhir Pathak

unread,
Nov 17, 2015, 9:50:08 PM11/17/15
to Plastimatch, GCS...@partners.org
Hello Grey, 

Attached are three files: T1.nii (MPRAGE which I used to convert first into dicom format), thalamus_label49.nii (Masked ROI created from aseg.nii file, Label: 49). 
I am using 1.5.15 version:  
plastimatch convert --version 
Plastimatch version 1.5.15 (4523) 


Thanks a lot,

Sudhir

Sudhir Pathak

unread,
Nov 17, 2015, 10:47:36 PM11/17/15
to Plastimatch, GCS...@partners.org
Hello Greg, 

Attached are three files: T1.nii (MPRAGE which I used to convert first into dicom format), thalamus_label49.nii (Masked ROI created from aseg.nii file, Label: 49). 
I am using 1.5.15 version:  
plastimatch convert --version 
Plastimatch version 1.5.15 (4523) 


Thanks a lot,

Sudhir

On Tuesday, November 17, 2015 at 7:55:27 PM UTC-5, Sharp, Gregory C. wrote:

Sharp, Gregory C.

unread,
Nov 18, 2015, 11:25:01 AM11/18/15
to Sudhir Pathak, Plastimatch
Hi Sudhir,

Looks like the input-prefix option does not handle nifti.
I will investigate if this can be fixed.

Meanwhile, if you only have this one structure, you can do this:

plastimatch convert --referenced-ct T1_dicom --input-ss-img thalamus_label49.nii --output-dicom T1_dicom

Or, if you have multiple structures, convert them all to nrrd (or mha), like this:

plastimatch convert --input A.nii --output-img ROIs/A.nrrd
plastimatch convert --input B.nii --output-img ROIs/B.nrrd

and then proceed to use input-prefix.

Note also that your plastimatch version is pretty old.
I only tested on the current version (svn head).

Greg
Reply all
Reply to author
Forward
0 new messages