dcm2image(1)
π dcm2image(1) β DICOM to Image π
okay bestie, welcome to the CMTK corner of the terminal πΈ this one lives in The Computational Morphology Toolkit, and it's the little command that takes your pile of DICOM slices and goes "say less, I got you" π«Ά
β¨ NAME β¨
dcm2image β DICOM to Image, no cap πΈ
π¦ SYNOPSIS π¦
dcm2image SearchDirList
π DESCRIPTION π
It combines sets of DICOM slices into 3D image stacks. That's the whole vibe. Your slices get stacked into actual volumetric images and honestly? iconic. π
π OPTIONS π
π Global Toolkit Options (these are shared by all CMTK tools)
like, the group-chat-wide settings that every single CMTK tool has π«
--helpβ writes the list of basic command line options to standard output. the lil starter pack β¨--help-allβ writes the complete list of basic and advanced command line options to standard output. the deluxe version, no secrets kept π--wikiβ writes the list of command line options to standard output in MediaWiki markup.--manβ writes man page source in'nroff'markup to standard output.--versionβ writes the toolkit version to standard output.--echoβ writes the current command line to standard output.--verbose-level <integer>β set the verbosity level. you pick the number, bestie π’--verbose,-vβ increment the verbosity level by 1. heads up though: this one is deprecated, kept around only for backward compatibility π₯²--threads <integer>β set the maximum number of parallel threads (for POSIX threads and OpenMP). more threads, more chaos, more slay π§΅
π Main Options
--no-progressβ disable progress reporting. if you don't want the lil bar hyping you up, fine, your choice π
π Input Options
--recurse,-rβ recurse into directories. go deep, go feral, look inside everything π
π Output Options
--out-pattern <string>,-O <string>β output image path pattern. here are the substitutions you can use, and you're gonna want to know these:%dβ printf-style variant (image number)%nβ image number with automatic number of digits%Nβ like%n, but with a hyphen'-'before the number if there is more than one image%Dβ DICOM SeriesDescription%Rβ DICOM RepetitionTime (MRI only)%Eβ DICOM EchoTime (MRI only)%Tβ RawDataType (vendor-specific, currently GE MRI only)
default is: image%n.nii
--xml,-xβ write an XML sidecar file for each created image.--include-identifiersβ include potentially protected identifying information (e.g., UIDs, device serial numbers, dates) in the created XML sidecar files. β οΈ yeah, that's the spicy one β it puts identifying stuff in there, so know what you're doing.--embedβ embed DICOM information into output images as'description'(if supported by the output file format). supported values:"StudyID_StudyDate","PatientName","SeriesDescription","None", where the default is"None". or, use one of the following instead:--StudyID_StudyDateβ StudyID, tag(0020,0010), then an underscore, followed by StudyDate, tag(0008,0020). date gets appended because StudyID is four digits only and will repeat sooner or later. (the manpage said it, not me π)--PatientNameβ patient name, tag(0010,0010)--SeriesDescriptionβ series description, tag(0008,103e)--Noneβ embed no information, just leave the'description'field empty. β¨ this is the default β¨
π§ Filtering Options
--filter <string>β filter DICOM files and include only those matching the given pattern, of the form'TagName=text', such that the value of the DICOM tag with the given name contains the given text. if you provide multiple filter patterns by repeating this option, only files that match ALL patterns get included. all of them. every single one. periodt π―--exclude <string>β exclude all DICOM files matching the given pattern, of the form'TagName=text', such that the value of the DICOM tag with the given name contains the given text. if you provide multiple exclusion patterns, all files get excluded that match ANY of the patterns. one match and they're out πͺ
π Sorting Options
--no-sortβ do NOT sort files by file name (sorting determines image stack order when resolving spatial collisions).--sort-by-nameβ sort files lexicographically by file name. use this when instance numbers are non-unique.--sort-by-instanceβ sort files by image instance number. use this when file names are different lengths, etc. β¨ this is the default β¨
β Stacking Options
--write-single-slicesβ also write output images for single-slice DICOM files that could not be assigned to any 3D stacks. by default, these are skipped. give the lonely slices a home π₯Ί--ignore-acq-numberβ ignore the'AcquisitionNumber'tag for image grouping, i.e., do not separate stacks based on this tag.--no-orientation-checkβ disable checking of image orientations (to avoid rounding issues).--tolerance <double>β tolerance for floating-point comparisons (must be>= 0;0= exact matches only; default:1e-5). if one or more volumes cannot be stacked because of non-uniform slice spacing that exceeds this threshold,dcm2imagewill return an exit code of3. π¨ noted, bestie.
default is: 1e-05
π AUTHORS
Torsten Rohlfing, with contributions from Michael P. Hasak, Greg Jefferis, Calvin R. Maurer, Daniel B. Russakoff, and Yaroslav Halchenko. absolute legends, every one of them π
π LICENSE
http://www.fsf.org/licensing/licenses/gpl.html π«Ά
π BUGS
Report bugs at http://nitrc.org/projects/cmtk/. they want to hear from you, fr fr.
π ACKNOWLEDGMENTS
CMTK is developed with support from the NIAAA under Grant AA021697, National Consortium on Alcohol and Neurodevelopment in Adolescence (N-CANDA): Data Integration Component. From April 2009 through September 2011, CMTK development and maintenance was supported by the NIBIB under Grant EB008381. π
and that's the whole page!! mwah π it's CMTK 3.3.1p2, dated Jun 24 2026, and it served. go stack something gorgeous, bestie πΈβ¨
π¦ where this page comes from
- ubuntu stonking: cmtk 3.3.1p2+dfsg-4build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms