Trying to create a Mosaic in ImageJ and I get this Java error

460 views Asked by At

I am trying to stitch images using the MosaicJ plugin in Fiji (ImageJ), however, I get the error in the code below. Does anyone know what it means and how I can fix this please? I have no experience using Java at all. I am using a MacBook by the way if this is relevant.Thanks. Java error

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at ij.gui.NewImage.createFloatImage(NewImage.java:326)
at MosaicJTree.getGlobalImage(MosaicJ_.java:5306)
at MosaicJTree.createMosaic(MosaicJ_.java:4692)
at MosaicJ_.actionPerformed(MosaicJ_.java:222)
at java.awt.MenuItem.processActionEvent(MenuItem.java:669)
at java.awt.MenuItem.processEvent(MenuItem.java:628)
at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:357)
at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:345)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:763)
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:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
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)

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

1

There are 1 answers

0
mzouink On

In your case, you're exceeding the maximum memory available in ImageJ.
So, if your data is not big and it can be handled in the memory. you can increase the memory that ImageJ can use: By: Edit > Options > Memory and Threads.

2- If your data is big, I will recommend using BigStitcher ImageJ plugin. you can find tutorials here: https://www.youtube.com/playlist?list=PLNZz8lLDpAeVOeAmQWMrKGOeB3vv28yJE .

MosaicJ was made a long time ago. So I am not sure if they supports lazy loading mode. or if they are using virtual stacking.

And I will recommend asking in : https://forum.image.sc/ and you can tag @ctrueden or one of the author, it is more effecient than stackoverflow in ImageJ related questions.