DCMSTACK(1)
π DCMSTACK(1) β User Commands, bestie edition β¨
okay so real talk: this is dcmstack, a python3 package, and it does DICOM β NIfTI conversion. it's giving very much "I turned your weird hospital files into something your brain-analysis pipeline can actually open" energy. π§ π
πΈ NAME πΈ
dcmstack β DICOM to NIfTI conversion β python3 package. no cap, that's the whole gig.
π DESCRIPTION π
here's how you summon it:
dcmstack [-h] [--force-read] [--file-ext FILE_EXT] [--allow-dummies]
[--dest-dir DEST_DIR] [-o OUTPUT_NAME] [--output-ext OUTPUT_EXT]
[-d] [--embed-meta] [-g GROUP_BY] [--voxel-order VOXEL_ORDER]
[-t TIME_VAR] [--vector-var VECTOR_VAR] [--time-order TIME_ORDER]
[--vector-order VECTOR_ORDER] [-l] [--disable-translator DISABLE_TRANSLATOR]
[--extract-private] [-i INCLUDE_REGEX] [-e EXCLUDE_REGEX] [--default-regexes]
[-v] [--strict] [--version]
[src_dirs ...]
so what it does is stack up all the DICOM files from each source directory into volumes that are 2D all the way up to 5D, and if you want, it'll pull the meta data out too. it's giving β¨combinatorics but make it medical imagingβ¨.
πΉ positional arguments
src_dirsβ the source directories where your DICOM files are living. that's the raw material, bestie.
πΉ optional arguments
-h,--helpβ prints this help message and dips. classic.
π₯ Input options π₯
--force-readβ try reading every file as DICOM, even the ones missing the preamble. chaotic but sometimes necessary π« .--file-ext FILE_EXTβ only even attempt reading files with this extension. Default:.dcm.--allow-dummiesβ let DICOM files with no pixel data slide through, and fill that slice of the output nifti with the maximum representable value. yes it's a filler slice, no it's not cute, but it's what you asked for π.
π€ Output options π€
--dest-dir DEST_DIRβ where the output goes. defaults to the source directory, so if you don't say nothing, it just stays home π .-o OUTPUT_NAME,--output-name OUTPUT_NAMEβ a Python format string that decides the output filenames based on DICOM tags. yes, a format string. slay.--output-ext OUTPUT_EXTβ the extension for the output file type. Default:.nii.gz.-d,--dump-metaβ dump the extracted meta data into a JSON file with the same base name as the generated Nifti. json girlies rise π.--embed-metaβ embed that extracted meta data into a Nifti header extension, in JSON format. it's meta-ception, and I'm obsessed π.
π§± Stacking Options π§±
-g GROUP_BY,--group-by GROUP_BYβ a comma separated list of meta data keys, used to group your input files into stacks. this is how you tell it who belongs with who π.--voxel-order VOXEL_ORDERβ orders the voxels so the spatial indices start from these directions in patient space. the directions in patient space get given as a three character code: (l)eft, (r)ight, (a)nterior, (p)osterior, (s)uperior, (i)nferior. pass an empty string and it'll disable reorientation entirely. Default:LAS.-t TIME_VAR,--time-var TIME_VARβ the DICOM element keyword to use when ordering the stack along the time dimension. time is a construct, but this one's a keyword β³.--vector-var VECTOR_VARβ the DICOM element keyword to use when ordering the stack along the vector dimension.--time-order TIME_ORDERβ hand it a text file with the order you want the values of the time-variable attribute to go in, one per line. heads up: this option is rarely needed.--vector-order VECTOR_ORDERβ same deal, but for the vector variable: a text file with the desired order of the values, one per line. also rarely needed.
π Meta Extraction and Filtering Options π
-l,--list-translatorsβ list the enabled translators and exit. window shopping π.--disable-translator DISABLE_TRANSLATORβ disable the translators for the tags you provide. tags go in the format"0x0_0x0". you can pass more than one as a comma separated list. and if you hand it the word"all", literally every translator gets disabled. ngl that's a lot of power π.--extract-privateβ extract meta data from private elements, even when there's no translator for them. if the element's value has non-ascii bytes, it still gets ignored. and the extracted meta data can still get filtered out by the regular expressions. so many gates, so little time π.-i INCLUDE_REGEX,--include-regex INCLUDE_REGEXβ include any meta data whose key matches the regular expression you gave. this overrides any exclude expressions. it applies to all meta data, no exceptions.-e EXCLUDE_REGEX,--exclude-regex EXCLUDE_REGEXβ exclude any meta data whose key matches your regular expression. this supplements the default exclude expressions. applies to all meta data too.--default-regexesβ print out the list of default include and exclude regular expressions and exit. receipts, printed π.
βοΈ General Options βοΈ
-v,--verboseβ print additional information. yapper mode: on π’.--strictβ fail on the very first exception instead of showing a warning. no chill, all consequences.--versionβ show the version and exit.
π¨ READ THIS ONE, BESTIE π¨ IT IS YOUR RESPONSIBILITY TO KNOW IF THERE IS PRIVATE HEALTH INFORMATION IN THE METADATA EXTRACTED BY THIS PROGRAM. like. for real. that's on you, not on dcmstack. be careful with people's data, okay? π«Ά
π AUTHOR π
this manpage was written by Nilesh Patra for the Debian distribution, and it can be used for any other usage of the program. king behavior π.
and that's the whole page!! dcmstack 0.8, dated November 2021, signed, sealed, slayed π
β¨ bye bestie, go convert some DICOMs π¦
π¦ where this page comes from
- debian trixie: python3-dcmstack 0.9-3 Β· MIT
- ubuntu questing: python3-dcmstack 0.9-3
- ubuntu resolute: python3-dcmstack 0.9-3build1 Β· MIT
- ubuntu stonking: python3-dcmstack 0.9+git20260610.ed4d27c-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms