Package sc.fiji.snt.analysis
Class ConvexHullAnalyzer
java.lang.Object
org.scijava.AbstractContextual
org.scijava.command.ContextCommand
sc.fiji.snt.analysis.ConvexHullAnalyzer
- All Implemented Interfaces:
Runnable,org.scijava.Cancelable,org.scijava.command.Command,org.scijava.Contextual,org.scijava.plugin.SciJavaPlugin
public class ConvexHullAnalyzer
extends org.scijava.command.ContextCommand
Class for Convex Hull measurements of a
Tree.- Author:
- Cameron Arshadi, Tiago Ferreira
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConvexHullAnalyzer(AbstractConvexHull convexHull) Instantiates a new convex hull analyzer.ConvexHullAnalyzer(Tree tree) Instantiates a new convex hull analyzer. -
Method Summary
Modifier and TypeMethodDescriptionprotected doubleprotected net.imglib2.RealLocalizableprotected doubleprotected AbstractConvexHullcomputeHull(Tree tree) protected doubleorg.scijava.Contextcontext()voiddoubleGets the value of a specific convex hull metric.Gets all computed convex hull analysis metrics.doubleGets the boundary size (perimeter for 2D hulls or surface area for 3D hulls) of the convex hull.doubleGets the boxivity of the convex hull, which measures how box-like the convex hull is.doubleorg.scijava.ContextdoubledoubleGets the elongation of the convex hull, which measures how elongated the convex hull is.getHull()Gets the convex hull object being analyzed.doubleGets the roundness of the convex hull, which measures how round or circular the convex hull is.doublegetSize()Gets the size (area or volume) of the convex hull, which is the area for 2D hulls or the volume for 3D hulls.getTree()Gets the tree being analyzed.Returns the physical unit associated with the specified metric.static voidMain method for testing and demonstration purposes.voidrun()voidSets the optional description for the analysisGets the list of metrics supported by ConvexHullAnalyzer.Methods inherited from class org.scijava.command.ContextCommand
cancel, getCancelReason, isCanceledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.scijava.Contextual
setContext
-
Field Details
-
BOUNDARY_SIZE
- See Also:
-
BOXIVITY
- See Also:
-
ELONGATION
- See Also:
-
ROUNDNESS
- See Also:
-
SIZE
- See Also:
-
COMPACTNESS_3D
- See Also:
-
ECCENTRICITY_2D
- See Also:
-
-
Constructor Details
-
ConvexHullAnalyzer
Instantiates a new convex hull analyzer.- Parameters:
tree- the Tree to be analyzed
-
ConvexHullAnalyzer
Instantiates a new convex hull analyzer.- Parameters:
convexHull- the Convex hull to be analyzed
-
-
Method Details
-
context
public org.scijava.Context context()- Specified by:
contextin interfaceorg.scijava.Contextual- Overrides:
contextin classorg.scijava.AbstractContextual
-
getContext
public org.scijava.Context getContext()- Specified by:
getContextin interfaceorg.scijava.Contextual- Overrides:
getContextin classorg.scijava.AbstractContextual
-
run
public void run() -
supportedMetrics
Gets the list of metrics supported by ConvexHullAnalyzer.- Returns:
- the list of supported metric names that can be computed by this analyzer
-
getAnalysis
Gets all computed convex hull analysis metrics.Returns a map containing all the computed convex hull metrics and their values. The metrics are computed lazily and cached for subsequent calls. If the hull cannot be computed, all metrics return NaN.
- Returns:
- a map of metric names to their computed values
-
dump
-
getHull
Gets the convex hull object being analyzed. The hull is initialized if needed.- Returns:
- the convex hull object
-
get
Gets the value of a specific convex hull metric.Retrieves the computed value for the specified metric name. The metric must be one of the supported metrics returned by
supportedMetrics().- Parameters:
metric- the name of the metric to retrieve- Returns:
- the computed value for the metric
- See Also:
-
getCentroid
-
getBoxivity
public double getBoxivity()Gets the boxivity of the convex hull, which measures how box-like the convex hull is. Values closer to 1 indicate a more box-like shape.- Returns:
- the boxivity value
-
getElongation
public double getElongation()Gets the elongation of the convex hull, which measures how elongated the convex hull is. Higher values indicate more elongated shapes.- Returns:
- the elongation value
-
getRoundness
public double getRoundness()Gets the roundness of the convex hull, which measures how round or circular the convex hull is. Values closer to 1 indicate a more round shape.- Returns:
- the roundness value
-
getSize
public double getSize()Gets the size (area or volume) of the convex hull, which is the area for 2D hulls or the volume for 3D hulls.- Returns:
- the size of the convex hull
-
getBoundarySize
public double getBoundarySize()Gets the boundary size (perimeter for 2D hulls or surface area for 3D hulls) of the convex hull.- Returns:
- the boundary size of the convex hull
-
getCompactness
public double getCompactness() -
getEccentricity
public double getEccentricity() -
computeRoundness
-
computeBoxivity
-
computeCentroid
-
computeElongation
-
computeHull
-
setLabel
Sets the optional description for the analysis- Parameters:
analysisLabel- a string describing the analysis
-
getTree
Gets the tree being analyzed.- Returns:
- the tree being analyzed, or null if the analyzer was created directly from a convex hull.
-
getUnit
Returns the physical unit associated with the specified metric.- Parameters:
metric- the supported metric to be queried (case-sensitive)- Returns:
- physical unit
- See Also:
-
main
Main method for testing and demonstration purposes.Creates a ConvexHullAnalyzer instance using demo data and runs the analysis. This method is primarily used for development and debugging.
- Parameters:
args- command line arguments (not used)- Throws:
InterruptedException- if the execution is interrupted
-