Skip to content

Commit d01b33a

Browse files
committed
Add Op names to existing functionality
1 parent df81984 commit d01b33a

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/main/java/net/imglib2/mesh/MeshStats.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@
2828
*/
2929
package net.imglib2.mesh;
3030

31+
import net.imglib2.mesh.alg.InertiaTensor;
3132
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
3233

3334
import net.imglib2.RealPoint;
3435
import net.imglib2.mesh.alg.hull.ConvexHull;
3536
import net.imglib2.mesh.util.MeshUtil;
37+
import org.apache.commons.math3.linear.EigenDecomposition;
38+
import org.apache.commons.math3.linear.RealMatrix;
3639

3740
/**
3841
* Static utilities that compute various shape descriptors of a mesh.
@@ -44,6 +47,8 @@ public class MeshStats
4447
* Computes the volume of the specified mesh.
4548
*
4649
* @return the volume in physical units.
50+
* @implNote op names='geom.size', label='Geometric (2D): Size',
51+
* priority='9999.'
4752
*/
4853
public static double volume( final Mesh mesh )
4954
{
@@ -88,6 +93,8 @@ public static double volume( final Mesh mesh )
8893
* the input mesh.
8994
* @return the mesh surface area.
9095
* @author Tim-Oliver Buchholz (University of Konstanz)
96+
* @implNote op names='geom.boundarySize', label='Geometric (3D): Surface Area',
97+
* priority='10000.'
9198
*/
9299
public static double surfaceArea( final Mesh mesh )
93100
{
@@ -115,6 +122,8 @@ public static double surfaceArea( final Mesh mesh )
115122
* @param mesh
116123
* the input mesh.
117124
* @return the mesh solidity value.
125+
* @implNote op names='geom.solidity', label='Geometric (3D): Solidity',
126+
* priority='10000.'
118127
*/
119128
public static double solidity( final Mesh mesh )
120129
{
@@ -133,6 +142,8 @@ public static double solidity( final Mesh mesh )
133142
* @param convexHull
134143
* the convex hull of the input, if it has been pre-calculated.
135144
* @return the mesh solidity value.
145+
* @implNote op names='geom.solidity', label='Geometric (3D): Solidity',
146+
* priority='10000.'
136147
*/
137148
public static double solidity( final Mesh mesh, final Mesh convexHull )
138149
{
@@ -151,6 +162,8 @@ public static double solidity( final Mesh mesh, final Mesh convexHull )
151162
* @param mesh
152163
* the input mesh.
153164
* @return the mesh convexity value.
165+
* @implNote op names='geom.convexity', label='Geometric (3D): Convexity',
166+
* priority='10000.'
154167
*/
155168
public static double convexity( final Mesh mesh )
156169
{
@@ -169,6 +182,8 @@ public static double convexity( final Mesh mesh )
169182
* @param convexHull
170183
* the convex hull of the input, if it has been pre-calculated.
171184
* @return the mesh convexity value.
185+
* @implNote op names='geom.convexity', label='Geometric (3D): Convexity',
186+
* priority='10000.'
172187
*/
173188
public static double convexity( final Mesh mesh, final Mesh convexHull )
174189
{
@@ -188,6 +203,8 @@ public static double convexity( final Mesh mesh, final Mesh convexHull )
188203
* @param mesh
189204
* the input mesh.
190205
* @return the mesh sphericity value.
206+
* @implNote op names='geom.sphericity', label='Geometric (3D): Sphericity',
207+
* priority='10000.'
191208
*/
192209
public static double sphericity( final Mesh mesh )
193210
{
@@ -214,6 +231,8 @@ public static double sphericity( final Mesh mesh )
214231
* the input mesh.
215232
* @return the mesh compactness value.
216233
* @author Tim-Oliver Buchholz (University of Konstanz)
234+
* @implNote op names='geom.compactness', label='Geometric (3D): Compactness',
235+
* priority='10000.'
217236
*/
218237
public static double compactness( final Mesh mesh )
219238
{
@@ -237,6 +256,7 @@ public static double compactness( final Mesh mesh )
237256
* @param input
238257
* the input mesh.
239258
* @return the centroid of the mesh.
259+
* @implNote op names='geom.centroid', priority='10000.'
240260
*/
241261
public static RealPoint centroid( final Mesh input )
242262
{

src/main/java/net/imglib2/mesh/Meshes.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import net.imglib2.mesh.alg.MeshConnectedComponents;
4141
import net.imglib2.mesh.alg.RemoveDuplicateVertices;
4242
import net.imglib2.mesh.alg.SimplifyMesh;
43+
import net.imglib2.mesh.impl.naive.NaiveDoubleMesh;
4344
import net.imglib2.mesh.impl.nio.BufferMesh;
4445
import net.imglib2.type.BooleanType;
4546
import net.imglib2.type.numeric.RealType;
@@ -71,6 +72,13 @@ public static RealPoint center( final Mesh m )
7172
return p;
7273
}
7374

75+
/**
76+
* Computes and returns an <b>oriented</b> bounding box {@link RealInterval}
77+
*
78+
* @param input
79+
* @return the output {@link Mesh}
80+
* @implNote op names="geom.boundingBox"
81+
*/
7482
public static RealInterval boundingBox( final net.imglib2.mesh.Mesh mesh )
7583
{
7684
final double[] boundingBox = new double[] { Double.POSITIVE_INFINITY,

0 commit comments

Comments
 (0)