imagej / imagej-common

ImageJ core data model
https://imagej.net/libs/imagej-common
BSD 2-Clause "Simplified" License
10 stars 18 forks source link

ArrayOutOfBoundsException when using UIService to show image with origin not at zero #68

Open maarzt opened 7 years ago

maarzt commented 7 years ago

Minimal example:

RandomAccessibleInterval<FloatType> image = Views.translate(ArrayImgs.floats(10, 10), 50, 50);
new Context().service(UIService.class).show(image);

produces several an ArrayOutOfBoundExceptions.

maarzt commented 7 years ago

The error seems to be cause by DefaultDatasetView. In DefaultDatasetView#rebuild() CompositeXYProjector is used to project the image to screenImage which has different bounds. In DefaultDatasetView#autoscale() seems to be a second unrelated error which as well causes ArrayOutOfBoundsExceptions.

ctrueden commented 7 years ago

Seems reminiscent of imglib/imglib2#161. @maarzt Did you get a chance to talk to @tpietzsch about this?

ctrueden commented 7 years ago

And I certainly agree that regardless of the correctness of CompositeXYProjector behavior, this is a bug... in something somewhere! Your example above should clearly work, not throw exceptions.

tpietzsch commented 7 years ago

Did you get a chance to talk to @tpietzsch about this?

Yes, I suggested that @maarzt files an issue...