Summer Ventures

Image J Lab

What are we doing today? In this lab we will learn how to work with Image J, which is a public domain, Java-based image processing program developed at the National Institutes of Health(NIH).

Before we start the lab create a directory on your PC called Lab 2. The click HERE to save the image, Lab2imag.jpg on your pc. This is the image we will use for the lab.

Where do we begin? Click on the green start icon then scroll up to Programs and then go to Image J and double click on it to open the main panel (Figure 1). Go to file and open shapes.

Figure 1 – The ImageJ Panel

A blown up image of a star, cleaning bottle, yard stick, and two cups should also be up on the screen (Figure 2). We will use this image to learn a bit more about ImageJ.

Figure 2 – Blown up Image

Our objectives for this lab are simple and are centered around three questions:

Can we use image J to measure angles?

Can we use image J to measure distances to scale?

Can we use image J to calculate areas and perhaps even volumes?

Let us tackle the angle problem first.

Measuring angles with ImageJ

The goal for this section is to measure each of the angles on the ten sided star. For this click on the angle tool that looks like this

Upon clicking the tool you will be able to draw two connected lines and measure the angle between them. Draw two yellow lines as parallel as possible with two sides of the star. While keeping your finger clicked down on the mouse, record the angle display at the bottom of the toolbar.

Figure 3 – Angle Selection on the Star

Measuring distance with image J

The goal for this section is to measure the height of the bottle of dry erase board cleaner. The way we will do this is measure a distance in terms of pixels that we already know in terms of metric units. By doing this we can set a scale that will allow the program to automatically convert pixels to the metric unit we want. The object we will use to set the scale is the yard stick. Draw a line using this tool  on the yardstick along a set distance for example, 10 centimeters. While keeping your finger pressed down on the mouse, record the distance in pixels which appears at the bottom of the toolbar. Then click analyze and scroll down to set scale. Click on set scale and a small window should appear. In this window, enter the value for the known distance along the yard stick. The value for the distance in pixels should automatically be there yet go ahead and verify it with the number you recorded. Insert cm in the box labeled unit of length and then click OK. Now that we have set the scale, drag a new line from the top of the cleaning bottle to the bottom and with your finger down on the mouse record the value for the height.

Figure 4 – Straight Selection on the Cleaner Bottle

Measuring area volume using image J

The goal for this section is to calculate the volume of the white cup on the right hand side of the picture. We can do this in two ways. We can first use the left-hand upright view of the cup to measure the height as we did with the cleaning bottle, using the same scale that was set. We can then measure the diameter of the top and bottom of the cup in a similar fashion. Once we know the diameters of the top and bottom and the height we can calculate the volume using the following formula:

Volume = 1/2(Area of top + Area of bottom) x Height

Area = πr­2

The second method for calculating the volume of the cup utilizes image J’s ability to calculate areas. For this we will look at the right-hand view of the white cup. Click on the elliptical selection tool that looks like this. Use this tool to draw a circle around the top rim of the cup. Adjust the circle by pulling on the white dots that appear on the edges.

Figure 5 – Elliptical Selection on the Cup

Then click on analyze at the toolbar. Click on measure and a table will come up with a calculated area. Record the number for the area. Repeat this process for the smaller circle at the bottom of the cup. Use these two values along with the previously calculated height in the volume equation.