Tuesday, 1 March 2011

Multiple DICOM to NIfTI converter using dcm2nii and AppleScript

dcm2nii is used to convert from DICOM format to various data format such as; 
Compressed 4D NIfTI nii.gz, 4D NIfTI nii, 3D NIfTI hdr/img and 3D Anlyze hdr/img. Or even it modify NIfTI format. There are two versions; the dcm2niigui and command line dcm2nii. This software was written by Dr. Chris Rorden. It can be downloaded with mricron package;
where mac version link is;
For more information about dcm2nii please visit 
MAC gui version is user friendly but it can convert one data set at a time. Therefore, I wrote an applescript to convert multiple DICOM data sets to NIfTI/Analyze format at one instance using dcm2nii command.

Click below to download script
Multiple dcm2nii converter

For converting Nifti to Analyze and vice versa please visit the following entry;

And for splitting compressed or single images please visit the following entry;

Bash script works on both Linux and MAC.
user needs to copy this script to data directory and execute it from there using chmod +x to make it executable as following;
chmod +x dicom2nii.command or chmod +x dicom2nii.sh 
If you will use dicom2nii.command file copy it to your subjects' directory then execute it using dicom2nii.command. dicom2nii.sh you can do the same thing but you cant double click dicom2nii.sh.
Note: If mricron directory is not **** /Applications/mricronmac ****
Please do not forget to change it in **dicom2nii.command**  or  **dicom2nii.command** using any text editor

Please leave your feedback if you like this tool or a suggestion if you think it needs to be improved!

No comments: