Several commands not working in Fiji with µManager-acquired stacks

I recently installed Fiji on two different macs running MacOs High Sierra and experienced the same issues on both with the following stack manipulation commands:

  1. Image>Stacks>Orthogonal views
    Nothing happens except for the following error appearing on the console:
Exception in thread "Orthogonal Views" java.lang.ArrayIndexOutOfBoundsException: 1556496246
	at ij.process.ShortProcessor.resize(ShortProcessor.java:898)
	at ij.plugin.Orthogonal_Views.updateViews(Orthogonal_Views.java:238)
	at ij.plugin.Orthogonal_Views.exec(Orthogonal_Views.java:730)
	at ij.plugin.Orthogonal_Views.run(Orthogonal_Views.java:969)
	at java.lang.Thread.run(Thread.java:745)
  1. Image>Stacks>3D Project (using the default parameters)
    No effect except this error message:
java.lang.NegativeArraySizeException
	at ij.plugin.Projector.allocateArrays(Projector.java:464)
	at ij.plugin.Projector.doProjections(Projector.java:339)
	at ij.plugin.Projector.run(Projector.java:94)
	at ij.IJ.runPlugIn(IJ.java:189)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:745)

The stack is quite small: 606x579x51, 16bit, 34MB and I assigned 8GB maximum memory to Fiji on a 12GB system.
I cannot say whether these commands worked with previous versions of MacOs because I’m a new user of Fiji.
Here are my Fiji/ImageJ details: ImageJ 2.0.0-rc-61/151q; Java 1.8.0_66 [64-bit]

Are these known issues? Is there a way around them?

Cheers, Lorenzo

On macOS 10.12.6 Sierra, the following macro works:

newImage("Untitled", "16-bit ramp", 606, 579, 51);
run("3D Project...", "projection=[Brightest Point] axis=Y-Axis slice=1 initial=0 total=360 rotation=10 lower=1 upper=255 opacity=0 surface=100 interior=50");

So indeed, this could be somehow related to High Sierra.

1 Like

Hi and thanks for the feedback. I tested your macro and it works on MacOs Sierra as well. Manually calling 3D project and Orthogonal views on the generated gradient stack also works.

So perhaps the problem is related to my specific image stacks. I tried several files, all acquired with µManager from a monochrome Leica camera, and the issues persist. I’d be happy to provide sample files for testing on other systems!

1 Like

Great. If you have any very small datasets (<32MB zipped), you can attach them directly here as ZIP files. Or if they are larger, you can share via a cloud-based approach (Dropbox, Box, OneDrive, etc.).

Sorry, in my previous message I meant to say that your script worked in “High Sierra”…

Anyhow, I can’t upload 'cause I’m a new user, but here are the links
stack cropped in Fiji to the size that I specified in my original post:
https://www.dropbox.com/s/0ke5gk4zth3u2np/cropped_stack.tif.zip?dl=0
untouched full frame stack (straight from microManager):
https://www.dropbox.com/s/fz2a9v7ri1iyxhh/full_frame_stack.tif.zip?dl=0

Thanks again for your help.

Sorry for the inconvenience. I lifted that restriction for you now.

I took a look. I can reproduce on Sierra; this is not a High-Sierra-specific issue.

Press shift+P to bring up the Image Properties. Notice that the X/Y spacing value is very small, while the Z spacing is relatively much larger. My initial guess here is that the values are too different and result in a math overflow or underflow somewhere. If you change all three values to 1 and then rerun 3D Project, it produces the projection successfully.

2 Likes

You nailed it. The correct x&y spacings are 1.543µm/pixel and with those values everything works smoothly. I must check my workflow in microManager to figure out why the xy end up so small (I am also a beginner there).

Sorry for raising this issue in the wrong context and thanks for the extremely efficient feedback!

2 Likes

Hi, I’m coming back again on this topic with a new issue related to the interaction of Fiji/ImageJ with stacks acquired via µManager. The new issue seems unrelated to voxels size specifications as discussed above but is linked to contrast scaling.

The test stack is here https://www.dropbox.com/s/n3kamymqd62n0ur/full_frame_stack.tif.zip?dl=0

Steps to reproduce: Open stack, invoke ‘Adjust Brightness/Contrast’, click ‘Auto’ (or set contrast manually wherever you want, click ‘Apply’ + yes.

The console shows a long error list which I copy below. Note that the issue does not show up with the artificial stack generated via ctrueden’s macro, but only with these µManager stacks. Might this have again something to do with incomplete parameter specifications at the time of image capture?

Thanks, L

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 371_
	at ij.process.ShortProcessor.getHistogram2(ShortProcessor.java:998)_
	at ij.process.ShortStatistics.<init>(ShortStatistics.java:34)_
	at ij.process.ImageStatistics.getStatistics(ImageStatistics.java:78)_
	at ij.ImagePlus.getStatistics(ImagePlus.java:917)_
	at ij.ImagePlus.getStatistics(ImagePlus.java:889)_
	at ij.ImagePlus.getStatistics(ImagePlus.java:863)_
	at ij.plugin.frame.ContrastAdjuster.plotHistogram(ContrastAdjuster.java:606)_
	at ij.plugin.frame.ContrastAdjuster.setupNewImage(ContrastAdjuster.java:392)_
	at ij.plugin.frame.ContrastAdjuster.setup(ContrastAdjuster.java:313)_
	at ij.plugin.frame.ContrastAdjuster.setup(ContrastAdjuster.java:271)_
	at ij.plugin.frame.ContrastAdjuster.windowActivated(ContrastAdjuster.java:1140)_
	at java.awt.Window.processWindowEvent(Window.java:2070)_
	at java.awt.Window.processEvent(Window.java:2017)_
	at java.awt.Component.dispatchEventImpl(Component.java:4891)_
	at java.awt.Container.dispatchEventImpl(Container.java:2294)_
	at java.awt.Window.dispatchEventImpl(Window.java:2750)_
	at java.awt.Component.dispatchEvent(Component.java:4713)_
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)_
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:995)_
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:488)_
	at java.awt.Component.dispatchEventImpl(Component.java:4762)_
	at java.awt.Container.dispatchEventImpl(Container.java:2294)_
	at java.awt.Window.dispatchEventImpl(Window.java:2750)_
	at java.awt.Component.dispatchEvent(Component.java:4713)_
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)_
	at java.awt.EventQueue.access$500(EventQueue.java:97)_
	at java.awt.EventQueue$3.run(EventQueue.java:709)_
	at java.awt.EventQueue$3.run(EventQueue.java:703)_
	at java.security.AccessController.doPrivileged(Native Method)_
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)_
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)_
	at java.awt.EventQueue$4.run(EventQueue.java:731)_
	at java.awt.EventQueue$4.run(EventQueue.java:729)_
	at java.security.AccessController.doPrivileged(Native Method)_
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)_
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)_
	at java.awt.SentEvent.dispatch(SentEvent.java:70)_
	at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(DefaultKeyboardFocusManager.java:217)_
	at java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:244)_
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:366)_
	at java.awt.Component.dispatchEventImpl(Component.java:4762)_
	at java.awt.Container.dispatchEventImpl(Container.java:2294)_
	at java.awt.Window.dispatchEventImpl(Window.java:2750)_
	at java.awt.Component.dispatchEvent(Component.java:4713)_
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)_
	at java.awt.EventQueue.access$500(EventQueue.java:97)_
	at java.awt.EventQueue$3.run(EventQueue.java:709)_
	at java.awt.EventQueue$3.run(EventQueue.java:703)_
	at java.security.AccessController.doPrivileged(Native Method)_
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)_
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)_
	at java.awt.EventQueue$4.run(EventQueue.java:731)_
	at java.awt.EventQueue$4.run(EventQueue.java:729)_
	at java.security.AccessController.doPrivileged(Native Method)_
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)_
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)_
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)_
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)_
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)_
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)_
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)_
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)_

The latest ImageJ daily build (1.51s2) fixes a bug that could cause the “Apply” function of the Edit>Adjust>Brightness/Contrast tool to throw an exception when working with 16-bit images.

Great news, thanks for fixing this issue!