Core Optical, Inc.
OutputWindowing GetAutoContrastWindow Method Industrial Strength, Scientific Grade
Returns an OutputWindowing object for the specified channel with min and max clipping values automatically computed for contrast.

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

public static OutputWindowing GetAutoContrastWindow(
	SourceData sourceData,
	int channel,
	float LowSaturationPercent = 0.05f,
	float HighSaturationPercent = 0.05f,
	Int32Rect regionOfInterest = null,
	BinaryMask binaryMask = null
)

Parameters

sourceData
Type: PrecisionImage SourceData
A SourceData object for which the output windowing will be generated.
channel
Type: OnlineSystem Int32
An OnlineInt32 type indicating the channel from which the windowing values are computed.
LowSaturationPercent (Optional)
Type: OnlineSystem Single
A OnlineSingle value indicating the percentage of total pixels - at the low end of the histogram - to compute the minimum clipping value from. This parameter is optional and defaults to 0.05 (%).
HighSaturationPercent (Optional)
Type: OnlineSystem Single
A OnlineSingle value indicating the percentage of total pixels - at the upper end of the histogram - to compute the minimum clipping value from. This parameter is optional and defaults to 0.05 (%).
regionOfInterest (Optional)
Type: OnlineSystem.Windows Int32Rect
An OnlineInt32Rect type indicating the region of interest from which to compute the auto-contrast clipping points. This parameter is optional and defaults to the entire image.
binaryMask (Optional)
Type: PrecisionImage.BinarizationAndMorphology BinaryMask
An optional BinaryMask object used to specify the region for which the optimum window leveling values are to be determined. This parameter is optional and defaults to the entire image.

Return Value

An OutputWindowing object associating the computed minimum and maximum clipping values with the specified data channel.
Exceptions

ExceptionCondition
OnlineSystem ArgumentNullException Thrown when sourceData is null.
OnlineSystem ArgumentOutOfRangeException Thrown when channel specifies a channel that doesn't exist or when either LowSaturationPercent or HighSaturationPercent fall outside of the range of 0 - 100.
OnlineSystem ArgumentException Thrown when the sum of LowSaturationPercent and HighSaturationPercent exceeds or equals 100.
OnlineSystem ArgumentOutOfRangeException Thrown when regionOfInterest specifies an invalid region relative to the sourceData dimensions.
OnlineSystem ArgumentOutOfRangeException Thrown when the dimensions of binaryMask do not match those of sourceData.
Remarks

Use this method to retrieve an OutputWindowing object initialized with automatically-generated clipping values. The values are computed according to the specified pixel percentages. These correspond to the population, in percent, of pixels that are clipped at the low end and the high end. The default values are 0.5%. This method is useful for generating an OutputWindowing object for source data that may contain outlying values that would otherwise suppress the effective grayscale mapping of the data.
See Also