CLIJ reslice bug

Hi there,

Reslicing an image fails for me, I assume because it’s writing to a file in the wrong dimensions… or I’m doing something foolish.

Image on the left is a slice of the source image, image on the right is a slice of the resliced result.

The code used is the jython code example from the CLIJ documentation:

from net.haesleinhuepf.clij import CLIJ;
from ij import IJ
clij = CLIJ.getInstance()
srcImagePlus= IJ.getImage()

src = clij.push(srcImagePlus)
dst = clij.create(src)

clij.op().resliceTop(src, dst)

dstImagePlus = clij.pull(dst)

1 Like

Hi @JimageJ1,

thanks for reporting the bug! It is actually misleading in the documentation. You should create the dst image with the right dimension/size before filling it with pixel values. In the reslice-top context, your code line number 8 should look like this:

dst = clij.create([src.getWidth(), src.getDepth(), src.getHeight()], src.getNativeType());

A bit more introduction to the CLIJ API from Java/Groovy/Jython can be found here:

I’m going to fix the documentation asap. In the meantime, I just added an example jython script for reslicing:

Thanks again for reporting the issue! I really appreciate that kind of feedback because it allows me to improve the documentation.

Let me know if it works!



Thanks @haesleinhuepf! That solved it. :slight_smile:

1 Like

The documentation is also fixed now.

Thanks again for the feedback!