Monday, March 31, 2008

Image Your World With ImageJ

ImageJ is probably one of the most universally-useful, open source programs available for scientists. This is a program designed for image analysis, whether you want to count points, generate an "x-ray" image from CT scan data, calculate moments of area, or measure the length and area of a feature on a photograph.

The "J" in ImageJ stands for "Java" - that platform-independent programming language. This means that you can run ImageJ on virtually any operating system. If you don't have a Java virtual machine installed (and most every system comes with one - if you don't have it, you'll find out when you can't run ImageJ!), the program's website allows you to download a copy with your installation of ImageJ. The only potential downside of running under Java is a small sacrifice in program performance in some situations.

Why Use ImageJ?
The real power of ImageJ lies in its extendability and its updatability. Updates are released for the program every week or two - these usually aren't just bug fixes, but real interface and functional improvements. Furthermore, there are scads of plug-ins and macros available. Want to import DICOM stacks more efficiently? Use a plug-in! Want to measure second moments of area? There's a macro for that! Can't find a macro to do what you want? Write one of your own!

I use two main features in ImageJ: the measurement tools and the stack tools. The measurement tools allow me to measure distances, areas, and other parameters, and I can calibrate these using a scale bar from within the photo. The stack tools are also quite handy for working with CT scan data. I use them to reslice my images in various orientations (say I have a coronal series, and want to look at another view) or to generate quick 3D volume renderings. Other programs (e.g., 3D Slicer) are better for dedicated CT work, but ImageJ is fantastic for quick-and-dirty CT data manipulation. Furthermore, the interface is simple and relatively easy to navigate.

Commercial Alternatives
Probably the closest commercial equivalent to ImageJ is SigmaScan. I used this program a few years back, so I can make at least a superficial comparison. As far as I can tell, the primary benefit of SigmaScan over ImageJ is that the former allows you to save the tracings you've made for area measurements (at least, this is a feature I found handy). A dedicated user would know other unique features, but then again ImageJ doesn't cost nearly $1,000 on academic discount.

Minor Drawbacks
There are a few limitations to ImageJ of which users should be aware. If you're going to deal with large stacks of images (such as a CT scan), you may bump up against problems in the default memory configuration for the program. Fortunately, this is usually resolved by a simple tweak of the initialization file. Also, it is important to remember that ImageJ is for image analysis, not image editing. A few tools within ImageJ (paintbrush, paint bucket, etc.) can help in this regard, but you're really better off going to GIMP for most image editing tasks. And, as mentioned above, you can't directly save and reload any selection boundaries that you might make for measuring area (if you want to remeasure the same area later).

The Bottom Line
All in all, if you measure images or work with CT slices, you want ImageJ on your computer.

Note: I forgot to mention in my initial post two other popular options - NIH Image and Scion Image, available for Mac and Windows, respectively. They have both largely been superseded by ImageJ (and were really precursors to it), but I just want to be complete.

4 comments:

Anonymous said...

Hi, Excellent article
but you can actually SAVE arbitrary selections in ImageJ using the ROI functionality and Save as ... Selection

Cheers

Dimiter Prodanov

Nick said...

Is it possible to record coordinate data (like x,y) values in ImageJ? I'm interested in doing some simple morphometrics, and I was wondering if you can orient the slices obliquely and take the measurements that way.

Unknown said...

Your link to "tweak the initialization file" doesn't work! I'm having the same memory problems when trying to open DICOM stacks from a large CT analysis. How can I fix this?

Andy said...

Fixed it (in the post above, and here's the link again)- thanks for catching the broken link!