Man Linux: Main Page and Category List

mincstats - calculate simple statistics across voxels of a minc file

mincstats[<options>] <in1>.mnc

Mincstatswill calculate simple statistical measures across all voxels of a minc file. Note that these are global statistical measures and not voxel-by-voxel measures (seemincaveragefor that). By default all statistics are calculated. If any statistics are requested via a command-line option, then only the requested statistics are printed. A very useful feature of this program is the ability to restrict the set of voxels included in the statistic calculation, either by restricting the range of included values, or by using a mask file with a restricted range. Multiple ranges for the input file or mask file can be specified. For each range of included volume values, and for each range of mask values, the relevant statistics are printed out (n*m values, where n is the number of volume ranges and m the number of mask ranges). These calculations are done in a single pass through the data, so specifying multiple ranges is much faster than running the program repeatedly. This is quite helpful when calculating many regional averages with a VOI mask volume. Special mention should be given to histograms and related statistical measures. The default range of the histogram is from the smallest value in the file to the largest. In the not uncommon, but special, case when the number of histogram bins exactly matches the number of possible values in the file (e.g. 256 bins for full-range byte data), the histogram can end up with some odd features when using the default histogram range. This arises from the discretization of the data that are then rebinned into a slightly mismatched histgram. For the example of byte data, the values that should be used are 256 bins and a histogram range that extends half a bin below the smallest value and half a bin above the largest. Use option-discrete_histogramto work this out automatically, or use-integer_histogramto have bins of unit width if the input data are inherently integer (e.g. label data). In general, one should be careful about the rebinning of discretized data to a histogram with a bin size that is close to the level of discretization.

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

-clobberOverwrite an existing file.-noclobberDon’t overwrite an existing file (default).-verbosePrint out extra information (more than the default).-quietPrint out only the requested numbers-max_buffer_size_in_kbsizeSpecify the maximum size of the internal buffers (in kbytes). Default is 4 MB.

-ignore_nanExclude invalid values (outside valid range) from statistic calculations. This is the default.-include_nanTreat invalid values as zeros and include them in statistic calculations.-replace_nanvalueReplace invalid values with the specified value and include the new value in statistic calculations.

-floormin1,min2,... Comma-separated list of lower bounds for ranges of data to include in statistic calculation.-ceilmax1,max2,... Comma-separated list of upper bounds for ranges of data to include in statistic calculation.-rangemin1,max1,min2,max2,... Comma-separated list of lower and upper bounds for ranges of data to include in statistic calculation.-binvalueval1,val2,... Comma-separated list of integer values to include in statistic calculation. A range of +/- 0.5 is defined around each specified value.-maskfilename.mncName of file to be used for masking data included in statistic calculation. For this to have any effect, you must specify a mask range with one of the following options.-mask_floormin1,min2,...: Like-floor, but applied to the mask file.-mask_ceilmax1,max2,... Like-ceil, but applied to the mask file.-mask_rangemin1,max1,min2,max2,... Like-range, but applied to the mask file.-mask_binvalueval1,val2,... Like-binvalue, but applied to the mask file.

-histogramfilenameSpecify the name of a file into which the histogram is written. If multiple ranges or mask ranges are specified, then all histograms are written in this file, separated by blank lines. Information describing each histogram is written before it in lines starting with the hash (pound) character. These files can be loaded into gnuplot.-hist_binsnumber-of-binsSpecify number of bins in histogram.-binsnumber-of-binsSynonym for-hist_bins.-hist_floorminSpecify lower bound for histogram.-hist_ceilmaxSpecify upper bound for histogram.-hist_rangeminmaxSpecify a range for the histogram-integer_histogramCreate bins of unit width, centred around integer values. This is useful for integer data such as labels. The histogram range is rounded to the nearest integer, then the min is lowered and the max is raised by 0.5. The number of bins is taken as the difference of these two values. Note that 0.01 is added to the minimum and subtracted from the maximum prior to the rounding in order to ensure that a correctly specified range (e.g. [0.5,255.5]) is preserved. If you want to have integer bins that are wider than one, you will have to work out the histogram range and number of bins yourself and not use this option.-discrete_histogramAttempt to match the histogram to the discretization of the input data. This is appropriate for continuous data that are stored in an integer representation and when a bin width close to the discretization is desired. This is similar to-integer_histogram, except that the the histogram range is first converted to voxel values which are rounded and extended by half a bin on either side. This new voxel range is then converted back to real values. The number of bins is taken as the difference in the voxel value range. Note that this does not account for variations in slice-to-slice scaling, so odd histogram effects may still occur. This option is intended to give behaviour similar to that ofvolume_stats.-int_max_binsnumber-of-binsSpecify the largest histogram that can be automatically sized with the above options. The limit prevents accidental creation of huge histograms. This option replaced the old-max_binsoption in MINC 1.1.

-allCompute all statistical measures. This is the default.-noneSynonym for-count(for similarity to volume_stats). Note that although this was necessary forvolume_stats, it is not needed here, since specifying any of these options automatically turns off-all-countCount the number of voxels that are within the range and mask.-percentPrint the percentage of voxels within the range and mask-volumePrint the volume of the voxels within the range and mask (in mm- cubed).-minPrint the minimum value.-maxPrint the maximum value.-sumPrint the sum of all values.-sum2Print the sum of the squares of all values.-meanPrint the mean.-variancePrint the variance.-stddevPrint the standard deviation.-CoMPrint the centre of mass. Both the voxel coordinate and the world coordinates are printed. The voxel coordinates are printed in file order, whilst the world coordinates are printed in x,y,z order.-comSynonym for-CoM.-world_onlyPrint the centre of mass in world coordinates only.

Note that histogram statistics are derived solely from the histogram counts and bin centres, so results such as the median will not be exactly the same as the true value for all included voxels. For example, the error on the median can be as large as a half bin width. Furthermore, if the histogram range is less than that of included voxels, then the result applies only to voxels included in the histogram.-hist_countPrint number of voxels in histogram. This may be different from the number of included and masked voxels if the histogram range is less than the range of the included data.-hist_percentPrint percentage of voxels included in histogram.-medianPrint the histogram median.-majorityPrint the bin centre (intensity value) for the bin with the most counts.-biModalTPrint the bi-modal threshold calculated using the method described in Otsu N, "A Threshold Selection Method from Grey- level Histograms", IEEE Trans on Systems, Man and Cybernetics. 1979, 9:1; 62-66.-pctTPrint the threshold needed for a particular critical percentage of the histogram.-entropyPrint the Shannon entropy. H(x) = - Sum(P(i) * log2(P(i)) where P(i) is the bin probability

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

Andrew Janke

Program: Copyright © 2000 by Andrew Janke Man page: Copyright © 2001 by Peter Neelin $Date: 2004-05-20 21:52:09 $