Core Optical, Inc.
SourceData GetChannelImageArray Method (GrayBitDepth, Int32, BinaryMask, GammaEncoding, OutputWindowing, OutputWindowing, Int32Rect)Industrial Strength, Scientific Grade
Retrieves an array of pixel values portraying the source data. Array is either Byte or UInt16.

Namespace: PrecisionImage
Assembly: PrecisionImage (in PrecisionImage.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax

public Array GetChannelImageArray(
	GrayBitDepth outputBitDepth,
	int channel,
	BinaryMask binaryMask,
	GammaEncoding gammaEncoding = GammaEncoding.None,
	OutputWindowing unmaskedWindowing = null,
	OutputWindowing maskedWindowing = null,
	Int32Rect regionOfInterest = null
)

Parameters

outputBitDepth
Type: PrecisionImage GrayBitDepth
A GrayBitDepth type indicating the type of grayscale mapping to perform.
channel
Type: OnlineSystem Int32
An OnlineInt32 indicating the channel of interest in the current SourceData object.
binaryMask
Type: PrecisionImage.BinarizationAndMorphology BinaryMask
A BinaryMask type specifying a mask indicating areas of the image to mask-out.
gammaEncoding (Optional)
Type: PrecisionImage GammaEncoding
A GammaEncoding enumeration indicating whether or not to gamma encode the grayscale mapping. Default value is GammaEncoding.None.
unmaskedWindowing (Optional)
Type: PrecisionImage.Visualization OutputWindowing
A OutputWindowing type that contains the minimum and maximum clipping values for linear mapping of unmasked data. This parameter is optional. Default values are the current minimum and maximum values in the SourceData object.
maskedWindowing (Optional)
Type: PrecisionImage.Visualization OutputWindowing
A OutputWindowing type that contains the minimum and maximum clipping values for linear mapping of masked data. This parameter is optional. Default values are the current minimum and maximum values in the SourceData object.
regionOfInterest (Optional)
Type: OnlineSystem.Windows Int32Rect
A OnlineInt32Rect indicating the zero-based row and column coordinates of the region to process. This parameter is optional. Default is the entire data image.

Return Value

A OnlineArray containing the output pixel values. Cast as Byte, UInt16 or Single to retrieve pixel values.
Exceptions

ExceptionCondition
OnlineSystem ArgumentOutOfRangeException Thrown when channel is negative or greater than the current number of data channels.
OnlineSystem ArgumentOutOfRangeException Thrown when regionOfInterest specifies a rectangular region not completely contained within the dimensions of the source data.
OnlineSystem ArgumentNullException Thrown when binaryMask is null.
OnlineSystem ArgumentOutOfRangeException Thrown when binaryMask does not contain a number of rows and columns equal to the current SourceData object.
Remarks

Use this method to independently visualize and contrast stretch masked and unmasked data within the specified channel of the current SourceData object while avoiding the overhead of OnlineBitmapSource instantiation. This method allows for the application of a binary mask to screen out regions of the source data. In addition, it takes two OutputWindowing object parameters to allow for different degrees of contrast stretching in the masked and unmasked regions. Finally, regionOfInterest allows for this processing to be applied to a selected region of the data. The resulting OnlineArray object is returned as either a Byte or UInt16 array. Cast the OnlineArray to one of these types to retrieve the data-mapped pixel values.

This method is useful when only a certain region of the data needs to be contrast stretched. Use the binaryMask parameter to partition the data into masked and unmasked regions, then use the maskedWindowing and unmaskedWindowing parameters to control the linear mapping range of the masked/unmasked data regions. For interactive implementations, use this method in conjunction with a OnlineWriteableBitmap. The length of the array is equal to the product of the current SourceData rows and columns if no regionOfInterest parameter is specified. Otherwise, the length of the returned array is equal to the product of the regionOfInterest rows and columns. Use the gammaEncoding parameter to gamma-encode the output pixel values in the resulting array if necessary.

See Also