Convert DICOM files to NIFTI files
This recipe provides code for converting DICOM (.dcm) files to NIFTI (.nii) files
dcm2niix
- This recipe converts dicom to nifti files using the program dcm2niix
- https://github.com/rordenlab/dcm2niix
- The only required argument for dcm2niix is the location of the folder with the DICOM files to convert, which is always the final argument provided.
# install dcm2niix (for mac)
curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_mac.zip
# convert dicom files found in dicomdir, output to outdir
dcm2niix -o ~/outdir ~/dicomdir
dcm2niibatch (batch conversions)
- https://github.com/rordenlab/dcm2niix/blob/master/BATCH.md
- Use dcm2niibatch to perform batch conversion of multiple dicoms using the configurations specified in a yaml file
- See github link above for yaml file format
dcm2niibatch batch_config.yml
dcm2niix_afni (AFNI)
- This recipe will use afni's dcm2niix_afni to convert dicom files found in ~/dicomdir to nifti files, and output converted files into ~/outputdir
- For additional examples and options, see: https://afni.nimh.nih.gov/pub/dist/doc/program_help/dcm2niix_afni.html
|
|
dicom2nifti (python)
- This recipe will use the python library dicom2nifti to convert dicom files to nifti files
- https://github.com/icometrix/dicom2nifti
|
|
Recipe made by Bari Fuchs
These recipes may also be of interest
Using 3dAFNItoNIFTI to convert AFNI files to NIFTI files
This recipe converts BRIK/HEAD (AFNI) files to NIFTI (.nii) files using 3dAFNItoNIFTI. … Read More
Automatically Generated Recipe
python r bashExplain briefly what the recipe does. Explain briefly how the recipe works. Provide a citation and link to documentation of any third party … Read More
Contributing to the Neuroimaging Cookbook
python markdownThe title entered above will automatically appear here, so just start by explaining the recipe purpose of your recipe. Here are some … Read More
Using 3dcalc to create a binary mask from a parcellation scheme
This recipe uses 3dcalc in AFNI to output a binarized 3D image file (nifti) of a region-of-interest in a parcellation scheme that is indexed … Read More