dwi_ma..._slices(1)
π
dwi_mask_bad_slices β the dwi_ma..._slices(1) page, bestie edition
okay so real quick: this is a page from The Computational Morphology Toolkit (CMTK, our beloved), and it's about a lil tool called dwi_mask_bad_slices. she's a problem-solver. she finds the weird slices. yes bestie, we're doing this.
β¨ NAME β¨
dwi_mask_bad_slices β find bad slices in a set of diffusion-weighted images. that's it. that's the job. π
πΈ SYNOPSIS πΈ
dwi_mask_bad_slices DiffusionImagePaths
so simple, so iconic. you hand her a list of paths, she does her thing. periodt.
π¦ DESCRIPTION π¦
Bestie, listen. This tool reads a whole set of 3D diffusion-weighted MR images and goes hunting for bad slices. Not vibe bad. Actually bad.
Here's the tea though on how she decides: a slice in a diffusion image counts as a bad slice when its mean intensity falls outside a specified interval around the mean of the means of all corresponding slices from the remaining diffusion images. Basically she looks at what all the other corresponding slices averaged to, she builds a comfy little interval around that, and if your slice is way outside? She clocks it. Immediately. π
π OPTIONS π
π Global Toolkit Options (these are shared by all CMTK tools)
these are the universal ones, the group-chat regulars, every CMTK tool has them:
--helpβ writes the list of basic command line options to standard output. the essentials, no lore.--help-allβ writes the complete list of basic and advanced command line options to standard output. the extended lore. the director's cut.--wikiβ writes the list of command line options to standard output in MediaWiki markup. for when you're wiki-pilled.--manβ writes the man page source innroffmarkup to standard output. yes she can write her own manpage. main character energy fr.--versionβ writes the toolkit version to standard output.--echoβ writes the current command line to standard output. she's just letting you know what you asked for.--verbose-level <integer>β set the verbosity level. pick your yapping tier.--verbose,-vβ increment verbosity level by 1. β οΈ deprecated β supported for backward compatibility only. she still loves you if you use it, but she's moved on.--threads <integer>β set the maximum number of parallel threads (for POSIX threads and OpenMP). go faster, slay.
π Input Options
--b0count <integer>β number ofb=0images at the beginning of the image list. These are not included in bad slice detection or masking, but they are written to the output directory anyway for convenience. and it's a hard assumption that allb=0images sit at the beginning of the list of input images β not at the end, not in the middle. do not test her. [Default:0]--slice-orientationβ defines the slice orientation of the diffusion images. Supported values:"axial","sagittal","coronal","slice-x","slice-y","slice-z", where the default is"axial". or you can use one of these lil shortcut flags instead:--axialβ Axial slices. [This is the default]--sagittalβ Sagittal slices.--coronalβ Coronal slices.--slice-xβ X coordinate axis is the slice direction.--slice-yβ Y coordinate axis is the slice direction.--slice-zβ Z coordinate axis is the slice direction. [This is the default]
π yes, both the"axial"value and"slice-z"value are noted as the default. that's exactly what the original says. we do not editorialize. we report. π
π₯ Bad Slice Detection
--stdev <double>β threshold for bad slice identification, in units of intensity standard deviations over all corresponding slices from the remaining diffusion images. [Default:3]
π Output Options
--convert-toβ scalar data type for the output images. Here's a real tip from the original: if your padding value is negative but your input data is unsigned, for example, make sure to select a signed data type for the output. By default, the output data type is the same as the input type. Supported values:"char","byte","short","ushort","int","uint","float","double". or use one of these:--charβ 8 bits, signed--byteβ 8 bits, unsigned--shortβ 16 bits, signed--ushortβ 16 bits, unsigned--intβ 32 bits signed--uintβ 32 bits unsigned--floatβ 32 bits floating point--doubleβ 64 bits floating point
--padding-value <double>,-p <double>β padding value used to replace the data of detected bad slices in the output images. [Default:-1]--bad-slice-statistics <string>,-s <string>β a CSV file capturing the slice number and distance of bad slices. [Default:NONE]--output-directory <string>,-o <string>β file system path for writing images with bad slices masked out (i.e., filled with a padding value). [Default:NONE]
π AUTHORS π
Torsten Rohlfing, with contributions from Michael P. Hasak, Greg Jefferis, Calvin R. Maurer, Daniel B. Russakoff, and Yaroslav Halchenko. the whole squad showed up and honestly? ate. π
β LICENSE β
http://www.fsf.org/licensing/licenses/gpl.html
go read it, bestie. it's giving legal but make it free software.
π BUGS π
Report bugs at http://nitrc.org/projects/cmtk/
she's not perfect, she's just a tool. tell the devs, not the group chat. π
π 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.
funding! we love to see it. π«Ά
and that's the whole page, bestie. no cap, nothing skipped. this was CMTK 3.3.1p2, dated Jun 24 2026, page dwi_ma..._slices(1) β go find those bad slices and mask them out. you got this. β¨ππ§
π¦ 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