CMTK(1)

๐Ÿ’– CMTK(1) โ€” the Computational Morphometry Toolkit ๐Ÿ’– (part 1)

okay so bestie, this is the manual page for cmtk. Manual name: CMTK(1). Periodt. ๐Ÿ‘‘


โœจ NAME โœจ

cmtk โ€” the Computational Morphometry Toolkit. That's the whole name section, no cap. ๐ŸŒˆ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

cmtk <command> [options]

๐Ÿซถ DESCRIPTION ๐Ÿซถ

This helper script is your unified access pass to all command-line tools provided by CMTK. You tell it which CMTK command to run, plus the options for that command. For <command>-specific options, check the cmtk-<command>(1) manpage or the output of cmtk <command> --help. It's giving very one door, all the tools, fr fr. ๐Ÿ’…


๐ŸŽ€ COMMANDS ๐ŸŽ€

Here's the whole squad. Each one is a CMTK command you can call through cmtk.

  • asegment โ€” registers a target image to an atlas, using affine first and then nonrigid B-spline registration, then reformats the atlas label map to the target image. atlas-to-you pipeline, slay. โœจ
  • asegment_sri24 โ€” registers a target image to a selected channel of the SRI24 human brain atlas, then reformats one of the atlas label maps to the target image. Note: it is assumed that the target image is skull-stripped, i.e., contains only the brain. Don't forget that part, bestie. ๐Ÿง 
  • average_affine โ€” computes the average of a sequence of user-provided affine coordinate transformations.
  • average_images โ€” computes pixelwise average, variance, standard deviation, z-score, or entropy images from a list of user-provided intensity images. it's giving stats class but make it iconic. ๐Ÿ“Š
  • average_labels โ€” averages co-registered label images using partial volumes.
  • avg_adm โ€” computes average-shape average-intensity images and deformation maps using an active deformation model.
  • concat_affine โ€” computes the explicit concatenation of multiple affine coordinate transformations, each of which can be optionally inverted.
  • convert_warp โ€” converts nonrigid B-spline free-format deformation coordinate transformations between different representations (e.g., absolute vs. relative vectors). Also creates fractional transformations. versatile queen. ๐Ÿฆ‹
  • convertx โ€” converts between image file formats and pixel data types. It can also apply simple, general-purpose image operations in the process. An arbitrary number of operations can be specified on the command line, and they will be applied exactly in the order given. order matters, lowkey always. ๐Ÿ”ฅ
  • dbtool โ€” modifies and queries the database of images and transformations between them.
  • dcm2image โ€” combines sets of DICOM slices to 3D image stacks.
  • describe โ€” prints a detailed description of the input files as either image(s) or transformation(s).
  • destripe โ€” corrects stripe artifacts in acquired image stacks which can result from between-slice intensity scale differences.
  • detect_adni_phantom โ€” detects the locations of all spherical landmarks in a 3D image of the Magphan EMR051 structural imaging phantom (a.k.a. ADNI Phantom).
  • detect_spheres_matched_filter โ€” detects spherical objects in three-dimensional images.
  • dof2mat โ€” converts an affine transformation from degrees-of-freedom representation to matrix form.
  • dwi_mask_bad_slices โ€” reads a set of 3D diffusion-weighted MR images and finds bad slices. A bad slice in a diffusion image is detected as one whose mean intensity is outside a specified interval around the mean of the means of all corresponding slices from the remaining diffusion images. outlier detection but for slices. ๐Ÿ“
  • epiunwarp โ€” corrects B0 field inhomogeneity-induced distortion in Echo Planar Images (e.g., diffusion-weighted images) using two images acquired with opposing phase encoding directions.
  • fib2image โ€” fiber tracking results from the UNC Fiber Tracking tool are read from Standard Input, and all fiber points are drawn into a 3D image. The result is written in one of the supported image file formats.
  • fibxform โ€” a file with fiber tracking results from the UNC Fiber Tracking tool is read from Standard Input, and one or more (concatenated) coordinate transformations are applied to all fiber point coordinates. The result is written to Standard Output, again in UNC fiber file format.
  • film โ€” splits an interleaved input image into the pass images, co-registers them, and reconstructs a motion-corrected image. motion correction main character energy. ๐ŸŽฌ
  • filter โ€” applies spatial filtering operators, including content-sensitive operators, based on selective Gaussian kernels.
  • fit_affine_dfield โ€” fits a linear affine transformation to a nonrigid transformation, either a B-spline free-form deformation or a non-parametric deformation field.
  • fit_affine_xform โ€” fits a linear affine transformation to a list of concatenated, optionally inverted, transformations.
  • fit_affine_xform_landmarks โ€” fits a linear affine transformation to a set of matched landmarks.
  • fit_spline_dfield โ€” fits a parametric nonrigid transformation (B-spline free-form deformation) to a deformation field.
  • fit_spline_xform โ€” fits a parametric nonrigid transformation (B-spline free-form deformation) to a list of concatenated, optionally inverted, transformations.
  • geomatch โ€” reads two or more images and tests whether their grid dimensions, pixel sizes, and image-to-space transformations match. Optionally, all images are reoriented into standard orientation before performing the test. If all images match, the tool returns with exit code 0, otherwise it returns with exit code 2. In case of an error (e.g., one of the images can not be read), the exit code is 1. vibe check: passed, failed, or error. โœ…๐Ÿ’€
  • glm โ€” statistical modeling of pixel intensities in multiple images using a General Linear Model.
  • gmm โ€” segments an image into c classes using the EM algorithm for Gaussian mixtures with optional priors.
  • gregxform โ€” THIS TOOL IS DEPRECATED. PLEASE USE streamxform INSTEAD. ๐Ÿšจ
  • groupwise_affine โ€” registers a population of input images simultaneously, without a template, using either the 'congealing' algorithm or a groupwise similarity measure based on a continuous approximation of mutual information ('RMI').
  • groupwise_init โ€” computes initial affine alignment for a group of input images, which can be used as an input for groupwise registration.
  • groupwise_warp โ€” nonrigidly registers a population of input images simultaneously, without a template, using either the 'congealing' algorithm or a groupwise similarity measure based on a continuous approximation of mutual information ('RMI').
  • hausdorff โ€” computes the Hausdorff distance between two label images.
  • histogram โ€” creates a histogram of image intensities and writes it as a tab-separated text file to standard output.
  • imagemath โ€” performs operations on images using stack-based postfix notation. stack-based postfix notation ate, ngl. ๐Ÿงฎ
  • interleaved_bad_slices โ€” reads a time series of 3D images and detects outliers.
  • iterative_shape_averaging โ€” the original page gives no description here, so I'm not inventing one, bestie. ๐Ÿซถ
  • jidb โ€” splits an interleaved input image into the pass images, co-registers them, and reconstructs a motion-corrected image.
  • levelset โ€” levelset-type segmentation of foreground/background using minimum regional variance energy.
  • lmsba โ€” combines multiple multi-class segmentations from co-registered and reformatted atlases using locally-weighted Shape-Based Averaging.
  • lsba โ€” combines multiple binary segmentations from co-registered and reformatted atlases using locally-weighted Shape-Based Averaging.
  • lvote โ€” combines multiple segmentations from co-registered and reformatted atlases using locally-weighted voting.
  • make_initial_affine โ€” computes an initial affine transformation by aligning centers of mass or principal axes.
  • mat2dof โ€” converts a transformation matrix to degrees of freedom.
  • mcaffine โ€” multi-channel affine image registration using histogram-based or covariance-based joint entropy measures.
  • mcwarp โ€” multi-channel nonrigid B-spline image registration using histogram-based or covariance-based joint entropy measures.
  • mk_adni_phantom โ€” generates an image of the ADNI structural imaging calibration phantom (a.k.a. Magphan EMR051).
  • mk_analyze_hdr โ€” makes a header file according to the Analzye 7.5 format based on user-supplied parameters for geometry, data type, orientation, etc.
  • mk_nifti_hdr โ€” makes a header file according to the NIFTI file format based on user-supplied parameters for geometry, data type, orientation, etc.
  • mk_phantom_3d โ€” generates 3D digital phantom images using a selection of drawing commands.
  • mrbias โ€” corrects intensity inhomogeneity artifacts in MR images using a bias field estimated via entropy minimization.
  • overlap โ€” computes overlap measures between two or more images.
  • probe โ€” prints pixel values or symbolic labels at a list of user-provided image coordinates.
  • pxsearch โ€” reads an image file, as well as a list of pixel coordinates from standard input. For each pixel, a local neighbourhood in the image is searched for the maximum value. The location of the maximum is then written to standard output.
  • reformatx โ€” extended volume reformatter tool to compute reformatted images and Jacobian maps from arbitrary sequences of concatenated transformations.
  • registration โ€” performs rigid and affine image registration using multi-resolution optimization of voxel-based image similarity measures.
  • registrationx โ€” performs rigid and affine image registration using multi-resolution optimization of voxel-based image similarity measures.
  • regress โ€” linear (and higher-order polynomial) regression of deformation fields and images.
  • reorient โ€” converts between image orientations, i.e., physically re-orders the pixel array and adapts stored anatomical orientation information.
  • sba โ€” averages segmentations (label fields) using the Euclidean Distance Transform. All input images must be in the same space. EDT is computed in this space also. See http://dx.doi.org/10.1109/TIP.2006.884936 for details of the underlying algorithm.
  • sbai โ€” averages your segmentations (label fields) using the Euclidean Distance Transform ๐Ÿ’ซ it does joint interpolation AND averaging by interpolating from the EDT. But bestie, heads up: this needs the inputs to be transformations from the same fixed image to (not necessarily the same) different moving images. The EDT computation happens in the space of each moving image, okay? For the whole algorithm deep-dive see http://dx.doi.org/10.1109/TIP.2006.884936 ๐Ÿง 
  • sequence โ€” analyzes a sequence of numerical values, which it reads straight from standard input ๐Ÿ“ฅ
  • similarity โ€” computes similarity measures between two images, like intensity difference or label overlaps ๐Ÿซถ
  • split โ€” splits a volume image into sub-images, i.e. separating interleaved images into passes โœ‚๏ธ
  • statistics โ€” does statistical computations on image pixel intensities, i.e. means and standard deviations ๐Ÿ“Š
  • stream_pixels โ€” reads one or more images and writes ALL their pixels to standard output in binary form โœจ optionally each image can be reoriented to a specified anatomical orientation and/or converted to a different data type. This is the moment for piping image data through a pipeline, e.g. the Camino DTI toolkit ๐ŸŒŠ
  • streamxform โ€” an ASCII-format list of point coordinates is read from standard input, and then a user-provided sequence of coordinate transformations (each one optionally inverted, no big deal) gets applied to them. The transformed points get written to standard output ๐Ÿ’…
  • sympl โ€” computes the approximate symmetry plane of an image, so you can find like, the mid-sagittal plane in human brain images ๐Ÿง  various forms of output are supported, e.g. writing the input image with the symmetry plane drawn into it, or the input image realigned along the symmetry plane โœจ
  • symplx โ€” computes the approximate symmetry plane of an image, so you can find like, the mid-sagittal plane in human brain images ๐Ÿง  various forms of output are supported, e.g. writing the input image with the symmetry plane drawn into it, or the input image realigned along the symmetry plane โœจ
  • ttest โ€” pixelwise tests of statistical significance ๐Ÿ”ฌ also computes correlations and z-scores โœจ
  • unsplit โ€” joins separate image stacks into a single interleaved image volume (the glow-up of split, we love to see it) ๐Ÿงฉ
  • unwarp_image_phantom โ€” this tool computes either a polynomial transformation or a B-spline free-form deformation to unwarp an image ๐ŸŒ€ the transformation is based on expected and detected landmarks in an image of a structural phantom acquired on the same scanner. Use the detect_adni_phantom tool to detect landmarks of the ADNI Phantom in an image and generate a phantom description file suitable for use with this tool ๐Ÿ‘‘
  • vol2csv โ€” computes the volumes of regions in a label image ๐Ÿ“ it optionally accepts density maps (e.g. for different tissues) and computes and prints the per-region content for each one. Also, the tool can accept an optional pixel volume map to account for local pixel volume variations, e.g. due to spatial distortion โœจ
  • volume_injection โ€” reconstruction of a high-resolution volume from multiple co-registered (low-resolution) images using forward volume injection ๐Ÿ’‰
  • volume_reconstruction โ€” iterative volume reconstruction from co-registered images using inverse interpolation or joint deblurring ๐Ÿ”
  • vtkxform โ€” an ASCII-format VTK file is read from standard input, and a user-provided coordinate transformation (optionally inverted) is applied to the vertex coordinates ๐ŸŽฏ a VTK file with transformed points is then written to standard output ๐Ÿ’ซ
  • warp โ€” this program performs nonrigid image registration using multi-resolution optimization of voxel-based image similarity measures and a multi-resolution B-spline transformation model ๐Ÿ”ฅ main character energy fr fr
  • warp2ps โ€” writes a deformation field as a deformed grid in PostScript format, for visualization and illustration ๐ŸŽจ
  • warpx โ€” this program performs nonrigid image registration using multi-resolution optimization of voxel-based image similarity measures and a multi-resolution B-spline transformation model ๐Ÿ”ฅ (yes, same vibe as warp, it's giving twins โœจ)
  • xform2dfield โ€” converts a parametric rigid or nonrigid transformation to a deformation field, sampled at pixel locations of a given reference image ๐Ÿ—บ๏ธ
  • xform2itk โ€” converts coordinate transformations from CMTK format to ITK format, and while it's at it, also corrects for differences in image coordinate conventions ๐Ÿ”„
  • xform2scalar โ€” extracts scalar measures from transformations and deformation fields, sampled at grid locations, and writes the results to an image ๐Ÿ–ผ๏ธ examples of supported scalar measures are: x,y,z component of the transformation, magnitude of the transformation, and Jacobian determinants โœจ

๐Ÿ’– AUTHORS ๐Ÿ’–

Torsten Rohlfing, with contributions from Michael P. Hasak, Greg Jefferis, Calvin R. Maurer, Daniel B. Russakoff, and Yaroslav Halchenko ๐Ÿ‘‘ absolute legends, every single one

๐Ÿ“œ LICENSE ๐Ÿ“œ

http://www.fsf.org/licensing/licenses/gpl.html โ€” yeah bestie, go read it, it's important ๐Ÿซถ

๐Ÿ› BUGS ๐Ÿ›

Found something broken? Report bugs at http://nitrc.org/projects/cmtk/ โ€” don't suffer in silence, that's not the vibe ๐Ÿ’€

๐ŸŒธ 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 a wrap on CMTK 3.3.1p2, dated Jun 24 2026 ๐ŸŽ€ tysm for reading, go slay some neuroimaging, ily bye ๐Ÿ’…๐Ÿฆ‹
๐Ÿ“ฆ where this page comes from