DCMSTACK(1)

πŸ“¦
version 0.9+git20260610.ed4d27c Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… 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