dicom to nifti from command line rather than GUI??

728 views
Skip to first unread message

Alina _

unread,
Jul 25, 2017, 3:37:56 PM7/25/17
to itksna...@googlegroups.com
Hi there,

ITK Snap does a nice job converting dicom to nifti in the GUI, is there a way to do the same from command line??

Thanks,
Alina

Paul Yushkevich

unread,
Jul 25, 2017, 5:56:38 PM7/25/17
to itksna...@googlegroups.com
Thanks!!!

Yes, please see the convert3d documentation for commands that start with -dicom

Best
Paul

--
You received this message because you are subscribed to the Google Groups "itksnap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to itksnap-users+unsubscribe@googlegroups.com.
To post to this group, send email to itksna...@googlegroups.com.
Visit this group at https://groups.google.com/group/itksnap-users.
For more options, visit https://groups.google.com/d/optout.

Alina _

unread,
Jul 27, 2017, 5:17:19 AM7/27/17
to itksna...@googlegroups.com
Thank you Paul, that's great, I installed the latest c3d and I found the dicom conversion routines.

I am still not sure how to split a multiecho (multicomponent) series and I have troubles reading compressed Philips dicoms. My workflow is below. Any sggestions?

Example 1
c3d -dicom-series-list test1/ # <<- contains multiecho series, (8 echos + 1 map) * 12 slices, saved as classic Philips dicoms
SeriesNumber    Dimensions    NumImages    SeriesDescription    SeriesID
401     240x240x108    108    qT2     1.3.46.670589.11.17379.5.0.8760.2017063018473753733.4015240240

# the following works but exports all components in one nifti image, the -mcs flag makes no difference
c3d -dicom-series-read test1/ 1.3.46.670589.11.17379.5.0.8760.2017063018473753733.4015240240 -o test1.nii.gz

Example 2
c3d -dicom-series-list test2/ # <<- contains 1 compressed Philips dicom, all slices, echos, maps pertaining to one series in one dicom
SeriesNumber    Dimensions    NumImages    SeriesDescription    SeriesID
401     240x240x1    1    qT2     1.3.46.670589.11.17379.5.0.8760.2017063018473753733.401240240

c3d -dicom-series-read test2/ 1.3.46.670589.11.17379.5.0.8760.2017063018473753733.4015240240 -o test2.nii.gz
WARNING: In /Users/picsl/tk/bb3/Nightly/itk/v4.5.2/itk/Modules/IO/GDCM/src/itkGDCMSeriesFileNames.cxx, line 138
GDCMSeriesFileNames (0x7fb5f3213530): No Series were found

Exception caught of type 16ConvertException
  When processing command: -dicom-series-read
  Exception detail: Error: DICOM series not found. Directory 'test2/' does not appear to contain a series of DICOM images.


Thanks,
Alina

Stéphane Couvreur

unread,
Oct 31, 2017, 6:58:56 AM10/31/17
to itksnap-users
Hi Alina,

You could also perhaps use the dcm2niix command line tool from MRIcron (https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage) ? It is very useful especially for datasets from Philips I have found.

Kind regards,

--
Stephane Couvreur | Research Student
UCL Institute of Cardiovascular Science
To unsubscribe from this group and stop receiving emails from it, send an email to itksnap-user...@googlegroups.com.

To post to this group, send email to itksna...@googlegroups.com.
Visit this group at https://groups.google.com/group/itksnap-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "itksnap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to itksnap-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages