Description

One or more thresholds separating phases of the histogram.

Property type

A Variant value.  

Syntax

object.Thresholds([WhichThreshold], [Channel], [Phase], [SourceImage])

The Thresholds Property syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McHistogram.
WhichThresholdOptional. A mcHistWhichThreshold enumeration, as described in settings.

Which threshold the returned value(s) should expose. The default is mchwtBoth, which returns results as DOUBLERANGE, giving both Start and End of the threshold. Values of type double are returned if WhichThreshold is either mchwtStart or mchwtEnd.

ChannelOptional. A Long value.

Default value -1. If non-negative, the Channel index (starting at 0). If negative (the default) then all NumberOfChannels channels are returned (

PhaseOptional. A Long value.

Default value -1. If non-negative, the Phase index (starting at 0). If negative (the default) then all Phases established by a call to the SetThresholdParameters method are returned. If SetThresholdParameters has never been called, the number of phases will be two.

SourceImageOptional. A Variant value.

Source McImage for the computation for global instances of McHistogram (ones with no ancestor McImage). This argument is required for global instances of McHistogram, and it must be missing for McHistogram instances with an image ancestor.

Settings

The settings for WhichThreshold are:

ConstantValueDescription
 mchwtBoth-1

Both thresholds of each pair are returned as a scalar or array of type DOUBLERANGE (a class with Start and End fields)

 mchwtStart0

Only the starting (lower) threshold of each pair is returned as a scalar or array of type double

 mchwtEnd1

Only the ending (upper) threshold of each pair is returned as a scalar or array of type double

Remarks

How the Thresholds property is exposed depends on the WhichThreshold, Channel and Phase arguments, as follows

If WhichThreshold is mchwtBoth values are type DOUBLERANGE, giving both the Start and End for each threshold; if WhichThreshold is mchwtStart or mchwtEnd then values are type double, giving only the Start or End, respectively, of each threshold.

If both Channel and Phase are -1, the default, then a 2-dimensional array of (NumberOfChannels, NumberOfPhases) using VB dimensioning or [NumberOfPhases,NumberOfChannels] using C/C++ dimensioning is returned (that is the Channel dimension is the fastest moving).

If Phase is -1, the default, and Channel a given zero-based channel index, then an array of length-NumberOfPhases is returned.

If Channel is -1, the default, and Phase a given zero-based phase index, then an array of length-NumberOfChannels is returned.

If both Channel and Phase are zero-based indices then a single value is returned giving the WhichThreshold for that phase and channel.

The Compute method is called automatically on the parent IMcImage whenever it is necessary, always if vSourceImg is not empty.

Exceptions

The Channel and Phase must be within legal range.