vnt

Class Basic_Segment

Implemented Interfaces:
PlugInFilter

public class Basic_Segment
extends VascularNetworkToolkit
implements PlugInFilter

Plug-in for ImageJ that attempts to automatically segment vascular cells from the background. Performs a very specific segmentation designed for vascular cells grown on a Matrigel assay.

The method for segmentation is as described in the paper:

The low threshold is selected by the Otsu method:

The high threshold pixels are selected by subtracting 90 from the light-corrected plane at 127, multiplying the result by 4 (leaving the estimated mean at 151. The threshold is set to the mean - std.dev, where the std.dev. is expected to be approximately 30.

Note: At this point in time, the plugin DOES NOT use a rule set to decide if a 4-connected component should be added or not. It simply adds blindly. This may need to be corrected depending on the quality of the result in practice.

Version:
1.0
Author:
Michael Miller - Truman State University
Since:
1.0

Method Summary

boolean
generateSegmented(ImageProcessor low, ImageProcessor high)
"Grows" the low threshold into the high threshold.
ImageProcessor
getHighThreshold(ImageProcessor ip)
Returns the high (overestimate) threshold.
ImageProcessor
getLowThreshold(ImageProcessor ip)
Calculates and returns a low (underestimate) threshold.
void
run(ImageProcessor bp)
Performs specific segmentation designed for vascular cells grown on a Matrigel assay.
int
setup(String arg, ImagePlus ip)
Specifies the preconditions for the plug-in.

Method Details

generateSegmented

public boolean generateSegmented(ImageProcessor low,
                                 ImageProcessor high)
"Grows" the low threshold into the high threshold. Searches iteratively for the 4-connected components. All points in the low (conservative) threshold are added to the search stack. Any pixels from the search stack which are 4-connected to pixels on the high threshold are iteratively added. Any pixel that is processed on the search stack is added to the final segmented image.

Pre: The low threshold and high threshold must have been computed.
Post: On success, a new image with the segmented information is created and displayed. Also, the local member pixel is filled with non-BLACK values. On failure (if a given ImageProcessor is null), no changes are made, and false is returned.

Parameters:
low - The ImageProcessor for the low threshold.
high - The ImageProcessor for the high threshold.
Returns:
Returns true on success, false otherwise.

getHighThreshold

public ImageProcessor getHighThreshold(ImageProcessor ip)
Returns the high (overestimate) threshold. This method operates on the basis that the lighting correction algorithm leveled the background to an estimated average of 127. As a result, a simple way to enhance the contrast is to: 1) Subtract 90 from the image. (Vessels are now 0-10.. the hardest to see are 20~30) 2) Multiply by 4 (The estimated average is now 148~152, vessels are generally between 0-80). 3) Threshold by the mean - std.dev. (std.dev. is expected to be about 30). This is an aggressive threshold that picks up a lot of noise, but it also successfully captures the majority of vessels.

Pre: The dimensions width and height must have been loaded prior to calling this method. The given ImageProcessor must be for the original image and must be valid.
Post: A new image is created containing the high threshold pixels on success. On failure, nothing is created and the method returns null.

Parameters:
ip - The Image Processor is required for the original image data and Histogram information.
Returns:
The ImageProcessor for the newly created image representing the high threshold.

getLowThreshold

public ImageProcessor getLowThreshold(ImageProcessor ip)
Calculates and returns a low (underestimate) threshold. Note: At this time the method fills in a new image. This is for display (and error checking) purposes only and will not be useful in the final release. This method was created entirely with code lifted from OtsuThresholding_.java. Authors: Christopher Mei (christopher.mei at sophia.inria.fr) Anthony Joshua (Anthony.Joshua at utoronto.ca) Tony Collins (tonyc at uhnresearch.ca) http://rsb.info.nih.gov/ij/plugins/otsu-thresholding.html

Pre: The dimensions width and height must have been loaded prior to calling this method. The given ImageProcessor must be for the original image and must be valid.
Post: A new image is created, the Otsu threshold of the original.

Parameters:
ip - The Image Processor is required for the original image data and Histogram information.
Returns:
If there was a problem (such as the given ImageProcessor was invalid), then the method returns null. Otherwise, the ImageProcessor for the low threshold (computed here by the Otsu Threshold method)

run

public void run(ImageProcessor bp)
Performs specific segmentation designed for vascular cells grown on a Matrigel assay. 1) Gets a low and high estimate for thresholding. 2) Fills in the conservative estimate. 3) Uses the conservative estimate to find ("grow") the large aggressive estimate pieces.

Pre: The image was cleared to run by the setup() method.
Post: The image is processed by the segmentation routines. A new segmented binary image is drawn.

Parameters:
bp - Required by the interface. The access information to the original image.

setup

public int setup(String arg,
                 ImagePlus ip)
Specifies the preconditions for the plug-in. If this method succeeds then run() is called.

Pre: ImageJ is running and an 8-bit grayscale image is open. The plug-in was just activated.
Post: Either an argument was processed, the image was not saved to a local folder, or the plug-in is cleared to run on the image.

Parameters:
arg - Required by the interface. The argument list passed to the plug-in.
Returns:
If DONE is returned, ImageJ quits without run()'ing the plug-in. Otherwise, the plug-in signals to ImageJ that this plugin only handles 8-bit (256 grayscale) and will not change the original image.