Skip to content, Skip to search

Changes

MorphoLibJ

785 bytes added, 01:46, 4 September 2019
Update latest release info
| source = {{GitHub|org=ijpb|repo=MorphoLibJ}}
| released = July 3<sup>rd</sup>, 2014
| latest version = October July 23<sup>rd</sup>, 2018 2019 ([[MorphoLibJ]] v1.4.01)
| status = stable, active
| category = [[:Category:Analysis|Analysis]], [[:Category:Filtering|Filtering]], [[:Category:Segmentation|Segmentation]], [[:Category:Mathematical_morphology|Mathematical morphology]]
== Measurements ==
[[MorphoLibJ]] contains several tools for quantifying the size, the shape, or the spatial organization, from '''binary or label''' 2D and 3D images. The aim is to facilitate the management of label images, contrary to the built-in “Analyze Particles...” function that operates directly on a grayscale image.
=== Particle Region analysis ===This section describes the methods implemented in MorphoLibJ for describing individual particlesregions, represented as label images (one label for each particleregion). We first define and describe the implemented features, then we present the plugins that integrate them.
==== Intrinsic volumes ====
[[Image:MorphoLibJ-Euler-number.png|thumb|400px|Illustration of Euler Number definition. Left: three particles with Euler numbers equal to 1, 0 and -1, respectively. Right: example of a 3D particle with an Euler number equal to -1, corresponding to the subtraction of 1 connected components minus two handles.]]The intrinsic volumes are a set of features with interesting mathematical properties that are commonly used for describing individual particles as well as binary microstructrues. In the planar case, they correspond to the area, the perimeter and the Euler number. The Euler number is a topological characteristic that equals the number of connected components minus the number of holes.
* '''x2, y2''': coordinates of another geodesic extremity of the particle.
===== Particle Region Analysis 3D =====The plugin calculating these measurements is found under {{bc | Plugins | MorphoLibJ | Analyze | Particle Region Analysis 3D}}. The results are provided in an ImageJ Results table, whose name contains the name of the original image.
* '''Label''': the label of the particle measured on the current line (it can be different from the row number if some labels do no exist in original image).
:<math>TO=\frac{\sum_{r}{|S_{r}\cap T_{r}|}}{\sum_{r}{|T_{r}|}}</math>
* [https://en.wikipedia.org/wiki/Jaccard_index Jaccard Index] or Union Overlap for each individual labeled region <math>r</math>:
:<math>UO_{r}=2\frac{|S_{r}\cap T_{r}|}{|S_{r}\cup T_{r}|}</math>
* [https://en.wikipedia.org/wiki/Jaccard_index Jaccard Index] or Union Overlap for all regions:
:<math>UO=2\frac{\sum_{r}|S_{r}\cap T_{r}|}{\sum_{r}|S_{r}\cup T_{r}|}</math>
* [https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient Dice Coefficient] or Mean Overlap for each individual labeled region <math>r</math>:
:<math>MO_{r}=2\frac{|S_{r}\cap T_{r}|}{|S_{r}|+|T_{r}|}</math>
<source lang="java">
// #@ImagePlus (label="Input image",description="Image to segment") imp// #@ Integer(label="Gradient radius",description="Radius of the morphological gradient",value=2) radius#@ Integer(label="Tolerance",description="Local extrema dynamic",value=3) tolerance#@ String(label="Connectivity",description="Local connectivity", choices={"6","26"}) strConn#@ Boolean(label="Calculate dams",description="Flag to use dams in watershed",value=true) dams#@OUTPUT ImagePlus resultImage
// ImageJ imports
import ij.IJ;
import inra.ijpb.morphology.Strel3D;
import inra.ijpb.watershed.Watershed;
import inra.ijpb.data.image.Images3D; // convert connectivity string to intconn = Integer.parseInt( strConn ); image = null;if( radius != 0 ){ // create structuring element (cube of radius 1'radius') strel = Strel3D.Shape.CUBE.fromRadius( 1 radius ); // apply morphological gradient to input image image = Morphology.gradient( imp.getImageStack(), strel ); }else image = imp.getImageStack();// find regional minima on gradient image with dynamic value of 30 'tolerance' and 6'conn'-connectivityregionalMinima = MinimaAndMaxima3D.extendedMinima( image, 30tolerance, 6 conn );
// impose minima on gradient image
imposedMinima = MinimaAndMaxima3D.imposeMinima( image, regionalMinima, 6 conn );
// label minima using connected components (32-bit output)
labeledMinima = BinaryImages.componentsLabeling( regionalMinima, 6conn, 32 );
// apply marker-based watershed using the labeled minima on the minima-imposed
// gradient image (the "true" last value indicates the use of dams in the output)resultStack = Watershed.computeWatershed( imposedMinima, labeledMinima, 6conn, true dams );
// create image with watershed result
resultImage = new ImagePlus( "watershed", resultStack );
// assign right calibration
resultImage.setCalibration( imp.getCalibration() );
// optimize display range
Images3D.optimizeDisplayRange( resultImage );
// set same slice as input
resultImage.setSlice( imp.getCurrentSlice() );
</source>
<source lang="java">
// #@ImagePlus imp
import inra.ijpb.label.LabelImages;
Emailconfirmed, incoming, administrator, uploaders
2,587
edits