Provided by: cmtk_3.2.2-1.4_amd64

**NAME**

imagemath - Image operations

**DESCRIPTION**

Perform operations on images using stack-based postfix notation. Images can be read from files and pushed onto the stack. Images on the stack can be processed and combined via different operators. Results of all operations are put back onto the stack, where they can be further processed or written back to image files.

**OPTIONS**

GlobalToolkitOptions(thesearesharedbyallCMTKtools)--helpWrite list of basic command line options to standard output.--help-allWrite complete list of basic and advanced command line options to standard output.--wikiWrite list of command line options to standard output in MediaWiki markup.--manWrite man page source in 'nroff' markup to standard output.--versionWrite toolkit version to standard output.--echoWrite the current command line to standard output.--verbose-level<integer>Set verbosity level.--verbose,-vIncrement verbosity level by 1 (deprecated; supported for backward compatibility).--threads<integer>Set maximum number of parallel threads (for POSIX threads and OpenMP).Input/outputoperations--in<string-vector>Read input image(s) to top of stack--out<string>Write output image from top of stack (but leave it on the stack)--set-padding-value<double>Set the value that is interpreted as padding value in subsequently read images.--unset-paddingDisable padding. All values in subsequently read images will be interpreted as actual data.Internalsettings--floatUse single precision for computations and results[Thisisthedefault]--doubleUse double precision for computations and resultsStackoperations--popPop (discard) top image from stack.--dupDuplicate image on top of the stack.--allApply next single-image operation to all images on the stack.Single-imageoperators--fill<double>Fill top image with constant value (i.e., assign value to all pixels)--absApply abs() function to top image--logApply log() function to top image--logitApply log(x/(1-x)) function to top image--logisticApply 1/(1+exp(-x)) function to top image--expApply exp() function to top image--sqrApply square operator to top image--sqrtApply square root operator to top image--truncTruncate all values in top image to integer--one-overFor each pixel, replace its value x with 1.0/x--scalar-mul<double>Multiply top image with a scalar value--scalar-add<double>Add a scalar to each pixel of the top image--scalar-xor<integer>Bitwise exclusive-or between top level and given scalar value--scalar-and<integer>Bitwise and operation between top level and given scalar value--thresh-below<double>Set values below given threshold to threshold.--thresh-above<double>Set values above given threshold to threshold.Imagepairoperators--addAdd top and second image, place result on stack--mulMultiply top and second image, place result on stack--divDivide top image by second image, place result on stack--atan2Compute atan2() function from tup two image pixel pairs, place result on stack--match-histogramsScale intensities in one image to match intensities of another. The last image pushed onto the stack provides the reference intensity distribution, the preceding image will be modified. Both input images are removed from the stack and the modified image is pushed onto the stack.--match-mean-sdevScale intensities of one image to match mean and standard deviation of another. The last image pushed onto the stack provides the reference intensity distribution, the preceding image will be modified. Both input images are removed from the stack and the modified image is pushed onto the stack.--match-mean-sdev3Scale intensities of an image by a factor and offset computed from two other images to match their mean and standard deviations. The last image pushed onto the stack provides the reference intensity distribution, the preceding image provides the intensity distribution to match to the reference image's, and the third image on the stack will be modified. All three input images are removed from the stack and the modified image is pushed onto the stack.--mask-averageMask averaging: the top image is taken as a multi-label mask. The pixels in the second image are averaged by mask labels, and then replaced with the average value for each mask label.ComplexArithmetic--complex-divComplex division, (a+ib)/(c+id), assuming four values were put on the stack in order a, b, c, d. Place result on stack, real first, imaginary second (i.e., imaginary is top).Operatorsthatcontracttheentirestackintoasingleimage--sumSum all images on stack, place result on stack--productCompute product of all images on stack, place result on stack--averageAverage all images on stack, place result on stack--varianceFor each pixel, compute variance over all images on stack, place result on stack--combine-pcaCombine images using PCA by projecting onto direction of largest correlation--max-valueFor each pixel, compute maximum VALUE over all images, place result on stack--min-valueFor each pixel, compute minimum VALUE over all images, place result on stack--max-indexFor each pixel, compute INDEX of image with maximum value, place result on stackOperatorsthatcontractastackoflabelimagesintoasinglelabelimage--voteMerge all images on stack with voting, place result on stack--staple<integer>Combine binary maps on the stack using [arg] iterations of the STAPLE algorithm. The result of this operation is the spatial map of 'weights' W, which are the probabilities of image foreground at each pixel. In 'verbose' mode, estimated expert parameters p (sensitivity) and q (specificity) are also written to standard output.--contract-labelsContract multiple label maps into one by selecting the first (over all images on the stack) non-zero label at each pixel--mstaple<integer>Combine multi-label maps on the stack using [arg] iterations of the multi-class STAPLE algorithm.The result of this operation is the combined maximum-likeliood multi-label map.--mstaple-disputed<integer>Like previous operation, apply multi-class STAPLE algorithm, but restrict computation to 'disputed'voxels, i.e., those where the input label maps disagree. This often improves results by reducing, e.g., background effects.--stack-entropy-labelsCompute stack entropy at each pixel from integer (label) input images

**AUTHORS**

Torsten Rohlfing, with contributions from Michael P. Hasak, Greg Jefferis, Calvin R. Maurer, Daniel B. Russakoff, and Yaroslav Halchenko

**LICENSE**

http://www.fsf.org/licensing/licenses/gpl.html

**BUGS**

Report bugs at http://nitrc.org/projects/cmtk/

**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.