Blog

Using the Interactive Watershed Transform
September 22, 2009

Given all the previous research work to separate bones in CT scans, we decided to give some of the techniques a whirl. We showed in our previous post our results using the c-plane and sheetness techniques. Here we discuss our implementation of the Interactive Watershed Transform (IWT).

This algorithm, based on the watershed segmentation algorithm, was developed by Hahn et al. and is very well described in Hahn's Ph.D. thesis, available here. The idea behind the watershed segmentation is to consider the gray levels of the image as a height field, and imagine placing a drop of water onto each pixel. The water will follow the terrain slope until it reaches the bottom of a valley. The segmentation is done by grouping pixels whose water drop end up in the same basin--that is, those that belong in the same watershed.

The idea just described of following the terrain slope is one method of implementing the watershed algorithm. A second way is to "flood" the image terrain with water starting at the lowest point. As the water rises, new basins will begin to flood and watersheds will merge. The user can control at what point to stop the flooding and thus where to end the segmentation.

One of the main drawbacks of the watershed segmentation algorithm is that it tends to over segment the image, creating many small basins that do not correspond to image features. A solution for this is to pre-flood the image in order to merge some of these smaller basins together, especially those which are separated by a low-height watershed line. Also, given a segmented image, the user can request certain basins to be merged, thus obtaining the segmentation he or she wants.

The insight behind the Interactive Watershed Transform is to cache the basin creation and basin merging events of the flooding algorithm so that the entire segmentation can be replayed interactively. Combined with pre-flooding and user selection of associated basins, this becomes a powerful segmentation pipeline. It is not a fully automated procedure, but it lets the computer do the hard computation while the human user interactively guides the segmentation process to obtain the results he or she needs.

Hahn describes a procedure for using the IWT to separate the carpal bones. First, the image is inverted so that the brightest pixels, corresponding to the bone, become the darkest, thus becoming the basins for the watershed segmentation. The user then uses an interactive IWT to select the basins corresponding to the bone he or she wants. This segmentation does not lead to the accurate bone boundaries that are obtained via thresholding. In the final step, Hahn combines the thresholded image and the IWT segmented image using a logical AND operation to obtain the final result.

Talus merged with 
surrounding bones Talus merged with
surrounding bones

We decided to test the IWT segmentation algorithm to separate the ankle bones of the Visible Female dataset. As can be seen in the images above, the talus (ankle) bone is attached to the tibia (shin) bone on the top (superiorly), the calcaneus (heel) bone in the rear (posteriorly), and the navicular bone to the front (anteriorly).

We implemented the IWT procedure using MeVisLab, a very versatile program for processing and visualizing medical images. It combines the versatility of the Insight Toolkit (ITK) and the Visualization Toolkit (VTK) with the scene management capabilities of Open Inventor. MeVisLab also provides its own image processing pipeline, is easily expandable by writing custom nodes, and is scriptable. The codebase is actively developed and a slightly restricted version of the program is available for non-commercial use.

basic pipeline

We wrote a number of custom nodes to do the job. The basic pipeline is shown in the image above. The IWT algorithm was encapsulated into two nodes (with really long, self-descriptive names). The IWTProcessor computes all the basin creation and merging records, while the IWTBuilder takes as further input the basin markers provided by the user interactively. The output from the IWTBuilder is combined with the thresholded input image (at the "Bone Selector") before it is sent on to the output.

This entire network was then encapsulated in a single macro node (a node with an inner node network) so that a custom user interface could be built. Among the controls provided by the interface is a selector for the currently viewed slice, the pre-flooding height, and the ability to place markers in an image. There are four views of the image in the user interface. From left to right, top to bottom, they are:

  1. the original image,
  2. a visualization of the watershed basins,
  3. the thresholded image, and
  4. the final output image.

The interface in action is shown in the video below. The IWT algorithm is only applied to a small region of interest surrounding the talus bone. The user first searches for a slice where the talus bone is clearly discernible, the increases the pre-flooding value until most of the image basins have merged. Then, he places two markers in the basin image. This is enough to fully segment the bone, as he later verifies by looking slowly through all the slices.

(To view this video you will need to enable JavaScript or visit our website.)

The animated images below show the original ankle bones and the segmented talus bone. Note how the talus surface is closed at the articular interfaces. One drawback of this system is that the final image is dependent on thresholding, so it is possible for the final result to have gaps where the bone is thin--this is visible in the talus bone below. Another issue we encountered was the merging of basins corresponding to separate bones, even with the pre-flooding set very low. In such cases, it was impossible to get an accurate segmentation. Other than that, we found the technique very easy to use and provided great results!

(To view this video you will need to enable JavaScript or visit our website.)
(To view this video you will need to enable JavaScript or visit our website.)

Previous | Next