If the Interpretation property is assigned mctiAnyInterp, then the native image type's number of channels is used to determine how many DOUBLERANGE start,end values need to be computed to fill the IntensityRange property.
If the Interpretation property is the default mctiMonochrome, then an intensity thresholding is done by casting each pixel to a single intensity channel. In this case, the IntensityRange property is assigned only one DOUBLERANGE value, based on a cast to monochrome intensity values.
The other allowed Interpretation values are mctiRGB, mctiHSL and mctiHSI corresponding to the three color channels Red-Green-Blue, Hue-Saturation-Lumiance and Hue-Saturation-Intensity, respectively. In these cases, the IntensityRange property is an array of 3 DOUBLERANGE values, and the automatic IntensityRange detection is based on the image cast to the specified interpetation, while preserving the pixel bit-depth.
The automatic IntensityRange setting calls upon the services of a McThreshold.Histogram object and gets its intensity range results from the Thresholds property. You can set some properties of this McHistogram object to control how the Thresholds are computed (see example):
McThreshold.Histogram.Mode property: you can clear the mchmProcessActiveFrameOnly to have the histogram honor the source McImage.ActiveFrameRange property (as enabled by the McImage.UseActiveFrameRange property). By default, the McThreshold.Histogram.Mode mchmProcessActiveFrameOnly flag is set, so that the IntensityRange is based on the histogram from the source McImage.ActiveFrame. This is the default, because the McThreshold.Execute operation itself always works on only the ActiveFrame.
McThreshold.Histogram.BinCount property: This will determine the resolution of the thresholds detected by histogram-based thresholding methods. The default is 256, so even for high-bit depth integer or floating point image types, the IntensityRange values will be set to within one part in 256 of the source McImage.RangeMin/Max luminance range. For better resolution on high bit depth or floating point images, this value may be increased, at a cost of some increased processing time and memory usage, up to McThreshold.Histogram.MaxBinCount.
McThreshold.Histogram.SetThresholdParameters method: You may call this method to set auto-thresholding method and its parameters. By default, the Method is mchmMinimumVarianceMethod (also known as the method of Otsu) looking for two intensity phases (ranges), with no trimming or saturation rejection at either end of the histogram.
All other McThreshold.Histogram properties are handled by this method, so they should be left alone.