DICOMTONIFTI(1)

πŸ’– DICOMTONIFTI(1) πŸ’–

okay bestie, welcome to dicomtonifti(1) β€” she's a vtk-dicom CLI and she's literally here to turn your DICOM series into a NIfTI file. let's get into it 🫢


✨ NAME ✨

dicomtonifti β€” vtk-dicom CLI, no cap πŸŽ€


🌸 DESCRIPTION 🌸

πŸ“Ό usage:

dicomtonifti -o file.nii file1.dcm [file2.dcm ...]

dicomtonifti -o directory --batch file1.dcm [file2.dcm ...]

like, that's the whole vibe. either you give it output files, or you give it a whole directory and let it cook in batch mode πŸ‘‘


πŸŽ€ options:

  • -o <output.nii[.gz]> β€” the output file. and if you're in --batch mode, sike, it's the output directory instead πŸ’…
  • -z, --compress β€” compress the output files, bestie.
  • -r, --recurse β€” recurse into subdirectories.
  • -b, --batch β€” do multiple series at once. main character energy, fr.
  • -s, --silent β€” don't echo the output filenames. hush mode 🀫
  • -v, --verbose β€” verbose error reporting, for when you need the full tea.
  • -L, --follow-symlinks β€” follow symbolic links when recursing πŸ¦‹
  • --descrip <text> β€” set the NIFTI descrip field to <text>.
  • --fsl β€” format the axial image for use in FSL.
  • --reformat-to-axial β€” reformat the image into axial orientation.
  • --no-slice-reordering β€” never reorder the slices. periodt.
  • --no-row-reordering β€” never reorder the rows.
  • --no-column-reordering β€” never reorder the columns.
  • --no-reordering β€” never reorder slices, rows, or columns. all of them, unbothered.
  • --no-qform β€” don't include a qform in the NIFTI file.
  • --no-sform β€” don't include an sform in the NIFTI file.
  • --time-tag β€” set the tag to use for time coordinate.
  • --time-delta-tag β€” set the tag to use for time spacing.
  • --time-delta β€” force the time spacing to be the given value.
  • --volume N β€” set which volume to output (starts at 0, so like, the first one is 0, not 1 πŸ™ˆ).
  • --version β€” print the version and exit.
  • --help β€” documentation for dicomtonifti.

okay so now the actual lore πŸ’–

this program will convert a DICOM series into a NIfTI file.

it reads the DICOM Position and Orientation metadata, and uses that info to generate qform and sform entries for the NIfTI header, after doing a conversion from the DICOM coordinate system to the NIfTI coordinate system. that's the whole arc ✨

by default, it will also reorder the columns of the image so that columns with higher indices are further to the patient's right (or in the case of sagittal images, further anterior). likewise, rows get rearranged so that rows with higher indices are superior (or anterior for axial images). finally, it reorders the slices so that the column direction, row direction, and slice direction follow the right-hand rule βœ‹πŸ“

it's also possible to reformat the images into the axial orientation via the --reformat-to-axial option. this option is mutually exclusive with the no-reordering options 😀 β€” they cannot coexist, pick a lane. the resulting orientation matrix will be the identity matrix.

if the output NIFTI files are going to be used with the FMRIB FSL package, then use the --fsl option to reformat the images to match the standard FSL orientation: axial images with the slices arranged from inferior to superior, column number increasing from right to left, and row number increasing from posterior to anterior. this will also convert the data type from unsigned 16-bit to signed 16-bit if necessary 🧚

the --time-tag, --time-delta-tag, and --time-delta options can be used to tweak the time information. by default, tags such as TriggerTime, TemporalPositionIdentifier, or TriggerTime are used to perform temporal sorting, but --time-tag can be used to explicitly name a tag. the --time-delta-tag option can be used to set which tag gives temporal spacing, if there is no tag that gives the temporal coordinate. the --time-delta option will force the temporal spacing to be a specific value, e.g. 500ms, 2s, or 2600us ⏱️

if batch mode is selected, the output file given with -o can be constructed from DICOM attributes, by providing the attribute names within curly braces. for example, consider the following: "{PatientID}-{StudyDate}/{SeriesDescription}-{SeriesNumber}.nii" or something similar to produce a hierarchical directory structure. the attributes used in the path should be from the following list:

  • PatientID, PatientName, PatientBirthDate, PatientSex, StudyID, StudyDescription, StudyDate, StudyTime, StudyInstanceUID, SeriesNumber, SeriesDescription, SeriesInstanceUID, Modality, AccessionNumber.

here is an example of batch mode that recurses into subdirectories and compresses the output files, putting the results in the current directory:

./obj-x86_64-linux-gnu/bin/dicomtonifti -brz -o
{SeriesDescription}-{SeriesNumber}.nii /path/to/dicom/files

πŸ‘‘ AUTHOR πŸ‘‘

this manual page was written by Mathieu Malaterre <malat@debian.org> for the Debian GNU/Linux system, but may be used by others. shoutout to the author, iconic behavior πŸ’œ


and that's the tea bestie β€” this was dicomtonifti version 0.8.17, dated August 2026 πŸŽ€ go forth and convert your DICOMs, you're gonna slay πŸ’…βœ¨

πŸ“¦ where this page comes from