Core Optical, Inc.
OutputWindowing ClassIndustrial Strength, Scientific Grade
Encapsulates the output windowing parameters for the individual SourceData channels.
Inheritance Hierarchy

OnlineSystem Object
  PrecisionImage.Visualization OutputWindowing

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

public class OutputWindowing

The OutputWindowing object is used to specify the scaling parameters for one or more of the SourceData channels. Output images are scaled linearly within the OutputWindowing range (the range being delineated by the min and max clipping associated with the declared channel). Outlier values within the source data (values falling outside of the specified range) are visually clamped to the range limits. The object type allows an arbitrary number of channels and associated windowing parameters to be declared. This allows for output windowing of individual channels to different ranges within multi-channel SourceData objects. The OutputWindowing class is used when reconstructing the OnlineBitmapSource from multichannel sources as well as when generating a OnlineBitmapSource image of individual data channels.


The following illustrates the use of OutputWindowing to scale the generated BitmapSource visualization of a single channel within a multi-channel SourceData object.

using PrecisionImage;
using PrecisionImage.Visualization;

// Load the source image into a BitmapSource object: 
Uri imageUri                  = new Uri("fish.bmp", UriKind.Relative);
BmpBitmapDecoder imageDecoder = new BmpBitmapDecoder(imageUri, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
BitmapSource SourceImage      = imageDecoder.Frames[0];

// Assign the original image to the "image0" Image control for display:
image0.Source = SourceImage;

// Load the image data into a new SourceData object: 
SourceData imageData = new SourceData(SourceImage, GammaEncoding.sRGB);

// Retrieve the red channel (channel 2) as a grayscale image scaled to the original input range (0.0 - 1.0) 
// and associate the result with an Image control for viewing:
image1.Source = imageData.GetChannelImage(GrayBitDepth.EightBit, GammaEncoding.sRGB, 2, new OutputWindowing(0.0f, 1.0f, 2));

// Now visualize the red channel's data, this time linearly scaled to its individual min/max data values using the  
// "GetDefaultOutputWindows" method. (since the resulting object contains scales for all three channels  
// we could repeat this for the other channels to visualize each channel linearly scaled within its individual min  
// and max values (here we only show the red channel):
image2.Source = imageData.GetChannelImage(GrayBitDepth.EightBit, GammaEncoding.sRGB, 2, imageData.GetDefaultOutputWindows());

See Also