Man Linux: Main Page and Category List

mincmath - perform simple math operations on minc files

mincmath[<options>] <in1>.mnc [<in2>.mnc...] <out>.mnc

Mincmathwill perform simple, voxel-by-voxel math operations, on one or more minc files of the same shape and having the same coordinate sampling, producing a single output file. Operations can be unary (operate on one file), binary (two input files) or cumulative (operate on two or more input files). Cumulative operations can also be performed across a specified dimension of the input files.

Note that options can be specified in abbreviated form (as long as they are unique) and can be given anywhere on the command line.

-2Create a MINC 2.0 format output file.-clobberOverwrite an existing file.-noclobberDon’t overwrite an existing file (default).-no_clobberSynonym for-noclobber.-verbosePrint out progress information for each chunk of data copied (default).-quietDo not print out progress information.-debugPrint out debugging information.-filelistfilenameSpecify a file containing a list of input file names. If "-" is given, then file names are read from the standard input. If this option is given, then there should be no input file names specified on the command line. Empty lines in the input file are ignored.-copy_headerCopy all of the header information from the first input file (default for one input file).-nocopy_headerDo not copy all of the header from the first input file; copy only coordinate information (default for more than one input file).-filetypeCreate an output file with the same type as the first input file (default).-byteStore output voxels in 8-bit integer format.-shortStore output voxels in 16-bit integer format.-intStore output voxels in 32-bit integer format.-longSuperseded by-int.-floatStore output voxels in 32-bit floating point format.-doubleStore output voxels in 64-bit floating point format.-signedUse signed, two’s complement integer format. Applies only if the output voxel type is specified to be an integer type (one of-byte,-short,-intor-long).-unsignedUse unsigned integer format. Applies only if the output voxel type is specified to be an integer type (one of-byte,-short,-intor-long).-rangeminmaxRestrict the valid range of integer data. Applies only if one of the-byte,-short,-intor-longoptions is specified.-max_buffer_size_in_kbsizeSpecify the maximum size of the internal buffers (in kbytes). Default is 4096 (4MB).-dimensiondimnameSpecify a dimension along which we wish to perform a cumulative operation.-check_dimensionsCheck that all input files have matching sampling in world dimensions (default).-nocheck_dimensionsIgnore any differences in world dimensions sampling for input files .-propagate_nanInvalid data (Not-A-Number or NaN) at a voxel in any of the input files will produce invalid data in the output file at that voxel (default).-ignore_nanFor cumulative operations, invalid data (NaN) in an input file is ignored, ie. treated as though it is not present.-nanWhen an illegal operation is attempted at a voxel (such as divide by zero), invalid data (NaN) is stored in the output file (default). Having no valid input data for a cumulative operation is also considered an illegal operation when-ignore_nanis used.-zeroWhen an illegal operation is attempted at a voxel (such as divide by zero), value zero is stored in the output file.-illegal_valuevalueWhen an illegal operation is attempted at a voxel (such as divide by zero), the specified value is stored in the output file.

-constantvalueSpecify a single constant.-constvalueSynonym for-constant.-const2value1value2Specify two constants.

-addCumulatively add two or more volumes, or add a volume and a constant.-subSubtract two volumes or a volume minus a constant.-multCumulatively multiply two or more volumes, or multiply a volume and a constant.-divDivide two volumes or a volume divided by a constant.-invertCalculate 1/x at each voxel, where x is the input voxel value. If a constant c is specified (with -constant), then calculate c/x at each voxel.-sqrtCalculate the square root of a volume.-squareCalculate the square of a volume.-absCalculate the absolute value of a volume.-maximumCalculate the maximum of a series of volumes.-minimumCalculate the minimum of a series of volumes.-expCalculatec2*exp(c1*x)at each voxel of a volume, wherexis the voxel value andc1andc2are constants specified by-constantc1or-const2c1c2. The default value for these constants is 1.0.-logCalculatelog(x/c2)/c1for each voxel of a volume, wherexis the voxel value andc1andc2are constants specified by-constantc1or-const2c1c2. The default value for these constants is 1.0.-scaleScale a volume either by multiplying by a single constant (use -constant) or by multiplying by the first constant and adding the second (use -const2).-clampClamp a volume to lie between two values specified with-const2.-segmentSegment (binarize) a volume so that values within the range specified by-const2give value 1 and those outside it give value 0.-nsegmentOpposite of-segment: values within the range specified by-const2give value 0 and those outside it give value 1.-percentdiffCalculate the percent difference between two volumes (normalized to the first volume). If the first volume is less than a threshold (or zero), then the value specified by-nanor-zerois used. The threshold is specified using-constant, with a default of zero.-pdSynonym for-percentdiff.-eqTest for equality of two volumes or a volume and a constant. Values are rounded to the nearest integer before performing the test. Output 1 for true and 0 for false at each voxel.-neTest for inequality of two volumes or a volume and a constant. Values are rounded to the nearest integer before performing the test. Output 1 for true and 0 for false at each voxel.-gtTest for volume 1 > volume 2 or a volume > a constant. Output 1 for true and 0 for false at each voxel.-geTest for volume 1 >= volume 2 or a volume >= a constant. Output 1 for true and 0 for false at each voxel.-ltTest for volume 1 < volume 2 or a volume < a constant. Output 1 for true and 0 for false at each voxel.-leTest for volume 1 <= volume 2 or a volume <= a constant. Output 1 for true and 0 for false at each voxel.-andTest for volume 1 && volume 2 or a volume && a constant. Values are rounded to the nearest integer before performing the test. Output 1 for true and 0 for false at each voxel.-orTest for volume 1 || volume 2 or a volume || a constant. Values are rounded to the nearest integer before performing the test. Output 1 for true and 0 for false at each voxel.-notPerform logical negation on a volume: convert non-zero to zero and zero to one. Values are rounded to the nearest integer before the negation.-isnanTest a volume for invalid values (NaN). Output 1 for invalid values and 0 for valid values.-nisnanOpposite of -isnan. Output 0 for invalid values and 1 for valid values.-count_validCount the number of valid voxels across a series of volumes. If none of the volumes has valid data, then zero is written out (ie.-zeroand-ignore_nanare always assumed, unlike other cumulative operations).

-helpPrint summary of command-line options and exit.-versionPrint the program’s version number and exit.

Peter Neelin

Copyright © 1995 by Peter Neelin

minccalc(1) $Date: 2004-05-20 21:52:08 $