Gaussian Filter

This application illustrates the use of the data processing pipeline. In particular it shows how easy is to create complex processes by plugging basic ITK components together. It also shows how to communicate between the ITK layer and a Graphic User Interface (GUI) layer.

What is the Purpose of this Application
The purpose of this application is to apply Gaussian filters to an input image. The filters can compute the equivalent of a convolution between the input image and a gaussian Kernel. The filters in this application perform this process by a method far more efficient than kernel convolution. It is based on the use of a Recursive filter (IIR) that approximates very well the effect of convolving with a Gaussian kernel. A detailed description of the signal processing theory behind this filter can be found on the Report-1893 by R. Deriche at the INRIA web site. Postscript and PDF versions of the report are available.

About the GUI
This application presents a workbench on which an image can be read and different Gaussian filters be applied on it. The use can select the Sigma value to be used for the gaussians. Visual feedback of the execution of the filters is managed by events sent from the Toolkit to the GUI. The GUI for this application uses FLTK which is an open source multi-platform toolkit for GUI development. It can be downloaded from http://www.fltk.org.

The Insight toolkit provides N-Dimensional images and image processing filters. However when it comes to application development it is useful to concentrate the scope of the application to a particular dimension. For this reason two versions of this application are available on the toolkit, one for 2D images and another for 3D images.

The image below shows the graphic interface of the 2D version of the application. the distribution of buttons on the GUI represent the internal connection of filters on the pipeline. Blue lines show the flow of image data through the pipeline. The green bar at the bottom displays the percent of progress for each filter as it runs.

Graphical User Interface
Graphic User Interface using FLTK

The Input of the filter is displayed below along with the result of smoothing with a Gaussian filter.

Input Image Smoothed Image
Input Image
Smoothed Image

The images below illustrate the effect of the Filtering on a simple geometric image. From left to right the image show: Input Image,

Gradient X Gradient Y Gradient Magnitude
Gradient X
Gradient Y
Gradient Magnitude

The following images illustrate from left to right the output of the second derivative along X, the second derivative along Y and the Laplacian that results from adding both.

Second Derivative X Second Derivative Y Laplacian
Second Derivative along X
Second Derivative along Y
Laplacian

The following images illustrate the effect of Sigma on the degree of blurring. From left to right the images show the magnitude of the gradient for sigma values of 3, 5 and 7 respectively. In image analysis applications the value of sigma should be tuned to be on the size range of the object that are being analyzed.

Sigma 3 Sigma 5 Sigma 7
Gradient Magnitude Sigma = 3
Gradient Magnitude Sigma = 5
Gradient Magnitude Sigma = 7

The GaussianFilter 3D Version
The image below shows the graphic interface of the 3D version of the application. the distribution of buttons on the GUI represent the internal connection of filters on the pipeline. Blue lines show the flow of image data through the pipeline. The green bar at the bottom displays the percent of progress for each filter as it runs. Note that a larger number of filters are required in this case. This is done in order to improve the computing time performance of the pipeline at the expense of increasing memory consumption.

Graphical User Interface
Graphic User Interface of the 3D version using FLTK

The following images illustrate the result of the gradient along Y and the magnitude of the gradient on the slice number 34 of a MRI data volume.

Gradient Y
Magnitude
Gradient 3D along Y
Gradient 3D Magnitude

Communications Between ITK and the GUI
Some of the components used in this GUI are available in the Insight/Auxiliary directory. In particular the fltk::LightButton and the fltk::ProgressBar. These components use the ITK mechanism of events based on the Observer/Command design pattern [2]. The basic elements for this mechanism are the ITK classes:

ITK filters invoke "Events" that can be "Observed" by "Command" classes. Typically, events are invoked when a filter is about to start, when the filter has just finished processing its data and when the output of the filter becomes invalid due to changes in the filter parameters. Sequential events are also invoked in order to indicate the filter's percent of progress. The buttons in this GUI change colors according to itk::StartEvent, itk::EndEvent and itk::ModifiedEvent events. The progress bar in the bottom reacts to the itk::ProgressEvent of the filter that is being currently executed.

What ITK Classes Made This Application Possible
The ITK filters used to compute these images are the following:
References
[1] D. Eberly, "Ridges in Image and Data Analysis", Kluwer Academic Publishers, 1996.

[2] E. Gamma, R. Helm, R. Johnson, J. Vlissides, "Design Patterns", Addison Wesley, 1995.

[3] R. Deriche, "Recursively Implementing the Gaussian and its Derivatives",
Research Report 1893 Institut National de Recherche en Informatique et en Automatique (INRIA) 1993.


Go to next application.