Class MeshStats
- java.lang.Object
-
- net.imglib2.mesh.MeshStats
-
public class MeshStats extends Object
Static utilities that compute various shape descriptors of a mesh.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RealPointcentroid(Mesh input)Returns the centroid of the mesh, that is the center of gravity of its volume.static doublecompactness(Mesh mesh)Returns the compactness of the mesh.static doubleconvexHullSurfaceArea(Mesh mesh)Computes the surface area of the convex hull of the specified mesh.static longconvexHullVerticesCount(Mesh input)Describes the number of vertices on the surface of the convex hull ofMesh.static doubleconvexHullVolume(Mesh mesh)Computes the volume of the convex hull of the specified mesh.static doubleconvexity(Mesh mesh)Returns the convexity of a mesh.static doubleconvexity(Mesh mesh, Mesh convexHull)Returns the convexity of a mesh.static RealMatrixelongation(Mesh input)Describes the elogation of aMesh.static doublemainElongation(Mesh input)Describes the elongation of the two larger principle axes of the minimum box containing aMesh.static doublemedianElongation(Mesh input)Describes the elongation of the two smaller principle axes of the minimum box containing aMesh.static doublesolidity(Mesh mesh)Returns the solidity of a mesh.static doublesolidity(Mesh mesh, Mesh convexHull)Returns the solidity of a mesh.static doublespareness(Mesh input)Describes the spareness of aMesh.static doublesphericity(Mesh mesh)Returns the sphericity of a mesh.static doublesurfaceArea(Mesh mesh)Returns the surface area of a mesh.static longverticesCount(Mesh input)Describes the number of vertices on the surface of aMesh.static doublevolume(Mesh mesh)Computes the volume of the specified mesh.
-
-
-
Method Detail
-
volume
public static double volume(Mesh mesh)
Computes the volume of the specified mesh.- Parameters:
mesh- the inputMesh- Returns:
- the volume in physical units.
- Implementation Note:
- op names='geom.size', label='Geometric (3D): Volume', priority='9999.'
-
convexHullVolume
public static double convexHullVolume(Mesh mesh)
Computes the volume of the convex hull of the specified mesh.- Parameters:
mesh- aMesh- Returns:
- the volume in physical units.
- Implementation Note:
- op names='geom.sizeConvexHull', label='Geometric (3D): Convex Hull Volume', priority='9999.'
-
surfaceArea
public static double surfaceArea(Mesh mesh)
Returns the surface area of a mesh.It is computed as the sum of the area of the outwards-facing triangles.
- Parameters:
mesh- the input mesh.- Returns:
- the mesh surface area.
- Implementation Note:
- op names='geom.boundarySize', label='Geometric (3D): Surface Area', priority='10000.'
-
convexHullSurfaceArea
public static double convexHullSurfaceArea(Mesh mesh)
Computes the surface area of the convex hull of the specified mesh.- Parameters:
mesh- aMesh- Returns:
- the surface area in physical units.
- Implementation Note:
- op names='geom.boundarySizeConvexHull', label='Geometric (3D): Convex Hull Surface Area', priority='9999.'
-
solidity
public static double solidity(Mesh mesh)
Returns the solidity of a mesh.The solidity is computed as the ratio between the volume of the mesh and the volume of its convex hull.
- Parameters:
mesh- the input mesh.- Returns:
- the mesh solidity value.
- Implementation Note:
- op names='geom.solidity', label='Geometric (3D): Solidity', priority='10000.'
-
solidity
public static double solidity(Mesh mesh, Mesh convexHull)
Returns the solidity of a mesh.The solidity is computed as the ratio between the volume of the mesh and the volume of its convex hull.
- Parameters:
mesh- the input mesh.convexHull- the convex hull of the input, if it has been pre-calculated.- Returns:
- the mesh solidity value.
- Implementation Note:
- op names='geom.solidity', label='Geometric (3D): Solidity', priority='10000.'
-
convexity
public static double convexity(Mesh mesh)
Returns the convexity of a mesh.The convexity is computed as the ratio between the surface area of the mesh and the surface area of its convex hull.
- Parameters:
mesh- the input mesh.- Returns:
- the mesh convexity value.
- Implementation Note:
- op names='geom.convexity', label='Geometric (3D): Convexity', priority='10000.'
-
convexity
public static double convexity(Mesh mesh, Mesh convexHull)
Returns the convexity of a mesh.The convexity is computed as the ratio between the surface area of the convex hull and the surface area of the mesh.
- Parameters:
mesh- the input mesh.convexHull- the convex hull of the input, if it has been pre-calculated.- Returns:
- the mesh convexity value.
- Implementation Note:
- op names='geom.convexity', label='Geometric (3D): Convexity', priority='10000.'
-
sphericity
public static double sphericity(Mesh mesh)
Returns the sphericity of a mesh.The sphericity is computed as the ratio between the surface area of a sphere with the same volume that of the input, and the the surface area of the input mesh.
- Parameters:
mesh- the input mesh.- Returns:
- the mesh sphericity value.
- Implementation Note:
- op names='geom.sphericity', label='Geometric (3D): Sphericity', priority='10000.'
-
compactness
public static double compactness(Mesh mesh)
Returns the compactness of the mesh. Based on: Ernesto Bribiesca, An easy measure of compactness for 2D and 3D shapes, Pattern Recognition, Volume 41, Issue 2, 2008, Pages 543-554, ISSN 0031-3203In the paper compactness is defined as
area^3/volume^2. For a sphere this is minimized and results in36*PI. To get values between (0,1] we use(36*PI)/(area^3/volume^2).- Parameters:
mesh- the input mesh.- Returns:
- the mesh compactness value.
- Implementation Note:
- op names='geom.compactness', label='Geometric (3D): Compactness', priority='10000.'
-
centroid
public static RealPoint centroid(Mesh input)
Returns the centroid of the mesh, that is the center of gravity of its volume.(As a side note,
Meshes.center(Mesh)returns the center of gravity of the mesh's surface.)- Parameters:
input- the input mesh.- Returns:
- the centroid of the mesh.
- Implementation Note:
- op names='geom.centroid', priority='10000.'
-
elongation
public static RealMatrix elongation(Mesh input)
Describes the elogation of aMesh. As elongation is a metric of a two-dimensional object, this functionality describes elongation as aRealMatrix, where each indexx,yis the elongation considering principal axesxandy.- Parameters:
input- aMesh- Returns:
- the elongation of each subset of principal axes of
input - Implementation Note:
- op names='geom.elongation', label='Geometric (3D): Elongation', priority='10000.'
-
mainElongation
public static double mainElongation(Mesh input)
Describes the elongation of the two larger principle axes of the minimum box containing aMesh. Provides functionality equivalent to the"geom.mainElongation"Op of ImageJ Ops.- Parameters:
input- aMesh- Returns:
- the elongation of a cross-section containing the two larger principle axes
- Implementation Note:
- op names='geom.mainElongation', label='Geometric (3D): Main Elongation', priority='10000.'
-
medianElongation
public static double medianElongation(Mesh input)
Describes the elongation of the two smaller principle axes of the minimum box containing aMesh. Provides functionality equivalent to the"geom.medianElongation"Op of ImageJ Ops.- Parameters:
input- aMesh- Returns:
- the elongation of a cross-section containing the two smaller principle axes
- Implementation Note:
- op names='geom.medianElongation', label='Geometric (3D): Median Elongation', priority='10000.'
-
verticesCount
public static long verticesCount(Mesh input)
Describes the number of vertices on the surface of aMesh.- Parameters:
input- aMesh- Returns:
- the number of vertices in
input - Implementation Note:
- op names='geom.verticesCount', label='Geometric (3D): Surface Vertices Count', priority='10000.'
-
convexHullVerticesCount
public static long convexHullVerticesCount(Mesh input)
Describes the number of vertices on the surface of the convex hull ofMesh.- Parameters:
input- aMesh- Returns:
- the number of vertices in the convex hull of
input - Implementation Note:
- op names='geom.verticesCountConvexHull', label='Geometric (3D): Convex Hull Vertices Count', priority='10000.'
-
spareness
public static double spareness(Mesh input)
Describes the spareness of aMesh. Spareness is defined as the ratio of theMesh's volume to that of a best-fit ellipsoid. Inspiration drawn from ImageJ.- Parameters:
input- the inputMesh- Returns:
- the ellipse variance
- Implementation Note:
- op names='geom.spareness', label='Geometric (3D): Spareness', priority='10000.'
-
-