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--batchmode, 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 fordicomtonifti.
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
- ubuntu stonking: vtk-dicom-tools 0.8.17-3build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms