1 .Introduction to ImageJ 8 Sept 2009 Jacqui Ross General Comments: ImageJ is a public domain image processing program. It was written by Wayne Rasband at the Research Services Branch (RSB) of the National Institute of Mental Health (NIMH) which is part of the National Institutes of Health in Maryland, USA. The predecessor to ImageJ, NIH Image was originally only available for Macs but later the PC version Scion Image was developed. ImageJis based on Java/javascript (Sun Microsystems) and will run on any platform. ImageJ has become a standard tool in many laboratories around the world because it is free, open source, and very well supported. The website address is: http://rsb.info.nih.gov/ij/index.html You can download the program from http://rsb.info.nih.gov/ij/download.html . This seminar will introduce you to some ofImageJ’s features and some basic concepts. Portions of the handout have been lifted from the manual and other materials which can be found on the ImageJ homepage. Associate Professor Alistair Young, the Director of the BIRU, has also kindly provided material, some of which is currently used in our Advanced Biomedical Imaging course (MEDSCI 703) There is a mailing list that you can subscribe to at: http://rsb.info.nih.gov/ij/list.html . You can arrange to get a “digest” sent to you each day if you don’t want each message coming through independently. I recommend this ifyou are using the program a lot but otherwise it’s not necessary since you can still search the archives without being a subscriber. There is some documentation available here: http://rsb.info.nih.gov/ij/docs/index.html and there is also a Documentation WIKI being developed at: http://imagejdocu.tudor.lu/ Plugins Plugins are additional software module s or code which provide the ability to perform specific tasks. There is a plugins collection available at: http://rsb.info.nih .gov/ij/plugin s/collection.html Many more are available on the website and from other users. There is a list of available plugins here: http://rsb.info.nih .gov/ij/plugin s/index.html Some people have developed their own collections of plugins and bundled them together. For example, Tony Collins from the McMaster Biophotonics Institute, (previously at WCIF), has a great collection for microscopy: http://rsb.info.nih.gov/ij/plugin s/mbf-collection.h tml He also provides excellent information about the plugins on his Biomedical Imaging Research Unit School of Medical Sciences Faculty of Medical and Health Sciences The University of AucklandPrivate Bag 92019 Auckland, NZPh: 373 7599 ext. 87438http://www.auckland.ac.nz/biru/ [email protected]
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
website: http://www.macbiophotonics.ca/imagej/ As new updates are released, some of the most useful plugins
are incorporated into the core program.
Macros
In addition to plugins, it is also possible to write macros using the ImageJ macro language. This allows you to
string a series of commands together to perform operations that you may want to do repeatedly. These can also be
converted to plugins.
Memory
You can change the memory allocation (RAM) if necessary by going to Edit-Options-Memory . Make sure that you
don’t exceed the capability of your computer. You shouldn’t go beyond 75% of your RAM capacity.
Opening Files
File-Open: opens TIFF (uncompressed), GIF, JPEG, DICOM, BMP, STK, video and FITS images. It also opens
lookup tables (LUT), text files, regions of interest (ROIs), etc.
File/Import: provides access to plugins for reading RAW files, images in ASCII format, and for loading images
over the network using a URL. To import a raw (one byte or 8 bits per pixel) file, you must know the image size (eg.
480x640 pixels) and the offset to the image data.
Files can be opened in groups by selecting them and dragging and dropping them on the ImageJ icon. You can
also open files from a series (x-y, lambda, z) by using File-Import-Image Sequence. The files should be named in
numerical order. ImageJ will then create a stack for you of the data. There are also lots of individual pluginsavailable for opening files from particular imaging systems (e.g. Zeiss .zvi).
The most useful plugin for importing/opening files is the Bioformats plugin, which is available here:
http://www.loci.wisc.edu/ome/formats.html. It will allow you to open a large variety of different file formats.
File/Revert : allows you to revert to the last saved version of the image.
File Save: files can be saved in TIFF, GIF, JPEG, AVI, etc. , tab-delimited text, and raw formats.
• Grayscale and RGB pixel values and X, Y pixel coordinates
Tools
There are a number of drawing tools on the LHS of the toolbar. Red triangles (as indicated by the arrows below)indicate more tools/options which are available either by right or left hand mouse click or double-clicking.
Analyze-Tools-ROI Manager allows you to have multiple ROIs active. It will also allow you to move them, save
them and measure them.
Other Tools
Lines: Allows you to draw straight, segmented or freehand lines. Double-click on the tool to change the line width.
Go to Edit-Draw to make the line permanent or Ctr-D.
Arrow : You can create arrows by using the arrow tool. Double-click on it to change the properties.
Grid : You can also apply a “grid” to use with this tool by downloading the grid plugin
(http://rsb.info.nih.gov/ij/plugins/grid.html)and installing it. You can specify the size of the grid and it can be shown
as lines, crosses or points.
Magic Wand: Allows you to trace the outline of an object by looking for the edges. It works best if the object hasbeen thresholded and made binary (black/white) for maximum contrast. You can select multiple objects such as
cells by holding the shift key down as you go. The tolerance can be set to include a greater range of grayscale. The
selections can be added to the ROI Manager.
Text: Double-click on the tool to change the options. If the image is grayscale, then text can only be black or white.
If you want coloured text, you need to change the image to colour. The colour of the text will be whatever has been
specified as foreground colour. Move it to where you want the text to appear and then go to Edit-Draw (Ctrl-D).
Eyedropper: Allows you to choose the background and foreground colours by double-clicking on the eyedropper
and choosing colours from the Colour Picker. Click on the tiny arrow to swap the foreground and background
colours. The colour of the eyedropper then shows the foreground colour while the box around it shows the
background colour.
Magnifying glass: Use the Left mouse button to zoom in (magnify) and the right mouse button to zoom out
(reduce). Next to the name in the title bar of the image, you will see the % of the image currently displayed.
Hand: useful when viewing a magnified image or an image that is larger than the screen will allow to display. Click
on the image and hold the mouse button down whilst dragging the mouse. The image will pan with the mouse.
Colours
Edit-Options-Colors: Allows you to set colours for background, foreground & selections.
Image Properties
Pixels and Grayscale: Digital images are made up of "pixels" (short for picture elements). Each pixel is a spot with
a given intensity or greyscale value which is an integer, e.g. in the range 0 (black) to 255 (white) if it is 8 bit, 0-4095
Window/Level (W&L) also changes pixel values. Shown below is the W&L window. Note the position of the
histogram in the W&L window.
Now that changes to the LUT have been applied, you can see that the histogram has moved over to the RHS, theimage is not as black in appearance and the minimum and maximum values are closer together. In this case, the
result is less contrast and apparently higher background in the image.
Color balance: allows you to change the colour balance. An additional plugin from the MBF bundle (also called
Colour balance) allows you to draw a ROI in a white area and then white balance the image (Plugins – Colour –
The Process menu contains image processing filters and other operators used for enhancing images or
segmenting features for image analysis.
Filters
Filters represent group processing rather than individual pixel operations. There are many things you can do to
change (e.g. improve) the look of the image or make analysis/thresholding easier, eg. sharpen edges, reduce
noise, subtract background, etc.
Filters are not limited to rectangular selections. The entire image is filtered if no selection is active. They work best
on greyscale images. (Remember that if you have an RGB image, you can split the channels, apply the filters you
want, and then merge again).
Most of these filters in ImageJ (with the notable exception of Rank Filters such as maximum, minimum, etc), areimplemented using 3 x 3 spatial convolutions. In this procedure, the value of each pixel in the selection is replaced
with the weighted average of its 3 x 3 neighbourhood.
I have included some details on how the 3x3 tables differ for two of the filters.
The 3 x 3 tables shown below are the coefficients (weighting factors) for the filters. The popularity of plus and
minus one in these tables is due to the fact that multiplication by one is very efficient, i.e., it is unnecessary.
Smooth - Blurs (softens) the selected area. It can be used to reduce noise in an image or to even out
the greyscale in the area.
1 1 1
1 1 1
1 1 1
Sharpen - Increases contrast and accentuates detail in the selection, but may also accentuate noise.
-1 -1 -1
-1 12 -1
-1 -1 -1
Rank filters rank (sort) the nine pixels in each 3 x 3 neighborhood and replace the pixel with the median, minimum
(lightest), or maximum (darkest) value. Use the Median filter to reduce noise. This removes high values for the
target/central pixel which might be due to electronic noise. A lower value is inserted. This is repeated on the next
pixel, etc. until the whole image is treated. It gets rid of noise without causing significant blurring of the image.
Despeckle is also a median filter. It replaces each pixel with the median value in its 3 x 3 neighborhood. Median
filters are good at removing salt and pepper noise.