Title: ImageJ, A Useful Tool for Image Processing and Analysis
1ImageJ, A Useful Tool for Image Processing and
Analysis Joel B. Sheffield Temple
University Dedicated to the memory of Dan H.
Moore (1909-2008) Presented at the 2008 meeting
of the Microscopy and Microanalytical Societies
2- Why Image Processing?
- To improve the appearance of the image.
- To bring out obscure details in an image.
- To carry out quantitative measurements
3Part I. Introduction to ImageJ History Advantag
es Resources Macbiophotonics Mailing
List Wiki Burger and Burge Basic Menu
Structure
Part II Special Issues Operations on all
pixels in an image The histogram Brightness
Contrast Look Up Tables RGB color Aspects
of Analysis of an Image Measurement Calibratio
n Areas and Densities Confocal
Series Bandpass Filter
4http//rsb.info.nih.gov/ij
5ImageJ
- An adaptation of NIH image for the Java platform.
- Can run on any computer systems that can run Java
(Sun Microsystems) - Open source
- Two powerful scripting languages
- Java Plugins
- Macro Language
- Continual Upgrades
- Active community of several thousand users
6Resources
ImageJ Web Site http//rsb.info.nih.gov/ij
Macbiophotonics http//www.macbiophotonics
.ca/imagej/ Wiki http//imagejdocu.tudor.lu/ B
urger and Burge (a real book!) Digital Image
Processing, An Algorithmic Introduction using
Java Springer Verlag, 2008
7Introduction to the Main Menu
- Of these, well concentrate on
- Image
- Process
- Analyze
- Plugins
- Help
8Image Menu
9Process Menu
10Analyze Menu
11Plugins Menu
12Help Menu
13The Image Histogram
Log Scale
The histogram shows the number of pixels of each
value, regardless of location. The log display
allows for the visualization of minor components.
Note that there are unused pixel values
14In this case, the log display indicates that
virtually all pixel values are used, even though
they are a small percentage of the total.
15Brightness Adjustment
The brightness adjustment essentially adds or
subtracts a constant to every pixel, causing a
shift in the histogram along the x axis, but no
change in the distribution
16Contrast Enhancement
For contrast enhancement, a lower value, in this
case, 88, is set at zero, and a higher value,
166, is set at 255. The values of each of the
pixels are adjusted proportionately. Note that
because of the integer values, not all of the
pixel values are used.
17Look-Up Tables 8-bit images have no inherent
color values. We normally assign values to each
of the pixels according to a table. Because of
earlier display devices, these values were shades
of gray. As displays improved, it became
possible to assign specific colors to given
values. In ImageJ, there are three
representations of LUTs.
18Since some of these images, such as a
fluorescence micrograph are of colored objects,
it is useful to apply a color LUT to match the
expected image, or to enhance it, even if the
camera was monochrome.
19The other way to treat color is to assign a set
of 3 values, for Red, Green and Blue to each
pixel. For common color images, each of the
three colors is represented as an 8-bit value.
One can think of a color image as consisting of
three planes, one for each of the primary colors
20As we move the cursor over different parts of the
image, the color values appear in the status bar
of the program.
A color histogram is available, In the
AnalyzegtToolsgtMisc. menu
21This can be used to correct white balance in
micrographs
Select an area that is to be white. Determine
the adjustments necessary for each channel, and
use the RGB Recolor plugin to balance the values
Adjust brightness and contrast
22Conversion to grey scale
Since many operations will work only on grey
scale images, it is necessary to consider how the
conversions from color images can be
accomplished. There are two approaches, dependent
on the type of image.
The simplest is to select the image, go to
Imagegttype, and select 8-bit, or 16 or 32 bit.
23However, some images, such as fluorescence
micrographs taken as RGB images, can yield
surprises.
The reason that the image is so dark is that the
routine averages the three channels (rgb) to
generate the image. Since there is no data in g
or b, the values for the red channel are divided
by 3, yielding a dark image.
24We can overcome this by separating the three
channels and discarding those with no data.
25Compare the two 8-bit images, after correction
for brightness
8-bit
Channel separation
Because of the reduction in values in the 8-bit
conversion, there are fewer values in the
histogram.
26Color Merge Many fluorescence images are taken in
single channel images which are often merged to
generate a single overlapped image.
Some cameras generate rgb images even of single
color fluorescence In that case, the images have
to be converted to 8-bit before processing.
27Another Issue colors gray scale
What happened?
28The value at any pixel is the sum of all four
channels. Remember that the gray channel
actually has values for r,g, and b. These are
added to the other values, and exceed the 255
limit.
Since the image is a composite (i.e. each plane
is represented separately and the images are
combined), we can divide each of the planes, so
that the maximum value of the additions is less
than 255. We can then adjust brightness and
contrast to compensate without exceeding the
limit.
29Convert to RGB and adjust
Divide by 2
30Confocal Microscope Series
31Merge the Red and Green
32Creating a 3D Rotating Image
33Bandpass Filter to smooth background
34- Image courtesy of Wu Yuhong
- It is RGB
- Low contrast
- Uneven background (stripes from a scanner)
- Size is given as 1.54x1.18 inches
35- The goal is to count, and measure the spots.
- The approach has to evolve, but here are the
essential elements - Since all of the spots appear to be black, color
is not significant, and one can use a monochrome
image. - The background must be dealt with.
- The spots need to be discriminated from the
background several options. - We can scan a line across the image, storing the
coordinates.
Note the slight rise upwards, Also the range,
from 140-ish to 130 or so for the largest dot.
36Adjust contrast and brightness according to the
histogram
37Separate channels, scan each.
red
green
blue
It appears that the greatest difference between
the background and the signal is in the red
channel, but there are stripes on the image.
38(No Transcript)
39we can use the graph of the image to make a rough
determination of the threshold, and then tune it
by looking as the selection.
40Exclude very small objects by selecting a size gt
10
But look at these measurements!
41Lets take a closer look at the original
image Specifically the dimensions as given in the
header.
We can see how ImageJ decided on these numbers by
looking at the ImagegtProperties menu item. Note
that it lists the unit of length as the inch, and
the width of a pixel as 0.001667
Where did that come from? Well, if we look at
the image with another program, IrfanView, or
Photoshop, we will discover that the image is
listed as containing 600 dpi. That information
is encoded in the tiff header for the image. It
is not listed in jpg versions. So, in its
wisdom. ImageJ reads the 600 dpi and calculates
the number of inches that would be taken up by
926 pixels. Since the original image was
obtained from a scanner, using 600 dpi as a
standard, this is reasonable.
42We can change the unit of length to, say, mm, and
the pixel width changes to adjust. The results
of the analysis, then, are presented in mm,
rather than inches.
We have discovered that the camera we use for
micrography also includes a value of 96 dpi in
our images, which has to be corrected. The value
of 96 is, we assume, related to print size. At
any rate, we have to restandardize each image.
43For more information, the web site is
http//rsb.info.nih.gov/ij