public class GeodesicDiameter extends RegionAnalyzer2D<GeodesicDiameter.Result>
Computes geodesic diameter of a set of labeled particles or regions, using an
inner instance of GeodesicDistanceTransform
for propagating chamfer distances.
The result of the algorithm is stored in a collection of
GeodesicDiameter.Result
instances, that returns the diameter,
coordinates of extreme points, and eventually the geodesic path corresponding
to each region.
This version uses optimized algorithm, that propagates distances of all particles during each pass. This reduces computation overhead due to iteration over particles.
Example of use:
GeodesicDiameter algo = new GeodesicDiameter(ChamferWeights.CHESSKNIGHT);
Map<Integer,GeodesicDiameter.Result> geodDiams = algo.process(inputLabelImage);
for (int label : geodDiams.keySet())
{
double diam = geodDiams.get(label).diameter;
System.out.printl(String.format("geod. diam. of label %d is %5.2f", label, diam);
}
GeodesicDiameter3D
,
GeodesicDistanceTransform
,
GeodesicDiameter.Result
,
ChamferMask2D
Modifier and Type | Class and Description |
---|---|
class |
GeodesicDiameter.Result
Inner class used for representing results of geodesic diameters
computations.
|
Constructor and Description |
---|
GeodesicDiameter()
Empty constructor with default settings.
|
GeodesicDiameter(ChamferMask2D mask)
Creates a new geodesic diameter computation operator.
|
GeodesicDiameter(ChamferWeights weights)
Deprecated.
ChamferWeights is replaced by ChamferMask2D (since 1.4.4)
|
GeodesicDiameter(float[] weights)
Deprecated.
|
GeodesicDiameter(GeodesicDistanceTransform gdt)
Creates a new geodesic diameter computation operator.
|
Modifier and Type | Method and Description |
---|---|
Map<Integer,GeodesicDiameter.Result> |
analyzeRegions(ij.process.ImageProcessor labelImage)
Computes the geodesic diameter of each particle within the given label
image.
|
GeodesicDiameter.Result[] |
analyzeRegions(ij.process.ImageProcessor labelImage,
int[] labels,
ij.measure.Calibration calib)
Computes the geodesic diameter of each region within the given label
image.
|
ij.measure.ResultsTable |
createTable(Map<Integer,GeodesicDiameter.Result> map)
Utility method that transforms the mapping between labels and result
instances into a ResultsTable that can be displayed with ImageJ.
|
static GeodesicDiameter.Result[] |
geodesicDiameters(ij.process.ImageProcessor labelImage,
int[] labels,
ij.measure.Calibration calib)
Computes the geodesic diameter of each region within the given label
image.
|
boolean |
getComputePaths()
Returns the value of the computePaths option.
|
void |
setChamferWeights(float[] weights)
Deprecated.
|
void |
setComputePaths(boolean bool)
Updates the value of the computePahs option.
|
analyzeRegions, analyzeRegions, computeTable
addAlgoListener, fireProgressChanged, fireProgressChanged, fireStatusChanged, fireStatusChanged, removeAlgoListener
public GeodesicDiameter()
public GeodesicDiameter(ChamferMask2D mask)
mask
- the chamfer mask used for propagating distances@Deprecated public GeodesicDiameter(ChamferWeights weights)
weights
- the array of weights for orthogonal, diagonal, and eventually
chess-knight moves neighbors@Deprecated public GeodesicDiameter(float[] weights)
weights
- the array of weights for orthogonal, diagonal, and eventually
chess-knight moves neighborspublic GeodesicDiameter(GeodesicDistanceTransform gdt)
gdt
- the instance of Geodesic Distance Transform calculator used
for propagating distancespublic static final GeodesicDiameter.Result[] geodesicDiameters(ij.process.ImageProcessor labelImage, int[] labels, ij.measure.Calibration calib)
labelImage
- a label image, containing either the label of a particle or
region, or zero for backgroundlabels
- the list of region labels to processcalib
- the spatial caliration of the imagepublic Map<Integer,GeodesicDiameter.Result> analyzeRegions(ij.process.ImageProcessor labelImage)
labelImage
- a label image, containing either the label of a particle or
region, or zero for backgroundpublic boolean getComputePaths()
public void setComputePaths(boolean bool)
bool
- the new value of the computePahs option.@Deprecated public void setChamferWeights(float[] weights)
weights
- the new value of the weights.public ij.measure.ResultsTable createTable(Map<Integer,GeodesicDiameter.Result> map)
map
- the mapping between labels and resultspublic GeodesicDiameter.Result[] analyzeRegions(ij.process.ImageProcessor labelImage, int[] labels, ij.measure.Calibration calib)
analyzeRegions
in class RegionAnalyzer2D<GeodesicDiameter.Result>
labelImage
- a label image, containing either the label of a particle or
region, or zero for backgroundlabels
- the list of region labels to processcalib
- the spatial caliration of the imageCopyright © 2014–2023 INRA-IJPB Modeling and Digital Imaging lab. All rights reserved.