From 5a09273513df003b53457f99bb3b2a60d08b72c1 Mon Sep 17 00:00:00 2001 From: Kyle IS Harrington Date: Sat, 7 Nov 2020 09:54:03 +0100 Subject: [PATCH] Update imagej-mesh version, switch to new marching cubes impl --- pom.xml | 1 + src/main/java/sc/iview/commands/demo/ShowSegmentationDemo.java | 3 ++- src/main/java/sc/iview/commands/process/Isosurface.java | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f8c3ef86..242fda1e 100644 --- a/pom.xml +++ b/pom.xml @@ -111,6 +111,7 @@ 94e8d97 2.0.3 + a40d46f 1.4.10 1.3.9 diff --git a/src/main/java/sc/iview/commands/demo/ShowSegmentationDemo.java b/src/main/java/sc/iview/commands/demo/ShowSegmentationDemo.java index fdca158a..26661f36 100644 --- a/src/main/java/sc/iview/commands/demo/ShowSegmentationDemo.java +++ b/src/main/java/sc/iview/commands/demo/ShowSegmentationDemo.java @@ -31,6 +31,7 @@ import graphics.scenery.volumes.Volume; import io.scif.services.DatasetIOService; import net.imagej.mesh.Mesh; +import net.imagej.mesh.Meshes; import net.imagej.ops.OpService; import net.imagej.ops.geom.geom3d.mesh.BitTypeVertexInterpolator; import net.imglib2.Cursor; @@ -105,7 +106,7 @@ public void run() { for( LabelRegion region : regions ) { // Generate the mesh with imagej-ops - Mesh m = ops.geom().marchingCubes( region, 1, new BitTypeVertexInterpolator() ); + Mesh m = Meshes.marchingCubes(region); // Convert the mesh into a scenery mesh for visualization graphics.scenery.Mesh isoSurfaceMesh = MeshConverter.toScenery(m,false); diff --git a/src/main/java/sc/iview/commands/process/Isosurface.java b/src/main/java/sc/iview/commands/process/Isosurface.java index f25604d3..79f583d9 100644 --- a/src/main/java/sc/iview/commands/process/Isosurface.java +++ b/src/main/java/sc/iview/commands/process/Isosurface.java @@ -31,6 +31,7 @@ import graphics.scenery.HasGeometry; import graphics.scenery.Node; import net.imagej.mesh.Mesh; +import net.imagej.mesh.Meshes; import net.imagej.ops.OpService; import net.imagej.ops.geom.geom3d.mesh.BitTypeVertexInterpolator; import net.imglib2.IterableInterval; @@ -81,7 +82,7 @@ public void run() { Img bitImg = (Img) ops.threshold().apply(image, tmp); - Mesh m = ops.geom().marchingCubes(bitImg, 1, new BitTypeVertexInterpolator()); + Mesh m = Meshes.marchingCubes(bitImg); Node scMesh = sciView.addMesh(m); ((HasGeometry)scMesh).recalculateNormals();