.TH convertx "1" "Jan 25 2019" "CMTK 3.3.1p1" "The Computational Morphometry Toolkit" .SH NAME convertx \- Convert between image file formats and data types. .SH SYNOPSIS convertx [options] infile outfile .SH DESCRIPTION This tool 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, which will be applied exactly in the order given. .SH OPTIONS .SS Global Toolkit Options (these are shared by all CMTK tools) .TP 5 \fB\-\-help\fR Write list of basic command line options to standard output. .TP 5 \fB\-\-help-all\fR Write complete list of basic and advanced command line options to standard output. .TP 5 \fB\-\-wiki\fR Write list of command line options to standard output in MediaWiki markup. .TP 5 \fB\-\-man\fR Write man page source in 'nroff' markup to standard output. .TP 5 \fB\-\-version\fR Write toolkit version to standard output. .TP 5 \fB\-\-echo\fR Write the current command line to standard output. .TP 5 \fB\-\-verbose-level\fR \fI\fR Set verbosity level. .TP 5 \fB\-\-verbose\fR, \fB\-v\fR Increment verbosity level by 1 (deprecated; supported for backward compatibility). .TP 5 \fB\-\-threads\fR \fI\fR Set maximum number of parallel threads (for POSIX threads and OpenMP). .SS Image/Transformation Database .TP 5 \fB\-\-db\fR \fI\fR Path to image/transformation database that should be updated with the newly created image. .B [Default: NONE] .SS Input Image Controls .TP 5 \fB\-\-set-padding\fR \fI\fR Set padding value: all pixels in the input image that have this value will be ignored in all subsequent operations. .TP 5 \fB\-\-unset-padding\fR Unset padding value: for all subsequent operations, all pixels will be treated according to their value. .TP 5 \fB\-\-labels\fR Specify that the image values are to be treated as discrete labels. This will result in the appropriate intent code to be set in output files in NIfTI format. .TP 5 \fB\-\-grey\fR Specify that the image values are to be treated as continuous grey levels. This will reset the intent code in files read from NIfTI format. .SS Data Type Conversion .TP 5 \fB\-\-char\fR 8 bits, signed integer .TP 5 \fB\-\-byte\fR 8 bits, unsigned integer .TP 5 \fB\-\-short\fR 16 bits, signed integer .TP 5 \fB\-\-ushort\fR 16 bits, unsigned integer .TP 5 \fB\-\-int\fR 32 bits signed integer .TP 5 \fB\-\-uint\fR 32 bits unsigned integer .TP 5 \fB\-\-float\fR 32 bits floating point .TP 5 \fB\-\-double\fR 64 bits floating point .SS Value Mappings .TP 5 \fB\-\-map-values\fR \fI\fR Apply mapping function to pixel values. Mapping is defined as 'VAL0[,VAL1,...][:NEWVAL]' to map values VAL0, VAL1, etc. to new value NEWVAL. If NEWVAL is not given, values are set to padding. .TP 5 \fB\-\-map-values-only\fR \fI\fR Apply mapping function to pixel values and replace unmapped pixels with padding. Multiple such mapping rules can be concatenated as RULE0+RULE1[+...]; all concatenated rules will be applied simultaneously.Mapping is defined as 'VAL0[,VAL1,...][:NEWVAL]' to map values VAL0, VAL1, etc. to new value NEWVAL. If NEWVAL is not given, values are set to padding. Multiple such mapping rules can be concatenated as RULE0+RULE1[+...]; all concatenated rules will be applied simultaneously. .TP 5 \fB\-\-replace-padding\fR \fI\fR Replace padded pixel data with given value. .TP 5 \fB\-\-replace-inf-nan\fR \fI\fR Replace all infinite and not-a-number pixels with given value. .SS Image Flipping .TP 5 \fB\-\-flip-x\fR Flip (mirror) along x-direction .TP 5 \fB\-\-flip-y\fR Flip (mirror) along y-direction .TP 5 \fB\-\-flip-z\fR Flip (mirror) along z-direction .SS Image Masking and Thresholding .TP 5 \fB\-\-mask\fR \fI\fR Binary mask file name: eliminate all image pixels where mask is 0. Masked-out pixels will NOT be set to zero, but will instead be replaced with the currently-set padding value. Use '--set-padding 0' prior to '--mask' to force setting to zero. .TP 5 \fB\-\-mask-inverse\fR \fI\fR Inverse binary mask file name eliminate all image pixels where mask is NOT 0. See also notes regarding padding under '--mask' above. .TP 5 \fB\-\-thresh-below\fR \fI\fR Set all values below threshold to threshold value. .TP 5 \fB\-\-thresh-above\fR \fI\fR Set all values above threshold to threshold value. .TP 5 \fB\-\-thresh-below-to-padding\fR \fI\fR Set all values below threshold to padding value. .TP 5 \fB\-\-thresh-above-to-padding\fR \fI\fR Set all values above threshold to padding value. .TP 5 \fB\-\-binarize-thresh\fR \fI\fR Set all values below threshold to 0, all values equal or above to 1. .TP 5 \fB\-\-otsu-thresh\fR Binarize image to 0/1 using threshold computed with Otsu's method. Argument is number of histogram bins for threshold computation. .TP 5 \fB\-\-otsu-thresh-nbins\fR \fI\fR Binarization using Otsu's method with user-defined number of histogram bins for threshold computation. .TP 5 \fB\-\-prune-histogram\fR \fI\fR Threshold image by 'intensity histogram pruning', i.e., for given argument n [histogram bins] determine thresholds such that the 1/n-th fraction of highest and lowest voxels are thresholded. .TP 5 \fB\-\-prune-histogram-high\fR \fI\fR Like '--prune-histograms', but only remove high intensities. .TP 5 \fB\-\-prune-histogram-low\fR \fI\fR Like '--prune-histograms', but only remove low intensities. .SS Intensity Transformations .TP 5 \fB\-\-scale-to-range\fR \fI\fR Scale image intensities to range 'from:to', e.g., '0:255' before conversion to byte data. .TP 5 \fB\-\-histogram-equalization\fR Apply histogram equalization. .TP 5 \fB\-\-histogram-equalization-nbins\fR \fI\fR Apply histogram equalization with number of bins. .TP 5 \fB\-\-match-histograms\fR \fI\fR Transform intensities to match the distribution in the image provided as the argument for this command. .TP 5 \fB\-\-match-mean-sdev\fR \fI\fR Scale intensities to match the mean and standard distribution of intensities in the image provided as the argument for this command. .SS Morphological Operations .TP 5 \fB\-\-revert\fR Revert a binary mask, i.e., exchange foreground and background. .TP 5 \fB\-\-erode\fR \fI\fR Morphological erosion operator (by pixels) .TP 5 \fB\-\-dilate\fR \fI\fR Morphological dilation operator (by pixels) .TP 5 \fB\-\-erode-distance\fR \fI\fR Morphological erosion operator (by distance). Often preferable for anisotropic data. .TP 5 \fB\-\-erode-distance-multilabel\fR \fI\fR Morphological erosion operator (by distance) for multi-label maps. The result will be either byte, unsigned short, or unsigned int data, depending on the index of the largest used label in the input. .TP 5 \fB\-\-dilate-distance\fR \fI\fR Morphological dilation operator (by distance). Oftern preferable for anisotropic data. .TP 5 \fB\-\-connected-components\fR Create connected components map with regions numbered by decreasing component size .TP 5 \fB\-\-boundary-map\fR Create boundary map .TP 5 \fB\-\-multi-boundary-map\fR Create multi-valued boundary map .TP 5 \fB\-\-distance-map\fR Compute unsigned Euclidean distance map. Input image is interpreted as binary mask. .TP 5 \fB\-\-signed-distance-map\fR Compute signed (inside=negative, outside=positive) Euclidean distance map .SS Filter Operations .TP 5 \fB\-\-median-filter\fR \fI\fR Median filter. This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-mean-filter\fR \fI\fR Regional mean filter. This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-fast-mean-filter\fR \fI\fR Regional mean filter (fast, linear time implementation). This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-variance-filter\fR \fI\fR Regional variance filter. This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-fast-variance-filter\fR \fI\fR Fast (linear-time) regional variance filter. This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-third-moment-filter\fR \fI\fR Regional third moment filter. This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-standard-deviation-filter\fR \fI\fR Regional standard deviation filter. This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-smoothness-filter\fR \fI\fR Regional 'smoothness' filter. This operation takes the filter radius in pixels as the parameter. A single integer defines the kernel radius in all three dimensions. Three comma-separated integers define separate radii for the three dimensions. .TP 5 \fB\-\-gaussian-filter-sigma\fR \fI\fR Filter image with Gaussian kernel. This operation takes a single real-valued parameter, which specifies the kernel coefficient sigma in world units [e.g., mm] as the parameter. .TP 5 \fB\-\-gaussian-filter-fwhm\fR \fI\fR Filter image with Gaussian kernel. This operation takes a single real-valued parameter, which specifies the kernel full width at half maximum in world units [e.g., mm]. .TP 5 \fB\-\-laplace-filter\fR Filter image with edge-enhancing Laplacian kernel. .SS Grid Operations .TP 5 \fB\-\-downsample-select\fR \fI\fR Downsample image by pixel selection using per-axis factors 'Fx,Fy,Fz' or using single factor 'Fxyz' .TP 5 \fB\-\-downsample-average\fR \fI\fR Downsample image by averaging using per-axis factors 'Fx,Fy,Fz' or using single factor 'Fxyz' .TP 5 \fB\-\-resample\fR \fI\fR Resample image to near-isotropic pixels while preserving the image field-of-view. Takes one argument, the target resolution in world units [e.g., mm] .TP 5 \fB\-\-resample-exact\fR \fI\fR Resample image to exactly isotropic pixels of the given resolution while matching the image field-of-view as closely as possible. Takes one argument, the target resolution in world units [e.g., mm] .TP 5 \fB\-\-crop-by-index\fR \fI\fR Crop image to a region specified by a set of six grid index coordinates given as comma-separated integers x0,y0,z0,x1,y1,z1 .TP 5 \fB\-\-crop-by-threshold\fR \fI\fR Crop image to region determined via a given threshold. The resulting image will contain all pixels larger than the given parameter. .TP 5 \fB\-\-crop-by-threshold-write-region\fR \fI\fR Crop image to region determined via a given threshold and write cropping region to standard output. .TP 5 \fB\-\-crop-by-threshold-write-xform\fR \fI\fR Crop image to region determined via a given threshold and write cropping transformation to standard output. .SH AUTHORS Torsten Rohlfing, with contributions from Michael P. Hasak, Greg Jefferis, Calvin R. Maurer, Daniel B. Russakoff, and Yaroslav Halchenko .SH LICENSE http://www.fsf.org/licensing/licenses/gpl.html .SH BUGS Report bugs at http://nitrc.org/projects/cmtk/ .SH 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.