imglib / imglib2-ij

Translation between ImgLib & ImageJ data structures (both 1.x and 2)
Other
4 stars 8 forks source link

ImageJFunction.show can throw ArrayIndexOutOfBoundsException #33

Open ctrueden opened 2 years ago

ctrueden commented 2 years ago

From this Image.sc Forum topic: using the shearView op and then showing it as an ImagePlus using ImageJFunctions.show can throw an ArrayIndexOutOfBoundsException. Try opening the Bat Cochlea Volume sample (File → Open Samples menu), then running the following Groovy script:

#@ Img img

import net.imglib2.view.*
import bdv.util.BdvFunctions
import net.imglib2.img.display.imagej.ImageJFunctions

IntervalView imgShear12 = Views.interval( 
                Views.shear( Views.extendZero( img ), 1, 2 ),
                img );

//BdvFunctions.show( imgShear12, "shear 12" );  // looks good
ImageJFunctions.show( imgShear12 ); // CRASHES (see below)

Then move the C slider of the resultant image, and observe the message on stderr:

Exception in thread "zSelector" java.lang.ArrayIndexOutOfBoundsException

This may or may not actually be a bug in imglib2-ij, but I file it here in the absence of a better idea, until it gets investigated.

imagesc-bot commented 2 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/cant-access-output-after-using-ij2-op-shearview/8458/15