From 934142697af74cdf18d654696beffd6edd53543b Mon Sep 17 00:00:00 2001 From: Ulrik Guenther Date: Fri, 16 Oct 2020 20:46:57 +0200 Subject: [PATCH 1/4] POM: Bump to latest scenery repository version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b23729dc..b82188d4 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ deploy-to-scijava - b9c44a2 + 242d9cf 1.4.10 From e8f7c9f0b11bfe73c3b9ea1cee2d88ce5d0e1939 Mon Sep 17 00:00:00 2001 From: Ulrik Guenther Date: Fri, 16 Oct 2020 20:47:42 +0200 Subject: [PATCH 2/4] SciView: Use duplicate buffers for accessing geometry when writing STL files --- src/main/java/sc/iview/SciView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/sc/iview/SciView.java b/src/main/java/sc/iview/SciView.java index bf4a415a..9eee42f9 100644 --- a/src/main/java/sc/iview/SciView.java +++ b/src/main/java/sc/iview/SciView.java @@ -1269,8 +1269,8 @@ public void writeSCMesh( String filename, Mesh scMesh ) { out = new BufferedOutputStream( new FileOutputStream( f ) ); out.write( "solid STL generated by FIJI\n".getBytes() ); - FloatBuffer normalsFB = scMesh.getNormals(); - FloatBuffer verticesFB = scMesh.getVertices(); + FloatBuffer normalsFB = scMesh.getNormals().duplicate(); + FloatBuffer verticesFB = scMesh.getVertices().duplicate(); while( verticesFB.hasRemaining() && normalsFB.hasRemaining() ) { out.write( ( "facet normal " + normalsFB.get() + " " + normalsFB.get() + " " + normalsFB.get() + From 67dc3e16f7ba30d53f33ba0ef373a31c5bd11fe6 Mon Sep 17 00:00:00 2001 From: Ulrik Guenther Date: Fri, 16 Oct 2020 20:48:39 +0200 Subject: [PATCH 3/4] Isosurface: Recalculate normals and use same pixel-to-world ratio as Volume --- src/main/java/sc/iview/commands/process/Isosurface.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/sc/iview/commands/process/Isosurface.java b/src/main/java/sc/iview/commands/process/Isosurface.java index 0da844e7..f25604d3 100644 --- a/src/main/java/sc/iview/commands/process/Isosurface.java +++ b/src/main/java/sc/iview/commands/process/Isosurface.java @@ -28,6 +28,7 @@ */ package sc.iview.commands.process; +import graphics.scenery.HasGeometry; import graphics.scenery.Node; import net.imagej.mesh.Mesh; import net.imagej.ops.OpService; @@ -36,6 +37,7 @@ import net.imglib2.img.Img; import net.imglib2.type.logic.BitType; import net.imglib2.type.numeric.RealType; +import org.joml.Vector3f; import org.scijava.command.Command; import org.scijava.plugin.Menu; import org.scijava.plugin.Parameter; @@ -82,7 +84,8 @@ public void run() { Mesh m = ops.geom().marchingCubes(bitImg, 1, new BitTypeVertexInterpolator()); Node scMesh = sciView.addMesh(m); - + ((HasGeometry)scMesh).recalculateNormals(); + scMesh.setScale(new Vector3f(0.001f, 0.001f, 0.001f)); } } From 17cade6169f1fe5d568092b989461ef787606572 Mon Sep 17 00:00:00 2001 From: Ulrik Guenther Date: Fri, 16 Oct 2020 21:56:59 +0200 Subject: [PATCH 4/4] Travis CI: Disable shallow cloning --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index fa17be5f..ee5b1533 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ branches: - master - "/.*-[0-9]+\\..*/" install: true +git: + depth: false script: #- ".travis/build.sh" - "python3 .travis/pre_ci.py"