Class MeshStats


  • public class MeshStats
    extends Object
    Static utilities that compute various shape descriptors of a mesh.
    • Method Detail

      • volume

        public static double volume​(Mesh mesh)
        Computes the volume of the specified mesh.
        Parameters:
        mesh - the input Mesh
        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 - a Mesh
        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 - a Mesh
        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.'
      • 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 a Mesh. As elongation is a metric of a two-dimensional object, this functionality describes elongation as a RealMatrix, where each index x,y is the elongation considering principal axes x and y.
        Parameters:
        input - a Mesh
        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 a Mesh. Provides functionality equivalent to the "geom.mainElongation" Op of ImageJ Ops.
        Parameters:
        input - a Mesh
        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 a Mesh. Provides functionality equivalent to the "geom.medianElongation" Op of ImageJ Ops.
        Parameters:
        input - a Mesh
        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 a Mesh.
        Parameters:
        input - a Mesh
        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 of Mesh.
        Parameters:
        input - a Mesh
        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 a Mesh. Spareness is defined as the ratio of the Mesh's volume to that of a best-fit ellipsoid. Inspiration drawn from ImageJ.
        Parameters:
        input - the input Mesh
        Returns:
        the ellipse variance
        Implementation Note:
        op names='geom.spareness', label='Geometric (3D): Spareness', priority='10000.'