imglib / imglib2-mesh

Proposal for a Java mesh library built from code from imagej-mesh and imagej-ops.
BSD 2-Clause "Simplified" License
4 stars 0 forks source link

Unable to use the marching cubes algorithm. #13

Open odinsbane opened 2 months ago

odinsbane commented 2 months ago

I made a simple program to try out the marching cubes algorithm.

    ImgOpener imgOpener = new ImgOpener();
    Img<UnsignedByteType> img = (Img<UnsignedByteType>) imgOpener.openImgs(
            new File(args[0]).getAbsolutePath() ).get(0);
    Cursor<UnsignedByteType> curse = Views.flatIterable(img).cursor();
    Mesh mesh = MarchingCubesRealType.calculate(img, 3);

On the call to 'calculate I get a no such method exception.

Exception in thread "main" java.lang.NoSuchMethodError: 'net.imglib2.RandomAccessibleInterval net.imglib2.view.Views.flatIterable(net.imglib2.RandomAccessibleInterval)' at net.imglib2.mesh.alg.MarchingCubesRealType.mask(MarchingCubesRealType.java:77) at net.imglib2.mesh.alg.MarchingCubesRealType.compute(MarchingCubesRealType.java:135) at net.imglib2.mesh.alg.MarchingCubesRealType.calculate(MarchingCubesRealType.java:123) at deformablemesh.experimental.Imglib2Mesh.main(Imglib2Mesh.java:23)

On line 77 it is getting a cursor object. I included that in my code. It works in my main method, but it doesn't work in the MarchingCubes algorithm.

odinsbane commented 2 months ago

I was playing around with a minimal pom to reproduce the issue.

I changed this:

          <dependency>
        <groupId>net.imglib2</groupId>
        <artifactId>imglib2-mesh</artifactId>
        <version>1.1.0</version>
    </dependency>

To:

            <dependency>
        <groupId>net.imglib2</groupId>
        <artifactId>imglib2-mesh</artifactId>
    </dependency>

That caused version 1.0.0 to be downloaded. It seems like some sort of version conflict with the parent pom scijava 38.0.1