Skip to content

Commit

Permalink
Merge pull request #303 from scenerygraphics/imagej-mesh-update
Browse files Browse the repository at this point in the history
Update imagej-mesh version, switch to new marching cubes impl
  • Loading branch information
kephale authored Nov 10, 2020
2 parents 44c44cc + 5a09273 commit a69747b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<scenery.version>94e8d97</scenery.version>
<!-- <scijava-common.version>2.84.0</scijava-common.version>-->
<ui-behaviour.version>2.0.3</ui-behaviour.version>
<imagej-mesh.version>a40d46f</imagej-mesh.version>

<kotlin.version>1.4.10</kotlin.version>
<kotlinx-coroutines-core.version>1.3.9</kotlinx-coroutines-core.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/sc/iview/commands/process/Isosurface.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -81,7 +82,7 @@ public void run() {

Img<BitType> bitImg = (Img<BitType>) 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();
Expand Down

0 comments on commit a69747b

Please sign in to comment.