MINCMATH(1)
π MINCMATH(1) β the mincmath glow-up π
okay bestie, so this is mincmath, and it lives in the MINC User's Guide family, and it is literally the girl who does your math homework but, like, for brain volumes. voxel-by-voxel. no cap. π§ β¨
β¨ NAME β¨
mincmath β perform simple math operations on minc files π
π SYNOPSIS π
mincmath [<options>] <in1>.mnc [<in2>.mnc...] <out>.mnc
π¦ DESCRIPTION π¦
so mincmath does simple, voxel-by-voxel math operations on one or more minc files that all have the same shape and the same coordinate sampling, and it produces a single output file. iconic behavior, honestly.
the operations can be:
- unary β operate on one file π«Ά
- binary β two input files π
- cumulative β operate on two or more input files π₯
and guess what, cumulative operations can also be performed across a specified dimension of the input files. periodt.
π OPTIONS π
heads up bestie: options can be specified in abbreviated form (as long as they are unique) and can be given anywhere on the command line. the way that's so convenient of her.
πΈ General options πΈ
-2β Create a MINC 2.0 format output file.-clobberβ Overwrite an existing file.-noclobberβ Don't overwrite an existing file (default).-no_clobberβ Synonym for-noclobber.-verboseβ Print out progress information for each chunk of data copied (default).-quietβ Do not print out progress information.-debugβ Print out debugging information.-filelist filenameβ Specify 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_headerβ Copy all of the header information from the first input file (default for one input file).-nocopy_headerβ Do not copy all of the header from the first input file; copy only coordinate information (default for more than one input file).-filetypeβ Create an output file with the same type as the first input file (default).-byteβ Store output voxels in 8-bit integer format.-shortβ Store output voxels in 16-bit integer format.-intβ Store output voxels in 32-bit integer format.-longβ Superseded by-int. (she's retired, leave her be π)-floatβ Store output voxels in 32-bit floating point format.-doubleβ Store output voxels in 64-bit floating point format.-signedβ Use 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).-unsignedβ Use unsigned integer format. Applies only if the output voxel type is specified to be an integer type (one of-byte,-short,-intor-long).-range min maxβ Restrict the valid range of integer data. Applies only if one of the-byte,-short,-intor-longoptions is specified.-max_buffer_size_in_kb sizeβ Specify the maximum size of the internal buffers (in kbytes). Default is4096(4MB).-dimension dimnameβ Specify a dimension along which we wish to perform a cumulative operation.-check_dimensionsβ Check that all input files have matching sampling in world dimensions (default).-nocheck_dimensionsβ Ignore any differences in world dimensions sampling for input files.-propagate_nanβ Invalid 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_nanβ For cumulative operations, invalid data (NaN) in an input file is ignored, ie. treated as though it is not present.-nanβ When 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.-zeroβ When an illegal operation is attempted at a voxel (such as divide by zero), value zero is stored in the output file.-illegal_value valueβ When an illegal operation is attempted at a voxel (such as divide by zero), the specified value is stored in the output file.
π Options for specifying constants π
-constant valueβ Specify a single constant.-const valueβ Synonym for-constant.-const2 value1 value2β Specify two constants.
π Operations π
-addβ Cumulatively add two or more volumes, or add a volume and a constant.-subβ Subtract two volumes or a volume minus a constant.-multβ Cumulatively multiply two or more volumes, or multiply a volume and a constant.-divβ Divide two volumes or a volume divided by a constant.-invertβ Calculate1/xat each voxel, wherexis the input voxel value. If a constantcis specified (with-constant), then calculatec/xat each voxel.-sqrtβ Calculate the square root of a volume.-squareβ Calculate the square of a volume.-absβ Calculate the absolute value of a volume.-maximumβ Calculate the maximum of a series of volumes.-minimumβ Calculate the minimum of a series of volumes.-expβ Calculatec2*exp(c1*x)at each voxel of a volume, wherexis the voxel value andc1andc2are constants specified by-constant c1or-const2 c1 c2. The default value for these constants is1.0.-logβ Calculatelog(x/c2)/c1for each voxel of a volume, wherexis the voxel value andc1andc2are constants specified by-constant c1or-const2 c1 c2. The default value for these constants is1.0.-scaleβ Scale a volume either by multiplying by a single constant (use-constant) or by multiplying by the first constant and adding the second (use-const2).-clampβ Clamp a volume to lie between two values specified with-const2.-segmentβ Segment (binarize) a volume so that values within the range specified by-const2give value1and those outside it give value0.-nsegmentβ Opposite of-segment: values within the range specified by-const2give value0and those outside it give value1.-percentdiffβ Calculate 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.-pdβ Synonym for-percentdiff.-eqβ Test for equality of two volumes or a volume and a constant. Values are rounded to the nearest integer before performing the test. Output1for true and0for false at each voxel.-neβ Test for inequality of two volumes or a volume and a constant. Values are rounded to the nearest integer before performing the test. Output1for true and0for false at each voxel.-gtβ Test for volume 1 > volume 2 or a volume > a constant. Output1for true and0for false at each voxel.-geβ Test for volume 1 >= volume 2 or a volume >= a constant. Output1for true and0for false at each voxel.-ltβ Test for volume 1 < volume 2 or a volume < a constant. Output1for true and0for false at each voxel.-leβ Test for volume 1 <= volume 2 or a volume <= a constant. Output1for true and0for false at each voxel.-andβ Test for volume 1 && volume 2 or a volume && a constant. Values are rounded to the nearest integer before performing the test. Output1for true and0for false at each voxel.-orβ Test for volume 1 || volume 2 or a volume || a constant. Values are rounded to the nearest integer before performing the test. Output1for true and0for false at each voxel.-notβ Perform logical negation on a volume: convert non-zero to zero and zero to one. Values are rounded to the nearest integer before the negation.-isnanβ Test a volume for invalid values (NaN). Output1for invalid values and0for valid values.-nisnanβ Opposite of-isnan. Output0for invalid values and1for valid values.-count_validβ Count 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).
π Generic options for all commands π
-helpβ Print summary of command-line options and exit.-versionβ Print the program's version number and exit.
π AUTHOR π
Peter Neelin β the og, the blueprint, we love her π
π«Ά COPYRIGHTS π«Ά
Copyright Β© 1995 by Peter Neelin
π SEE ALSO π
and that's the whole page bestie, mwah π she's dated $Date: 2004-05-20 21:52:08 $, straight from the MINC User's Guide, so go do some math on your volumes and slay π
β¨
π¦ where this page comes from
- debian bookworm: minc-tools 2.3.00+dfsg-10 Β· as_is
- debian trixie: minc-tools 2.3.00+dfsg-12 Β· as_is
- nixpkgs unstable: minc-tools 2.3.06-unstable-2024-11-28
- ubuntu jammy: minc-tools 2.3.00+dfsg-8 Β· as_is
- ubuntu noble: minc-tools 2.3.00+dfsg-10build2 Β· as_is
- ubuntu questing: minc-tools 2.3.00+dfsg-12
- ubuntu resolute: minc-tools 2.3.00+dfsg-15 Β· NTP
- ubuntu stonking: minc-tools 2.3.00+dfsg-17 Β· NTP
- Copyright 1995 Peter Neelin, McConnell Brain Imaging Centre
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms