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)
dstImagePlus.show()

src.close()
dst.close()
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: https://clij.github.io/clij-docs/api_intro

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!

Cheers,
Robert

2 Likes

Thanks @haesleinhuepf! That solved it. :slight_smile:

1 Like

The documentation is also fixed now.

Thanks again for the feedback!

2 Likes