Introduction To ImageJ
Introduction To ImageJ
24-bit RGB
8 bits each color at each pixel
# of bits per pixel Range of intensity Image Type Computer
Bits (N) levels Representation
(0 2N-1) (C types)
8 0 - 255 grayscale unsigned char (8 bits)
10 0 - 1023 grayscale unsigned short (16 bits)
12 0 - 4095 grayscale unsigned short (16 bits)
16 0 - 65,535 grayscale unsigned short (16 bits)
24 0 – 16,777,215 grayscale unsigned int (32 bits)
3x8 0 - 255 per channel RGB unsigned int (32 bits)
4x8 0 - 255 per channel RGB with alpha unsigned int (32 bits)
The number of bits determines the number of intensity levels that can be digitally
encoded.
For non-power-of-two bits per pixel the image is usually stored in the next higher-up pixel
format.
Example: 10-bit image stored as a 16-bit TIFF. Only values 0-1023 would be used.
What sets the # of bits and pixels?
The physical device capturing the image sets the number of pixels
The electronics that convert light intensity to an electronic signal sets the number of bits.
The image as Pixel (spatial) Charge levels are read out 8-bit digitization assigns the
projected onto resolution set when by a digitizer with a fixed values shown.
the CCD chip. chip is manufactured. number of bits per pixel.
Charge accumulates Charge levels over the
per pixel during maximum bit value are
exposure. saturated.
Color Acquisition
Color in an image can be acquired in
many ways. Here’s 2 out of many.
214
A term for printing where dots of ink are physical printed to a page
PPI: Pixels per Inch is the digital equivalent
The number of pixels in an inch (as on a monitor)
DPI and PPI are often used interchangeably 195
Lossless compression:
PNG format, TIFF, JPEG2000, others
Does not alter the image
A ZIP file is a non-image example of lossless compression Format Size (bytes)
Original
Orig – JPEG:
Same B&C)
The JPEG algorithm compresses an image by removing detail from the image before
performing a lossless compression
High-frequency information is discarded
Sharp transitions in contrast
Changes in color hue
Outline…
Notable features:
Written in Java and runs on many platforms: Windows, Linux, Mac OSX, and more
Supports reading & writing a wide variety of image formats
Many built-in image processing tools
Can be programmed using a built-in macro system or scripts written in a variety of languages
R, Python, Java, and more
Your own custom code can be added to your ImageJ install as a plugin and used like any
other program feature!
Fiji
Open up ImageJ
On the training terminals double click on the
shortcut:
RCS Tutorials ImageJ ImageJ shortcut
ImageJ shortcut
A small tool and menu window will open:
Opening Images
Use the selection tools to select an area of the image (circular, rectangular, etc.)
Hold the Shift key to do multiple areas.
Choose the menu option Image Crop
The image will be cropped to the minimum bounding box on the selection.
Histograms
What should the pixel resolution should you use to meet the
requirements? (DPI pixels per inch aka PPI)
Minimum spec of 300 DPI: 300 dots per inch X 4.75 inches = 1,425 dots (pixels)
wide.
Overachiever spec of 600 DPI: 600 dots per inch X 4.75 inches = 2,850 dots (pixels)
wide.
DPI vs. Pixels Example
Using the 600 DPI target and 4.75 inch width.
The profile data was extracted for each resized image using the List button in the lower
left of the Plot window.
Choose PluginsMacroRecord
The window that opens will now record your commands.
Leave it open!
Sample fluorescent image measurement
Open image TfnR-A555-Rab11-A647-341-
01.tif
Provided by John Chamberland of BU
The red is transferrin receptor, a carrier protein
The green is Rab11, an enzyme
Imaged to investigate when these molecules are
colocalized.
Click HelpUpdates
Click the Manage Update Sites button
Click a site or too, then click the Close button.
New plugins can now be installed.
Measuring Images
Example 2
Open banana.png
Click the straight line tool, then
draw a line between some of
the centimeter marks on the
ruler.
Choose AnalyzeSet Scale.
Set the Known distance to the cm’s
you choose.
Set the Unit of Length to cm
Press Ctrl-Shift-A to remove the
line.
Measurements cont’d
This is an RGB image, choose
ImageType8-bit to convert it.
Raster
TIFF, PNG, BMP, JPEG, GIF, JPEG200 (and many more!)
i.e. files ending in .tif, .png, .bmp, .jpg, .gif, .jp2
Vector
Portable Document Format - .pdf
PowerPoint - .ppt
Adobe Illustrator - .ai
Photoshop - .psd
PostScript - .ps
Encapsulated PostScript - .eps
Drawing and CAD packages
Scalable Vector Graphics - .svg
Vector vs. Raster
Vector images can be scaled to any size
or resolution.
Typically produced when creating computer graphics
(plotting, drawing, diagrams, text, etc.)
Example: TrueType fonts
Raster images:
Scaling up or down requires a mathematical
transform on the original image.
Re-scaled raster images are not identical to the
original, and the original image may or not be
recoverable from a re-scaled version.
Produced by physical image acquisition: cameras,
scanners, etc.
From: https://en.wikipedia.org/wiki/Vector_graphics
Vector Image Files
0 0 0 128 0 0 255 0 0
Additive color
Computer monitors, where different intensities of red, green, and blue combine in each monitor
pixel to be interpreted by the brain as a specific color. The background of the monitor is black.
Subtractive color
Printer inks absorb different wavelengths from white light.
The background of the image is white (e.g. a sheet of paper)
The primary ink colors are cyan, magenta, yellow, and black, abbreviated CMYK.
CMYK example
Subtraction from white
Cyan subtracts red
Magenta subtracts green
Yellow subtracts blue
https://en.wikipedia.org/wiki/CMYK_color_model
From: http://www.printingforless.com/rgb-cmyk.html
CMYK colors cannot be represented in a 1:1 correspondence with RGB values. The
space of colors they represent (the “gamut”) do not perfectly overlap.
Some colors in RGB cannot be represented in CMYK.
Which means you can’t print some monitor colors.
Monitor RGB printer CMYK calibrations are needed!
This usually isn’t noticeable in color photos but can be significant in plots
and graphics.
One more representation: HSB
HSB: Hue – Saturation – Brightness
Sometimes HSV Value instead of Brightness