Extraction of 2D Curves using statistical pattern recognition

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 extract the points that are located near the medial line of tubular structures in a 2D image. The image is processed by differential gaussian filters that tune the analysis to a particular scale associated with the expected diameter of the tubular structures.

The example was originally designed for an application in image guided surgery in which it was necessary to extract brain blood vessels from Digitally Substracted Angiograms (DSA).

The images below illustrate the whole purpose of the process. At left, a DSA is used as Input Image. At right, the points detected as belonging to 2D curves are highlighted in red.

Input Image
Output Image
Input Image
Detected 2D Curves

About the GUI
The figure below shows the user interface of this example. It shows buttons for each one of the ITK components used in the extraction process. Blue lines show the flow of image data through the pipeline. The GUI toolkit FLTK http://www.fltk.org is used in this example.

Graphical User Interface
Graphic User Interface using FLTK

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.

How Are 2D Curves Detected?
Differential Geometry properties are used in conjunction with a Pattern Recognition approach in order to identify the points belonging to 2D curves in the image. The process aims to detect ridges in intensity by considering the gray level of the image as a two-dimensional function I(x,y). First, a particular scale is selected in order to apply the process. This scale corresponds to the expected diameter of the tubular structures that we want to extract from the image. In the GUI this scale is selected with the counter labeled "Sigma" and will be translated in to the sigma of the differential gaussian filters applied to the image.

In order to define when a point belongs to the center line of a 2D tube the following criteria are used:

  • The pixel should be dark in the blurred version of the image
  • The pixel should be a ridge in intensity
  • The pixel should be as close as possible to the center of the ridge
In order to determine if a pixel is a ridge in intensity, the Hessian matrix of the image is used as shown in the equation below.

Hessian Matrix of the Intensity function
Hessian Matrix of the Intensity Function

This matrix is computed for each one of the pixels on the image. The maximum eigen values of the Hessian matrix will indicate if a point belongs to a ridge regardless of the ridge orientation. In order to evaluate how close the pixel is to the center of the ridge, the scalar product of the gradient with the eigen vector of the maximum eigen value is computed. Points in the center of the ridge will have this scalar product very close to zero [1].

The application of these three criteria result in three images like the ones presented below:
Blurred Image Maximum Eigen Value Image
Blurred Image
Maximum Hessian Eigen Values
Scalar Product Image
Scalar Product

The ITK filters used to compute these images are the following:
A parametric space is built using the information of these three images. For each pixel a set of three values is constructed by taking the gray level values of the pixel in each of the three images above. The values in the triplet are used as coordinates in a 3D parametric space. Each pixel is then associated with a point in the parametric space. Pixels belonging to tubes are distributed in a particular region of the parametric space as shown in the figure below.

Parametric Space
3D Parametric Space

Points located in the region indicated by the pyramid (in green) are considered to belong to ridges in intensity. The pixels associated with these parametric points are then highlighted in the final output image. The GUI allows the user to shape the acceptance region (the green pyramid) in order to tune the criteria for the kind of tube he may be interested into extract from the image.

The ITK classes used to manage the parametric space are:
  • itk::ImageToParametricSpaceFilter This filter converts three itk::Images into an itk::PointSet representing the population of points in the parametric space.
  • itk::FrustumSpatialFunction This spatial function allows to test if particular points are inside or outside a particular region of space. It is used here to select the itk::Points lying inside the green pyramidal region shown in the previous figure. The selected points are the ones located along the center of tubular structures in the 2D image.
  • itk::InteriorExteriorMeshFilter This filter is used in conjunction with the itk::FrustumSpatialFunction in order to filter the whole population of points in the itk::PointSet that are inside the acceptance region (green pyramid).
  • itk::ParametricSpaceToImageSpaceMeshFilter This filter is used to map the selected parametric points back into image space. This mapping allows to display the highlighted red points on the final output image.
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.


Go to next application.