This method computes parametric statistics on one or more arrays of histogram bin counts or weights and returns one or more BASIC_STATISTICS structures filled with the results. Optionally, each histogram bin can be assigned an associated calibrated value. Bins can be assigned calibrated values individually or by ranges with intermediate bin values being interpolated as necessary. For non-parametric statistics, use the McRankedHistogramValues method.
The HistogramArray argument supplies array(s) of histogram bins which may be either integral counts of bin frequencies or may be floating point weights (e.g., a total area of pixels in a bin) to apply to each bin's calibrated value. In either case, the statistics are based on the bin's calibrated value times the bin count or weight, with the sum of all bin array counts or weights used as the divisor for N. For example, for K bins with K associated binvalues the Mean is computed as SumOverK(bin(i)*binvalue(i))/SumOverK(bin(i)). The sum of all bin counts or weights is returned as the BASIC_STATISTICS.Count result.
When passed a 1-D array of bins, the routine returns a single scalar BASIC_STATISTICS structure with the results of statistics taken on the the source histogram array. When passed a 2-D or higher dimensioned array of bins, then statistics are performed on the fastest moving dimension (the leftmost in VB, the rightmost in C/C++). All histograms in the fastest moving dimension must be the same size (have the same number of bins). The returned result from 2 and higher dimensioned arrays is an array of BASIC_STATISTICS structures, with dimensionality one less than the HistogramArray (i.e., the fastest moving dimension is replaced by the BASIC_STATISTICS results). This case is illustrated in the Examples where all statistics from all three color channel histograms is are computed with a single call to McHistogramStatistics.
The actual statistical computations are standard (see the McBasicStatistics Remarks for a general discussion). For histogram statistics the BASIC_STATISTICS.Count field is the sum of all bin counts or weights; it is not the number of bins. Negative bin counts are treated as zero (have no weight) and ignored without error. The Minimum and Maximum are values associated with the first and last, respectively, bins with non-zero count.
The BASIC_STATISTICS.CountOfMissing field is always zero for McHistogramStatistics, since any bin with a non-zero count is included in the statistics. However, if you use the McVectorHistogram method to create a histogram from an array of Single or Double values, then missing values in those arrays (see McMissingSingle, McMissingDouble, and McIsMissingValue) will be skipped in building the histogram (see Examples).
Other than the McVectorHistogram method, the usual source for histograms is the IQL McHistogram object, which builds histograms based on luminances found within McImage object frames. The McHistogram object exposes most of the statistics computed here and can optionally apply the current McImage.IntensityCalibration to calibrate bin values and the current McImage.SpatialCalibration to weight bin values by pixel area. However, you might want to call McVectorHistogram on the McHistogram.Value property to get Skew, Kurtosis or average absolute deviation from the mean. Or you might wish to get statistics on the histogram after excluding extreme values by setting low and/or high bins to zeros.