|Morphological Segmentation (IJPB-plugins)|
|Author||Ignacio Arganda-Carreras, David Legland|
|Initial release||July 3rd, 2014|
|Latest version||November 26th, 2015 (MorphoLibJ v1.1.0)|
|Development status||stable, active|
|Category||Segmentation, Mathematical morphology|
Morphological Segmentation runs on any open grayscale image, single 2D image or (3D) stack. If no image is open when calling the plugin, an Open dialog will pop up.
The user can pan, zoom in and out, or scroll between slices (if the input image is a stack) in the main canvas as if it were any other ImageJ window. On the left side of the canvas there are three panels of parameters, one for the input image, one with the watershed parameters and one for the output options. All buttons, checkboxes and input panels contain a short explanation of their functionality that is displayed when the cursor lingers over them.
Image pre-processing: some pre-processing is included in the plugin to facilitate the segmentation task. However, other pre-preprocessing may be required depending on the input image. It is up to the user to decide what filtering may be most appropriate upstream.
Input Image panel
You should select:
- Border Image: if your input image has highlighted object boundaries.
- Object Image: if the borders of the objects do not have higher intensity values than the rest of voxels in the image.
When selecting “Object Image”, an additional set of options is enabled to choose the type of gradient and radius (in pixels) to apply to the input image before starting the morphological operations. Finally, a checkbox allows displaying the gradient image instead of the input image in the main canvas of the plugin (only after running the watershed segmentation).
Watershed Segmentation panel
- Tolerance: dynamic of intensity for the search of regional minima (in the extended-minima transform, which is the regional minima of the H-minima transform, value of h). Increasing the tolerance value reduces the number of segments in the final result, while decreasing its value produces more object splits.
- Calculate dams: un-check this option to produce segmentations without watershed lines.
- Connectivity: voxel connectivity (4-8 in 2D, and 6-26 in 3D). Selecting non-diagonal connectivity (4 or 6) usually provides more rounded objects.
Finally, click on “Run” to launch the segmentation.
If your segmentation is taking too long or you want to stop it for any reason, you can do so by clicking on the same button (which should read “STOP” during that process).
- Display: list of options to display the segmentation results.
- Overlaid basins: colored objects overlaying the input image (with or without dams depending on the selected option in the Watershed Segmentation panel).
- Overlaid dams: overlay the watershed dams in red on top of the input image (only works if “Calculate dams” is checked).
- Catchment basins: colored objects.
- Watershed lines: binary image showing the watershed lines in black and the objects in white (only works if “Calculate dams” is checked).
- Show result overlay: toggle result overlay.
- Create image button: create a new image with the results displayed in the canvas.
Macro language compatibility
Morphological Segmentation is completely compatible with the popular ImageJ macro language. Each of the buttons in the GUI are macro-recordable and their commands can be reproduced later from a simple macro file.
The complete list of commands is as follows:
- Start the plugin:
- Select input image:
// select as object image call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "object"); // select as border image call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "border");
- Run segmentation with specific options:
call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=10", "calculateDams=true", "connectivity=6");
- Toggle result overlay:
- Set option to display gradient image:
- Select display format:
// Overlaid basins call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Overlaid basins"); // Overlaid dams call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Overlaid dams"); // Catchment basins call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Catchment basins"); // Watershed lines call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Watershed lines");
- Create new image with the current result:
Complete macro example:
// load the Blobs sample image run("Blobs (25K)"); // run the plugin run("Morphological Segmentation"); // wait for the plugin to load wait(1000); // select input image as "object" call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "object"); // set gradient radius as 1 call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientRadius", "1"); // run segmentation with tolerance 32, calculating the watershed dams, // 4-connectivity call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=32", "calculateDams=true", "connectivity=4"); // display the overlaid dams call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Overlaid dams");
1) Select from the Fiji menu to start the updater. ›
2) Click on Manage update sites. This brings up a dialog where you can activate additional update sites.
3) Activate the IJPB-plugins update site and close the dialog. Now you should see an additional jar file for download.
4) Click Apply changes and restart Fiji.
You should now find the plugin under the sub-menu . › ›
Note: Morphological Segmentation is only one of the plugins included in the MorphoLibJ library. By following these installation steps, you will be installing as well the rest of plugins in the suite.
- Meyer, Fernand, and Serge Beucher. "Morphological segmentation." Journal of visual communication and image representation 1.1 (1990): 21-46.
- Soille, P., "Morphological Image Analysis: Principles and Applications", Springer-Verlag, 1999, pp. 170-171.
- Marker-controlled Watershed, a plugin to perform watershed by flooding from specific seed points or markers.
- Classic Watershed, plugin implementing the original watershed algorithm to segment 2D/3D grayscale images.
- Serge Beucher's site, with graphic descriptions and animations of the watershed algorithms.
- G. Bertrand's Topological Watershed site, with papers, lecture slides and source code.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/licenses/gpl.txt).
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.