This container can be used to convert raw magnitude dicom files to nifti format. Within this container we have included SciTran/data, SciTran/scripts, and all their dependencies. Please view the SciTran/data and SciTran/scripts github pages for more information regarding their usage.
dicomsort is a python function that will organize an assorted mess of dicom files (Siemens or GE) into exams/series. See the SciTran/scripts GitHub page for more information.
First, place all dicom images (un-compressed) into a single folder tree [ we will refer to this as /path/to/dicoms/]. We will mount that directory into the container and write out the tars to that same directory in a folder called 'tarfiles' using the following docker run command:
docker run --rm -ti -v /path/to/dicoms/:/data vistalab/scitrandata dicomsort tarsort /data /data/sorted /data/tarfiles
Convert tar archives of dicom files to nifti. SciTran/data Provides class and functions for parsing, identifying and writing scientific datasets. Currently, medical images (such as various flavors of MRI, dicoms, niftis, and some raw-files) are supported. Please see the SciTran/data GitHub page for more information.
Now we will take one of the tar files we created in the previous section and from that we will create a nifti file. To do that we will mount the pat to the tar file and run the following docker run command:
docker run --rm -ti -v /path/to/dicoms/tarfiles/:/data vistalab/scitrandata dcm2nii /data/[tar_File_From_Dicoms.tgz] /data/[nifti_from_dicom]
Optionally you can also supply a voxel_order flag to get the nifti out with a specific voxel order. For example:
docker run --rm -ti -v /path/to/dicoms/tarfiles/:/data vistalab/scitrandata dcm2nii /data/[tar_File_From_Dicoms.tgz] /data/[nifti_from_dicom] --voxel_order=LPS
Reconstruct and concatenate two niftis in the order the dicoms.tgz sources are provided on the command line. To reconstruct a Siemens multicoil scan, give the individual coil dicom.tgz as the first input, and the combined coil dicom.tgz as the second input.
To combine 2 multicoil tars [tar1.tgz and tar2.tgz], resulting from a run of dicomsort, we will run the following command using the names of the tar files as inputs to siemens_multicoil using the following docker run command:
docker run --rm -ti -v /path/to/dicoms/tarfiles/:/data vistalab/scitrandata siemens_multicoil /data/tar1.tgz /data/tar2.tgz -o combined_tar1_tar2.nii.gz