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

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

public Array GetChannelImageArray(
	GrayBitDepth outputBitDepth,
	int channel,
	GammaEncoding gammaEncoding = GammaEncoding.None,
	OutputWindowing outputWindowing = 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.
gammaEncoding (Optional)
Type: PrecisionImage GammaEncoding
A GammaEncoding enumeration indicating whether or not to gamma encode the grayscale mapping. Default value is GammaEncoding.None.
outputWindowing (Optional)
Type: PrecisionImage.Visualization OutputWindowing
A OutputWindowing type that contains the minimum and maximum clipping values for linear mapping of 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.

Return Value

An 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.
Remarks

Use this method to visualize the data in the current SourceData object. This method returns a OnlineArray and when used in conjunction with OnlineWriteableBitmap (or some other type) avoids the overhead of generating a new OnlineBitmapSource image.

The type of array returned is either Byte, UInt16 or Single, depending on the outputBitDepth parameter. Specifying EightBit for outputBitDepth will return an array of type OnlineByte. Specifying SixteenBit will return an array of type OnlineUInt16. Specifying ThirtyTwoBit will return an array of type OnlineSingle. Cast the return OnlineArray object to the appropriate type (based on outputBitDepth) to retrieve the pixel values. The length of the returned array is equal to the product of the current SourceData rows and columns if no region of interest is specified. Otherwise the array length is equal to the product of the rows and columns in the regionOfInterest object parameter.

The outputWindowing parameter allows for contrast stretching (windowing) of the values when mapping to the output pixel range. Not specifying an OutputWindowing causes the portrayal of the data to be linearly scaled between its current minimum and maximum values.

See Also