Core Optical, Inc.
BinaryMask Constructor (SourceData, Int32, Single, Boolean, Int32Rect, BinaryMask)Industrial Strength, Scientific Grade
Instantiates a BinaryMask object based on the specified SourceData object and threshold value.

Namespace: PrecisionImage.BinarizationAndMorphology
Assembly: PrecisionImage (in PrecisionImage.dll) Version: (

public BinaryMask(
	SourceData sourceData,
	int channel,
	float threshold,
	bool maskLowerValues,
	Int32Rect regionOfInterest = null,
	BinaryMask binaryMask = null


Type: PrecisionImage SourceData
A SourceData object upon which the BinaryMask is to be based.
Type: OnlineSystem Int32
An OnlineInt32 type indicating the channel containing the data upon which the mask is based.
Type: OnlineSystem Single
A OnlineSingle type indicating the threshold value. The threshold value is inclusive in the mask-building logic and is always unmasked (true).
Type: OnlineSystem Boolean
A OnlineBoolean type indicating whether or not values lower than threshold are masked (maskLowerValues = true) or unmasked (maskLowerValues = false).
regionOfInterest (Optional)
Type: OnlineSystem.Windows Int32Rect
An OnlineInt32Rect type indicating the region of interest from which to generate the mask. This parameter is optional and defaults to the entire image.
binaryMask (Optional)
Type: PrecisionImage.BinarizationAndMorphology BinaryMask
A BinaryMask indicating regions in the input sourceData to bypass from the thresholding operation. Bypassed regions are unmasked in the generated output BinaryMask that this returned from this method. This parameter is optional and defaults to null.

OnlineSystem ArgumentNullException Thrown when sourceData is null.
OnlineSystem ArgumentOutOfRangeException Thrown when channel is negative or greater than the number of channels in sourceData.
OnlineSystem ArgumentException Thrown when binaryMask does not have the same dimensions as sourceData.
OnlineSystem ArgumentOutOfRangeException Thrown when regionOfInterest specifies a region not completely contained within the input data.

Use this constructor to generate a BinaryMask based on the specified threshold value. Data above or below the specified threshold can be either masked (false) or unmasked (true) depending on the maskLowerValues parameter.
See Also