Open ctrueden opened 5 years ago
Yes, I noticed that bug before, it's fixed in the first commit of this PR: https://github.com/imglib/imglib2-ij/pull/28
Yes, the bug is fixed by the PR mentioned before, but for a different reason. Overall this occurs as consequence of several strange behaviors:
new ImagePlus("title", stack)
effectively performs: stack.setPixels(stack.getProcessor(1).getPixels(), 1)
. Which make no sense, but it's causes problems for performance and numerical precision of imglib2 images when wrapped as virtual stacks.Integer.MAX_VALUE -> float -> double ->long -> int
, results for reasons of rounding and numerical precision in Integer.MIN_VALUE
. https://github.com/imglib/imglib2-ij/pull/28 fixes the problem because it reduces the conversion to Integer.MAX_VALUE -> float -> int
.
Run the above script, and observe how the original array's values get mangled.
Using
net.imglib2.img.display.imagej.ImageJFunctions.show(img)
does not mangle the array, but does create an int16 image(!) which I guess is a separate bug (CC @maarzt).Using
bdv.util.BdvFunctions.show
is, I think, OK, although I didn't thoroughly check.