Core Optical, Inc.
Utilities GetMedianValue Method Industrial Strength, Scientific Grade
Returns the median value within the specified channel of the data source.

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

public static float GetMedianValue(
	SourceData sourceData,
	int channel,
	Int32Rect regionOfInterest = null,
	BinaryMask binaryMask = null


Type: PrecisionImage SourceData
A SourceData object containing the data to operate on.
Type: OnlineSystem Int32
An OnlineInt32 type indicating the channel to operate on.
regionOfInterest (Optional)
Type: OnlineSystem.Windows Int32Rect
An OnlineInt32Rect type indicating the region of interest. Coordinates are zero-index based. This parameter is optional and defaults to the entire image.
binaryMask (Optional)
Type: PrecisionImage.BinarizationAndMorphology BinaryMask
A BinaryMask object indicating areas to bypass. Default is no mask.

Return Value

A OnlineSingle type indicating the median value.

OnlineSystem ArgumentNullException Thrown when sourceData is null.
OnlineSystem ArgumentOutOfRangeException Thrown when channel refers to a channel that does not exist in sourceData.
OnlineSystem ArgumentException Thrown when the dimensions of binaryMask do not match those of sourceData.
OnlineSystem ArgumentOutOfRangeException Thrown when regionOfInterest specifies a region not completely contained within the input data.

Use this method to determine the median value within the data source object, or a region of the data source object. If a mask is used and no unmasked values are present within the specified region of interest than a OnlineNaN is returned.
See Also