Frequently Asked Questions
- Why is open software vital to science?
- What is the difference between ImageJ, ImageJ2, ImageJDev, ImageJX, ImageJA, etc.?
- How can we be sure that ImageJ1, ImageJ2 and Fiji aren't going to diverge or fork over time?
- Would it make sense to merge the ImageJ2 and Fiji projects?
- Would it make sense to create a version of ImageJ for the web browser, mobile devices, etc.?
- How are you addressing the fact that with increased modularity comes increased complexity?
- With Oracle buying Sun and Apple deprecating Java, does Java have a future?
- Why does ImageJ2 still target Java 6?
- Will ImageJ1 macros, plugins and scripts still work in ImageJ2?
- Does ImageJ2 support the ImageJ macro language? Is it deprecated?
- How can I call ImageJ from my software?
- Can I call ImageJ1 API from an ImageJ2 command?
- Can I call ImageJ2 API from an ImageJ1 plugin?
- How do I set up Java 6 on OS X?
- How do I avoid OutOfMemoryErrors?
- How can I call ImageJ from MATLAB, or vice versa?
- How do I run ImageJ in debug mode?
One core principle of the scientific method is repeatability: the ability to continually retest and refine hypotheses. As computer software plays an increasingly large role in science, it is vital that that software be fully transparent and available to researchers: software is simply too complex to be easily reproduced from scratch by every research group. In contrast, closed source software presents a barrier to open research, because the implementation details of algorithms cannot be freely modified or even necessarily verified.
The Science Code Manifesto provides a clear and succinct list of five principles surrounding scientific software. There have also been a number of publications in recent years discussing these issues and ideas:
- Ten Simple Rules for the Open Development of Scientific Software (PLOS Computational Biology, Dec 2012)
- A call for bioimaging software usability (Nature Methods, Jun 2012)
- Current challenges in open-source bioimage informatics (Nature Methods, Jun 2012)
- Publish your computer code: it is good enough (Nature, Oct 2010)
- Metadata matters: access to image data in the real world (Journal of Cell Biology, May 2010)
Further, we strive for ImageJ to be a community driven project. It is not merely an open source product, but an open source process. ImageJ follows open development practices, and provides open development tools online:
- Public source code repositories including complete development history.
- Public issue tracker and roadmap.
- Public mailing lists for open discussion.
- Public wiki for community contributed content.
- Jenkins, ImageJ's public continuous integration system.
- Public Maven repository for ImageJ binaries.
Using these resources, you can always observe the latest progress of the project, get an idea of where the project is heading, contribute code to the project yourself using GitHub, or write documentation, tutorials and other information on the wiki.
There are a few different flavors of ImageJ with very similar names, and some confusion is inevitable. Below is a table which should help to clarify the purpose of each. For the historical context of these projects, see the History of ImageJ.
|Wayne Rasband||The current, stable version is known simply as "ImageJ"—or sometimes "ImageJ1" or "IJ1" to differentiate it from ImageJ 2.0 (still in development).||1997||Active|
|ImageJ developers||The ImageJDev project (this web site and associated community) is developing version 2.0 of ImageJ, referred to as "ImageJ2" or "IJ2" for short. It is a complete rewrite of ImageJ, but includes ImageJ1 with a compatibility layer, so that old-style plugins and macros can run the same as in IJ1.||Dec. 2009||Active|
ImageJA is a project that provides a clean Git History of ImageJ1, with a proper 'pom.xml' file so that it can be used with Maven without hassles.
It is what Fiji uses (see below) at its core.
Fiji is Just ImageJ, with extras. It is a distribution of ImageJ with many plugins useful for image analysis in the life sciences, an automatic updater, and improved scripting capabilities. It is actively maintained, with updates released often.
We recommend Fiji as the preferred version of ImageJ.
|MBF ImageJ||Tony Collins|
It went hand in hand with a comprehensive manual describing how to use the bundle with light microscopy image data. It was a great resource by microscopists, for microscopists. Unfortunately, the manual went offline in late 2012. Nonetheless, it is often possible to add specific plugins from MBF ImageJ to a Fiji installation, combining the best of both programs.
|ImageJ2x||Rawak Software||ImageJ2x is a fork of ImageJ1, modified to use a Swing interface.||Unknown||Last update:|
|SalsaJ||EU-HOU||SalsaJ is a closed-source fork of ImageJ1 intended for use with professional astronomy images. It was designed to be used in classrooms, and has been localized into over 30 different languages.||Unknown||Last update:|
ImageJX was created as a means to discuss and explore improvements to ImageJ. There was an ImageJX mailing list as well as an ImageJX software prototype.
The ImageJX software prototype was a proof of concept—an attempt to reorganize ImageJ's internals to make it more flexible. The prototype demonstrated this flexibility by recasting the program in Swing. The ImageJX project formed the basis of an application to NIH for funding, which is what launched the ImageJDev project (see above).
|Mar. 2009||Superceded by ImageJ2|
|NIH Image||Wayne Rasband||NIH Image is a public domain image processing and analysis program for the Macintosh. It is the direct predecessor of ImageJ, and is no longer under active development (though see ImageSXM below).||1993 or earlier||Superceded by ImageJ|
|ImageSXM||Steve Barrett||Image SXM is a version of NIH Image that has been extended to handle the loading, display and analysis of scanning microscope images.||May 1993||Active|
We are working to create an architecture where the programs work together and preserve compatibility. Fiji is just ImageJ with extras, and ImageJ2 includes ImageJ1 as-is for maximum compatibility. We plan to upgrade Fiji's core to ImageJ2 as soon as it is ready. Most importantly, all involved developers are strongly dedicated to avoiding divergence—we are working closely with both Wayne Rasband and the Fiji team to ensure that ImageJDev represents a continuation of ImageJ and Fiji, rather than a project fork.
Fiji and ImageJ2 are fundamentally the same software, using the same launcher. However, if you download Fiji from fiji.sc and run it, it starts up in ImageJ1 mode at the moment. But Fiji includes ImageJ2 too, and you can launch it in that mode instead if you prefer—or switch to ImageJ2 mode after launching using the "Switch to Modern Mode" command under the Help menu.
From the standpoint of development effort, the ImageJ2 and Fiji projects have indeed merged. ImageJ2 is the core software, and several pieces of infrastructure originally developed for Fiji have now migrated to ImageJ2 (e.g., the Updater, Launcher and Script Editor components). At heart, Fiji is now a big collection of life sciences plugins (though "Fijabcolsp" doesn't have quite the same ring to it). In other words, Fiji is just an ImageJ update site ("Fijius")—and as such, you can obtain a working Fiji installation by downloading ImageJ2, running the updater, and enabling the Fiji update site.
Ultimately, we probably do not want to get rid of the two distinct web sites and project names, since people are familiar with both. That said, we are integrating resources when feasible: e.g., the ImageJ wiki and the Fiji wiki are really both the same wiki with different skins, to make cross-linking more seamless. But we want to ensure it is clear that ImageJ2 is not a life-sciences-specific project, whereas Fiji is. Historically, because Fiji has a life sciences focus, there have been some users who refused to switch from vanilla ImageJ1 to Fiji even though Fiji makes users' lives easier in lots of ways. With ImageJ2, we want to avoid such misconceptions.
More effort is still needed to clarify web resources, to explain concisely and clearly where people should go in different circumstances. We also have plans to make bug reporting simpler and easier across the projects.
We are developing ImageJ with a careful eye toward modularity, avoiding gratuitous dependencies—particularly on AWT, which is not available on most mobile devices. We hope this approach makes it easier to port ImageJ to additional platforms in the future.
The key idea is to provide sensible defaults (e.g., the big green Xerox button) as a way of dealing with complex software programs. We also embrace the philosophy of convention over configuration utilized by many large software projects in recent years.
Yes. Java is one of the most popular programming languages and still one of the top choices for high-performance, cross-platform applications. Oracle is unlikely to attempt to "kill" Java, but even if they tried they probably couldn't—OpenJDK is open source and there is a massive community of Java developers behind it. Now that Apple is partnering with Oracle and the OpenJDK community, we are likely to see Java on Mac OS X get better, not worse. Java's popularity will eventually wane, but not because of any company's actions now. Rather, as with any programming language, new technologies will emerge and gain popularity, over a course of many years.
Yes. We are completely committed to 100% backwards compatibility with ImageJ1. ImageJ2 includes the latest version of ImageJ1 "under the hood" so that existing macros, plugins and scripts will still run the same as before.
We have even gone so far as to model the ImageJ2 user interface after ImageJ1 to a very large extent, with all the same shortcut keys and behaviors whenever possible. ImageJ2 looks and feels like ImageJ1, but with a powerful new infrastructure allowing it to process a wider variety of image data more quickly and easily.
We have managed to create an almost-totally-compatible Beanshell version of the ImageJ1 macro language. As of this writing, it still needs a bit more work, but we believe that most ImageJ1 macros will run unchanged in ImageJ2, while also allowing to mix and match any Java API calls—something that was previously not possible with the macro language.
The ImageJ1 macro language has been extremely useful to many users. However, it has a substantial limitation: its functions are separate from those available from Java and the other scripting languages. In ImageJ2 the goal is to provide one unified set of functions, which is fully accessible from Java and all scripting languages. The Beanshell-based macro language helps to meet that goal, and also makes the reverse possible: calling macro functions from other scripting languages and from Java.
ImageJ2 plugins and scripts are more flexible than ImageJ1 plugins and macros. They can run headless on a server, and are accessible from various applications such as CellProfiler, KNIME, OMERO, and headless from the command line. We would encourage newly developed scripts and plugins to use the ImageJ2 API since it offers these advantages, but the ImageJ1 API will remain accessible, too.
If your software is written in Java, we recommend using Maven to structure your project. You can then add dependencies to portions of ImageJ that are of interest to you. See the ImageJ tutorials for examples.
If your software is written in another language such as C++ or Python, there are many ways to integrate Java functionality. You must choose which one is best for your particular requirements.
To facilitate some use cases, we provide a script for generating a combined bundle of all ImageJ-related JARs in a single "uber-JAR" library. To use, check out the ImageJ source code and execute:
For convenience, we provide a build of this combined JAR file from the latest DEVELOPMENT, UNSTABLE version of ImageJ:
This build includes the latest changes on the master branch of the source repository. It has not been thoroughly tested and may contain new bugs.
In some cases, use of this JAR file is appropriate and convenient; for example, CellProfiler uses it to integrate with ImageJ. However, you should consider carefully what would be best for your project:
Advantages: A single JAR file is simpler to deploy. There is no chance of mismatched versions of multiple JAR files. It is easier to construct a Java classpath, since only a single JAR needs to be included.
- Every time you need to update the version of ImageJ, you must redeploy the entire uber-JAR (~48 MB as of October 2013). If you bundle individual JAR components, you need only update those that changed. This issue is of particular relevant to Java applications deployed via Java Web Start, since it automatically downloads the latest available version of each JAR dependency; in that case, your application startup time will suffer if you use the uber-JAR.
- You cannot cherry-pick only the JARs containing the functionality you need, so your application's footprint may suffer from bloat.
- If you rely on any of the same dependencies that ImageJ does, you may run into trouble (e.g.,
NoSuchMethodErrors) with multiple copies of those dependencies on your classpath, especially if you need to use a different version of that dependency than is bundled with the uber-JAR.
As you can see, it is important to understand how use of the uber-JAR will affect your application. In particular, Java applications will likely be better served using the individual component JARs, ideally managed using a dependency management platform such as Maven or Ivy. But for non-Java applications, the uber-JAR may be sufficient to your needs.
We recommend running ImageJ using Java 6 rather than Java 7, since Java 6 is more stable. Unfortunately, newer versions of OS X come without Java installed, and only Java 7 is available from java.com.
However, you can reinstall Java 6 on OS X. You must log in to developer.apple.com with your Apple ID, search for "java" and download the latest Java 6 SE.
At any time, you can verify which Javas are installed on your system using this script.
The first thing to do is make sure that ImageJ has a large enough "maximum heap" size:
- Edit > Options > Memory & Threads
- Change "Maximum Memory" to something larger (at most, 1000 MB less than your computer's total RAM).
Note that if you downloaded ImageJ recently (or are using the Fiji distribution of ImageJ), the ImageJ launcher will already have guessed at a reasonable value: ~75% of physical RAM.
If you are already at the limits of your computer's physical memory, the next step would be to add more.
About Java garbage collection: Java always automatically calls the garbage collector when the heap is getting full . While it is possible to manually invoke the garbage collector by clicking ImageJ's status bar—or programmatically by calling
run("Collect Garbage") in a macro or
System.gc() in a plugin—it will not solve the fundamental problem of Java actually not having a sufficient amount of memory. (The only exception to this is a rare case where Java decides that garbage collection is happening too slowly, in which case you should see the message "GC overhead limit exceeded" ).
If you are looking to call ImageJ code from your MATLAB script, it is actually quite simple. Just embed the calls to fully qualified Java class methods directly in your scripts. MATLAB takes care of transparently converting between Java primitive types and arrays and its own matrices and cell structures. The Fiji distribution of ImageJ provides a helper program called Miji to simplify this approach even further. See the Miji page for further details.
Conversely, if you are looking to evaluate MATLAB code from within an ImageJ plugin or other Java code, MATLAB provides an interface called JMI for doing it. However, for it to work, you must launch your program from inside the MATLAB environment, so that it runs with MATLAB's JVM.
One easy way is to launch with the
DEBUG environment variable set:
On Linux (from a console):
On OS X (from Terminal):
DEBUG to your environment variables, then run ImageJ as usual. You may need to log out and back in again first though.
More control: You can control the log level more precisely by setting the
scijava.log.level system property. E.g., on Linux:
$HOME/ImageJ.app/ImageJ-linux64 -Dscijava.log.level=trace --
Valid levels include:
Debugging the launcher: You can rename the executable from
debug before launching, and the launcher will be more verbose about what it is doing.