Biomedical Imaging Research Unit School of Medical Sciences Faculty of Medical and Health Sciences The University of Auckland

Private Bag 92019 Auckland, NZ Ph: 373 7599 ext. 87438 www.auckland.ac.nz/biru/ jacqui.ross@auckkland.ac.nz .

ImageJ Seminar: Introduction to Image Analysis Jacqui Ross
Image analysis questions 1. What do you want to measure in order to get meaningful data? • • • • • Area Intensity Colour Orientation Distance, velocity, etc. • • • •

13 October 2009

Number of particles (e.g. cells) Size/distribution of particles Particle shape Colocalisation

2. • •

Do you need to work in colour or grayscale? RGB split channels Convert to 8bit grayscale • • Colour thresholding Colour deconvolution

3. •

Do you want to measure the whole image or specific regions? Do you need to select the regions using one image and apply it to another? Regions of Interest (ROI) and ROI Manager

4. Do you need to use processing filters to facilitate segmentation? • • • Background subtraction Edge detection Enhance contrast • • Median filter Unsharp Mask/Sharpen

5. • •

Do you need to fill holes or separate joining particles? Fill holes/Erosion/Dilation/Open/Close Watershed

6. •

Are you measuring relative intensities or do you need to calibrate using standards? Calibration 1

AREA MEASUREMENTS
Manual approach: measure the area of structures by drawing a region of interest (ROI) around them with one of the drawing tools, e.g. freehand, ellipse, rectangle tool. 1. 2. 3. Open the image. Draw the ROI. Go to Analyze-ROI Manager. Then go to Analyze-Set Measurements to select the parameters that you want to measure. 4. Click on Measure in the ROI Manager window. Results will appear in a Results window. These results can be saved and are .xls files, i.e. can be opened in Excel. If you go to Analyze – Measure instead of using the ROI Manager, then you will get results for the entire image, not just the ROI. 5. You can draw multiple ROIs and add them to the ROI Manager. You can move the ROIs and update them, rename them, etc. You can also save the set of ROIs. This is a really good idea as a record of what you have measured. That allows you to reload them or use them on another image. You can also draw the ROIs onto the image and save it as a record. Note: measuring lines or angles manually works the same way except that you select one of the line tools or the angle tool.

Threshold approach: use thresholding followed by binarising to segment the stained area which you wish to measure (for area measurements where you are not interested in intensity). 1. Open the image. Change to grayscale (Image – Type – 8bit) or go to Image – Color RGB Split. 2. Go to Image – Adjust – Threshold. You can select the Auto setting or alternatively move the sliders yourself until you have all the stained areas selected. You should select dark background if you have a fluorescence or confocal image. (If the Auto setting works well for you, you could go straight to Process – Binary – Make Binary).

2

3.

Click Apply to binarise the image if you are not interested in intensity values. The stained areas which you want to measure will be black. You should not change the defaults unless you want to measure the unstained areas. ImageJ regards the black areas as the areas/objects of interest.

4.

Go to Analyze – Set Measurements. Choose the parameters you want to measure. If you are interested in the proportion of area labelled, you may want to select Area Fraction in addition to Area. Make sure that you include Display Label.

3

The Results table will come up and you can then save this.5. 4 . Go to Analyze – Measure. You can also save the binarised image if you want to.

4. you can choose the colour that you want to use for the selections by going to Edit – Options . Make sure you choose a colour that stands out on your image.Colors – Selection. If you don’t want to automatically label the points. In this case. If you have an RGB image. and make measurements as you can for any other ROIs. Click on the Point Selection tool. You can also choose the size of the point you want to make to label each object. you could change the image to RGB colour so that the mark is in colour. If you want to measure intensities (grayscale) at each point. the selection point will be filled with the foreground colour. You should also make the Foreground colour the same as your selection colour. you will see the colour in gray so you should choose white/black as your selection and drawing colour. then you need to keep the image in grayscale. etc. 5 .MEASUREMENT OF NUMBER OF PARTICLES/OBJECTS Manual approach: measure the number of objects by using the Point Selection tool. Go to Edit – Options – Point Tool and turn on Auto-Measure. each point selection is added to the ROI Manager and you can save the selections. Alternatively. 5. 1. This is because once you have made the selection and clicked on another object. 3. You just need it to be big enough to be able to see it. This size required will depend on the resolution of your image. you could select the option to Add to ROI Manager. If you have a grayscale image. 2. Necessary if you are unable to threshold your images or if you need to count cells but the cells are overlapping and will be measured as one object.

a dot will appear and the data will be entered into the Results window. 8. When you have completed all your measurements. y z positions and the grayscale value. you can save the image with the marks on it. 6 . 7. Now every time you click on the image. Use the Magnifying tool if necessary to make the objects (cells) look bigger and the Hand tool to navigate. This includes the x.6.

ImageJ regards the black areas as the areas/objects of interest. The stained areas which you want to measure will be black. A plugin for a Chalkley grid is also available (25 random spots). Change to grayscale (Image – Type – 8bit) or go to Image – Color RGB Split. 7 .Grids You can also use a grid if necessary by going to Plugins – Analysis – Grid. You should select dark background if you have a fluorescence or confocal image. Go to Image – Adjust – Threshold. 3. You should not change the defaults unless you want to measure the unstained areas. 1. The first part of the procedure is the same as that detailed for Area measurements. 2. Click Apply to binarise the image if you are not interested in intensity values. You can define the size of the grid and the points. Open the image. Threshold approach: use thresholding followed by binarising to segment the objects which you wish to measure. You can select the Auto setting or alternatively move the sliders yourself until you have all the stained areas selected.

4. Choose the parameters you want to measure. Make sure that you include Display Label. Go to Analyze – Set Measurements. 8 . You may be interested in Shape Descriptors or Feret’s Diameter as well as the number of particles in the images.

microns squared). Record Starts combined with Add to Manager. You can also Exclude on Edges.g. Click on OK to run the analysis. which is the usual approach since you won’t have the whole particle in the image. 9 . The success of this depends on the individual objects being able to be clearly distinguished. then this size will be in whatever unit you are using (e. Go to Analyze – Analyze Particles. adds all the particle outlines into the ROI Manager. Note that you can exclude based on size and circularity. 6.5. If you have calibrated your image.

you can use processing filters such as Process – Binary – Watershed to separate them. If two particles are joined together. 10 . If you have holes in your particles as shown below. can also be used and are found under Process . 8. There is also an option within the Particle Analyzer to Include Holes but filling the holes prior to analysis ensures that it is done correctly. which will affect your measurements.Binary menu. Other binary operations such as opening and closing or dilation and erosion. you could fill these holes by going to Process – Binary – Fill Holes.7.

uk/landinig/software/classify/classify.dentistry. which allows you to classify particles based on certain morphological attributes such as size. There is also a large range of image processing filters and operations available in ImageJ that can help to enhance contrast. etc. etc. to make the segmentation easier. This plugin and information about it are available here: http://www. The outline/mask image can also be saved as a record.bham.9. You can use enhancement tools such as Brightness/Contrast or Window/Level to make the particles easier to segment. circularity.ac. Note: If you don’t want the data for each individual particle. Classify Particles Plugin: Gabriel Landini This is a plugin that works very well. you can just save the Summary.html 11 .

12 . 2. The displayed histogram gives you some assistance with this.INTENSITY MEASUREMENTS Use thresholding to select the stained area which you wish to measure 1. Open the image. You can select the Auto setting or alternatively move the sliders yourself until you have all the stained areas selected. Change to grayscale if necessary (Image – Type – 8bit/16bit or Image – Color – Split Channels). Go to Image – Adjust – Threshold.

Choose Dark background for fluorescence images as shown below.3. 13 .

If you don’t select Limit to Threshold. Go to Analyze – Set Measurements. 7. based on your background value). Click Set to set the threshold of the image. In some cases. 6.g. if you need to exclude an area or if you need to create a number of ROIs of the same size that you apply to multiple images.4.g. e. You can change the number of decimal places if you think you need more than the default (3). You should also select Limit to Threshold. 5. In this case. Make sure that you select all the gray level measurements. Choose the parameters you want to measure. 14 . the image is not converted to binary. Go to Analyze – Measure. If you want to use a consistent threshold (e. The Results table will come up and you can then save this. click Measure. you add each ROI into the ROI Manager and then once they are all there. then the entire image will be measured. Intensity measurements can also be done within Regions Of Interest (ROIs). not just the selected area. Use thresholding to select the particles which you wish to measure Follow Steps 1-5 above then go to Analyze – Analyze Particles as described earlier. you do want the intensity measurements for entire image. In this case. you can type in values.

1.g. Open your first image (the one you want to use to create the ROIs). 4. Remove any speckle/noise by using a filter. e.USING PARTICLE ANALYSIS TO CREATE ROIS Use enhancement filters followed by binarising to segment the objects which you wish to measure. that you then apply to a second image. 3. Go to Image – Adjust Brightness/Contrast to improve the differentiation between the edges of the objects and the background. Go to Image – Type – 8bit to change the image into grayscale or to Image – Colour – RGB Split and choose the image which has the most contrast. 15 . 2. radius 2 pixels for a similar result). Process – Filters – Median. (You can also try Process – Filters – Variance. Go to Process – Find Edges to define the boundaries of the objects. You could also use Image – Adjust – Window/Level.g. 5. e. (Various other options such as Process – Enhance contrast can also be used prior to this operation). You can also use it to create regions of interest (ROI).

Go to Process – Binary – Threshold to binarise the image or do it manually by going to Image – Adjust Threshold and then clicking on Apply once you are satisfied with the selection. 16 .6.

e. i. Then Fill Holes. you must then dilate. followed by Process – Binary – Erode.7. if you erode. it means that some boundaries were not complete. Process – Binary – Dilate. These should not be included in your analysis. 8. You need to do the opposite operation.e. Don’t worry about any objects that are on the image boundary. Now go to Process – Binary – Fill Holes. This performs a dilation and erosion operation to fill in the outline and small holes in objects. These gaps in the outlines of the objects can be filled by going to Process – Binary – Close. You can also do the operations separately. i. If any are not filled as shown. 17 .

then you can draw a small line using the pencil tool to fill in the gap in the boundary. Make sure that the Foreground colour selected is black. 10. 11. try Process – Noise – Remove Outliers as below. If you are really struggling. If you have lots of small particles or particles joined together. which has resulted in all these small black particles (=noise). You can change the options and preview the effect on your image by going to Process – Binary – Options. If you have an image like the one below. 18 . 12. then you may want to use Open to remove these. Note that this is the same image but in this case I have omitted the median filter step.9. You can use the Magnifying tool to zoom up so that you can see the gap.

13. Use the Preview option to show how this will affect the image. Select Dark for a binarised image. 19 .

14. You then go to Edit . If you want to analyse the particles. since the selection combines all the outlines. 20 . you will only get one measurement. This also will allow you to add the outline of each nucleus into the ROI Manager to use on the second image. However. go to Analyze – Analyze Particles.Selection – Create Selection and add that into the ROI Manager. Another option if you don’t want to go through the Analyse Particles window is simply to go to Edit – Selection – Create Mask. in this case. 16. 15. Now all the measured particles are outlined and each outline is added into the ROI Manager as a ROI.

21 .

Make sure that you have all the grayscale measurement parameters selected in Analyze – Set Measurements. You will see all the ROIs on your second image as shown below. 20. Convert it to grayscale. 19.17. Click on Show All in the ROI Manager. Now go to your second image. 22 . 18.

4. 23 . move ROIs. Loading ROI Sets 1. If you want to use a threshold within the ROIs to define the grayscale levels of interest.21. These ROIs will then be inserted into the ROI Manager. You can then measure.zip file that you previously saved. Open your image. draw. Select the roiSet. 3. ROI MANAGER Manual Selections Draw a region by using the ROI tools or you specify a size by going to Edit – Selection Specify. you need to select Limit to Threshold in the Set Measurements window. you can go to Image – Adjust threshold. Click Measure in the ROI Manager. etc. Go to ROI Manager and click Open. In this case. 2. All ROIs can be saved using the ROI Manager and applied to other images. 22.

4. You can also use the Magic Wand to select grayscale values. Then click Save.lu/doku. Click Add in the ROI Manager window. 2. Using the binarised image that you have already created.Magic Wand Using the Magic Wand and ROI Manager. The ROIs will be saved as a zip file called ROISet. Open up ROI Manager by going to Analyze – Tools – ROI Manager.tudor.net/ 24 .sourceforge. You can change the name if you like.php?id=plugin:segmentation:versatile_wand:start There is another one which also works in 3D called YAWI at: http://yawi3d. These ROIs can then be applied to your second image. and click on one of the filled in objects: The object should then be outlined. 1. There is a tolerance value that you can alter to expand the selection more according to the 3. Continue until all the nuclei have had ROIs created for them. go to the Wand Tool. There is a more flexible magic wand tool available at: http://imagejdocu. 5.

php?id=video:analysis:gel_quantification_analysis 1. Open your image.tudor. 2.GEL ANALYSIS Method 1: Gel Plotting Macro: built-in macro available under Analyze – Gels Video tutorial available here: http://imagejdocu. Keep changing the radius until no dots are evident. 3. Draw a ROI using the rectangle tool across your first lane.lu/doku. 25 . Run background subtraction if necessary to remove uneven background.

Then go to Analyze – Gels – Plot Lanes.4. Continue until all the lanes are selected. 5. Go to Analyze – Gels – Select Next Lane. Go to Analyze – Gels – Select First Lane. Draw a line to define the baseline using the straight line tool. 7. Use CTR-2 to copy the selection and move to the second lane. 26 . 6.

10. Select each peak using the magic wand tool. As you click on each peak. Make sure the tolerance on the Magic Wand is set to 0. Go to Analyze – Gels – Label Peaks. the area under the peak will be calculated as an area and this will go into the Results table. These values are the relative intensities of the dots.8. 9. 27 .

html You can also create individual ROIs by hand and then use thresholding to select the grayscale levels or use the Magic Wand to select each blot as a ROI and adding that into the ROI Manager. Another option to analyze the blots is to treat each spot/blot as a particle and use Analyze Particles as shown earlier.org/journal/2007/08/quantifying-western-blots-without.lukemiller. you do not make the image binary and select Limit to Threshold in the Set Measurements window. 28 .Method 2: Calculating intensities using ROIs and/or thresholding Some instructions for doing this manually (drawing ROIs) are available here: http://www. In this case.

aspx • • • Allows you to segment standard histological stain combinations such as Haematoxylin & Eosin (H & E). thresholding can be used to select the area of interest for measurements as described above or alternatively the image can be converted straight to a binary image. Go to Plugins – Colour – Colour Deconvolution (or wherever you have placed the Plugin).nz/sms/biru/facilities/analysis_resources. You can also create your own matrices using stained sections or sample areas of your stained section using a ROI to create the matrices.ac. 29 . Use Process – Subtract Background if necessary to correct shadow or colour effects. and DAB with counterstains such as Haematoxylin or Methyl Green. EXAMPLE 1.COLOUR DECONVOLUTION Notes on BIRU website: http://www. Open the image. 2. Following deconvolution.auckland.fmhs.

then one image should be white. Select the stain of interest. Then click OK. You can then use thresholding (or make the images binary) and make your measurements. 4.3.g. H & E. 30 . If you have a 2 colour stain. The image will then be split into 3 components. e. 5.

Sign up to vote on this title
UsefulNot useful