E-Snake
Fast parametric active contour for segmenting nearly elliptic objects
This software is also part of the Active Cells plug-in of Icy.
Figure 1. E-Snake before convergence. |
Figure 2. E-Snake after convergence. |
Outline
This software implements an active contour (a.k.a. snake) segmentation method using exponential splines as basis functions to represent the outline of the shape. While the snake is versatile enough to provide a good approximation of any closed curve in the plane, its most important feature is that it perfectly reproduces circular and elliptical shapes. These features are very appropriate to delineate cross sections of cylindrical-like conduits and to outline blob-like objects.
References
Technical Explanations
Among all different possible curve representations, we use a B-spline representation characterized by M control points. As shown in Figures 1 and 2, the M control points (red crosses) define a control polygon (yellow line) that controls the continous representation of the snake (red line).
The evolution of the curve is formulated as a minimization problem. The associated cost function is called snake energy. In our case we make use of a convex combination of contour and region energies, i.e. α Econtour+(1-α) Eregion. The contour energy corresponds to the integral of the projection of the image gradient onto the curve. This energy uses a smoothed version of the input image with a Gaussian kernel of standard deviation α. The region energy maximizes the difference of intensity between the region enclosed by the curve, and the intensity of a region within and elliptical shell.
Software
Java and ImageJ prerequirements
The software provided here is a plug-in for ImageJ, a general purpose image-processing and image-analysis package. ImageJ has a public domain licence; it runs on several plateforms: Unix, Linux, Windows, Mac OS 9 and Mac OS X. It doesn't take more than a couple of minutes to install.
Download and install
Download ESnake.zip, the ImageJ's plug-in. Put the file ESnake.zip in the folder plug-ins of ImageJ and unzip it.
User Manual
Figure 3. E-Snake settings window. |
The plug-in requires at least one open image at launch. All image types are accepted, but the processing will be performed on the luminance channel in the case of RGB Color images. In the case of a RGB Stack or a HSB Stack, the processing will be performed on the current channel instead. In the case of 8-bit Color images, the underlying color indices will be treated as intensity value.
At launch, the settings window will appear (see Figure 3). This windows allows one to determine the maximum number of iterations of the snake optimizer, the number of control points M, the standard deviation of the Gaussian blur σ, and the energy trade-off α. Two drop-down menus determine the target to segment (bright or dark), and the energy type (contour, region or a mixture of both). Two checkboxes determine if the snake is iterated upon convergence, and if the resulting outline is saved in ImageJ's ROI Manager. A quick summary of the input parameters is as follows:
If a ROI is present in the image, the E-Snake will use it as a initialization. Otherwise, the snake is initialized in a circular manner in the center of the image.
The E-Snake can then be manipulated thanks to a revised set of tools from ImageJ's toolbar, which we discuss below. ImageJ's toolbar is restored as soon as the E-Snake dies.
Figure 4. Zooming tool. |
To magnify an image, select the magnification tool and click in the image. To minify an image, use the same tool with the <CNTL> or <ALT> keyboard modifier.
Figure 5. Tool to move points. |
To select a point, click anywhere in the image. The point closest to where you clicked will be highlighted. To move points, drag within the image. The point closest to where you clicked will be moved to the position where you release the mouse. Alternatively, you can use the keyboard arrow keys to get a finer control over the position of the points; for this to work, the image window must be frontmost. Note: it is not possible to interactively move a point outside of the image frame.
To translate the snake all at once, you can also depress the <SHIFT> key before dragging the mouse. Still, a combination of shift and arrow keys will move just one point.
Figure 6. Tool to rescale the curve. |
When this tool is selected, a bounding box appears on the image enclosing the control points of the snake. To move the edges of the bounding box, drag them. The curve will be rescaled accordingly to the new bounding box.
To resize the snake all at once, you can also depress the <SHIFT> key before dragging the mouse.
Figure 7. Tool to rotate the curve. |
When this tool is selected, a bounding box appears on the image enclosing the control points of the snake. To rotate the bounding box, drag it. The curve will be rotated accordingly to the rotated bounding box.
Figure 8. Tool to launch the optimization. |
The 'play' button (a right-pointing black triangle) is used to start optimizing the snake. The <SHIFT> and <ENTER> keys provide convenient shortcuts for this operation; for this to work, the image window must be frontmost. In this mode and during the optimization, the set of tools is modified as follows:
Figure 9. Available tools during snake optimization. |
The 'stop' button (a black square) is used to manually abort the optimization. If hit, the resulting snake will be returned in the state where it achieved the most favorable configuration so far during the course of optimization. If left to its own devices, the snake will converge to some (possibly local) optimum.
There are two possible ways of leaving the E-Snake plug-in and returning to ImageJ:
Figure 10. Tool to leave the E-Snake plug-in and adding the ROI to the ROI Manager. |
This tool is used to gracefully return to ImageJ adding the ROI to the ROI Manager if selected in the settings windows.
Figure 11. Tool to leave the E-Snake plug-in without adding the ROI to the ROI Manager. |
Like the previous one, this tool is used to return to ImageJ, but without adding the ROI to the ROI Manager. This exit tool is available during interaction and optimization as well.
Conditions of use
You'll be free to use this software for research purposes, but you must not transmit and distribute it without our consent. In addition, you undertake to include a citation to the associated papers whenever you present or publish results that are based on it. EPFL makes no warranties of any kind on this software and shall in no event be liable for damages of any kind in connection with the use and exploitation of this technology.
Related Works