Core Optical, Inc.
FunctionStyle EnumerationIndustrial Strength, Scientific Grade
Specifies the shape style of the apodization window function.

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

public enum FunctionStyle
Members

  Member nameValueDescription
Elliptical0 Specifies an apodization window construction based upon computing elliptical radii.
Squared1 Specifies an apodization window construction based upon computing the outer product.
Remarks

The most widely used apodzation windows are usually only defined for one dimension. As a result there is no "standard" way of synthesizing a particular windowing function in two dimensions from its one-dimensional definition. The most common approach is a "function squared" strategy which computes two vectors containing the window coefficients, one for the window rows and one for the window columns. The outer product of these vectors is then computed, with the resulting matrix containing the 2D window coefficients. This approach is specified by the Squared enum. The resulting window tends to have greater conformation to the image boundaries. Due to the manner in which the window coefficients are generated, only the central vertical and horizontal axes have the "true" apodization window shape.

The second approach is to compute the window coefficients for a given elliptical radius contained within the image boundaries. The resulting window is generally more circular than the previous type, but a larger portion of the data may be lost to the windowing operation. For square images the elliptical window type is fully isotropic. Another benefit to this window type is that all directions manifest the true window function coefficients.

Examples

The following example instantiates a SourceData object with equal rows and columns and a SourceData object with unequal rows and columns. It then assigns all the data channels a value of 1.0f and applies a window function directly to the data channels. Finally, images of the individual channels are generated (as OnlineBitmapSource objects) and assigned to OnlineImage controls to visualize the different shape styles.
using PrecisionImage;
using PrecisionImage.WindowFunctions;

// Instantiate two SourceData objects: 
SourceData dataSource1 = new SourceData(256, 256, 2);
SourceData dataSource2 = new SourceData(256, 512, 2);

// Assign the value of 1.0 to the first SourceData object: 
for(Int32 row = 0; row < dataSource1.Rows; row++)
{
    for(Int32 column = 0; column < dataSource1.Columns; column++)
    {
        dataSource1.SetValue(row, column, 0, 1.0f);
        dataSource1.SetValue(row, column, 1, 1.0f);
    }
}

// Instantiate a new window function: 
HanningWindowFunction windowFunction = new HanningWindowFunction();

// Set the style to squared (default value, shown for illustration):
windowFunction.Style = FunctionStyle.Squared;

// Apply to the first channel:
windowFunction.ApplyWindow(dataSource1, 0);

// Switch the function style to elliptical:
windowFunction.Style = FunctionStyle.Elliptical;

// Apply to second channel of source data object:
windowFunction.ApplyWindow(dataSource1, 1);

// Visualize shape by assigning BitmapSources to two Image controls. Gamma  
// encode the output image to make small values (and the window extent) more visible:
image1.Source = dataSource1.GetChannelImage(GrayBitDepth.EightBit, GammaEncoding.sRGB, 0);
image2.Source = dataSource1.GetChannelImage(GrayBitDepth.EightBit, GammaEncoding.sRGB, 1);

// Assign the value of 1.0 to the second SourceData object: 
for(Int32 row = 0; row < dataSource2.Rows; row++)
{
    for(Int32 column = 0; column < dataSource2.Columns; column++)
    {
        dataSource2.SetValue(row, column, 0, 1.0f);
        dataSource2.SetValue(row, column, 1, 1.0f);
    }
}

// Switch the style back to squared:
windowFunction.Style = FunctionStyle.Squared;

// Apply to the first channel:
windowFunction.ApplyWindow(dataSource2, 0);

// Switch the function style to elliptical:
windowFunction.Style = FunctionStyle.Elliptical;

// Apply to second channel of the source data object:
windowFunction.ApplyWindow(dataSource2, 1);

// Visualize shape by assigning BitmapSources to two Image controls:
image3.Source = dataSource2.GetChannelImage(GrayBitDepth.EightBit, GammaEncoding.sRGB, 0);
image4.Source = dataSource2.GetChannelImage(GrayBitDepth.EightBit, GammaEncoding.sRGB, 1);

The above example generates a figure similar to the following:

See Also