Object shape measurements
Prerequisites
Before starting this lesson, you should be familiar with:
Connected component analysis(for practicals that use label masks)
Learning Objectives
After completing this lesson, learners should be able to:
Understand shape measurements and their limitations
Perform shape measurements on objects
Motivation
Our eyes are extremely good in distinguishing forms and patterns and this has proven to be a powerful tool for characterizing different cell-types, functions, phenotypes, and more. In image processing, we use shape measurements (e.g. area, volume, elongation, …) for an automated and objective characterization of forms. Consequently, one can address scientific questions or filter objects that should be used for further processing.
Concept map
oid | area | perimeter | circularity
001 | 222 | 56 | 0.9
002 | 500 | 101 | 0.2 "] style table text-align:left
Figure
Activities
Measure 2-D shapes in an image
- Using a drawing board, discuss important shape features and concepts, such as,
- Area
- Perimeter: Like all surface measurements, this is tricky, e.g.,
- Counting the number of perimeter pixels actually “only” approximates the bounding box
- See the famous england’s coastline paradox
- Circularity = ( 4 * Pi * Area ) / Perimeter^2: Designed to be 1.0 for a perfect circle
- Aspect ratio: Major ellipse axis length / Minor ellipse axis length
- Solidity = Convexity = Area / Convex_hull_area: Useful to find objects with spikes or indentations
- Ellipse fit parameters or Elongation: Useful to measure object elongation
- Discuss issues with small object in digital images, e.g., by exploring a square (=circle?!) of 2x2 pixels.
- Perform shape measurements of objects in an image
- Discuss how objects can be distiguished by various shape measurements
- Perform shape measurements in pixel or calibrated units
Example data
- Fluorescence image with nuclei of different shapes: xy_16bit_calibrated__nuclei_various_shapes.tif
- Useful for manual delineation of objects and subsequent measurements
- Label image with objects of different shapes: xy_8bit_labels__four_objects.tif
- Label image with circles of different sizes: xy_8bit_labels__circles_different_size.tif
Show activity for:
ImageJ GUI ROI
- Open an image with objects of different shapes (see activity preface)
- Use
Analyse > Tools > ROI Manager
to open the ROI manager- Use the ROI tools, e.g. the Polygon selection in the Fiji menu bar to delineate some objects in the image
- Use
ROI Manager > Add
to record each ROI- Use
ROI Manager > Rename...
to give them meaningful names- For easier region identification use
ROI Manager > More > Options
- Use ROI names as labels
- Display all regions using
ROI Manager
- Show All
- Labels
- Once all are added use
ROI Manager > More > Save...
to store the ROIs
- This is important to document your work; the ROI file can be opened via drag&drop on Fiji
- Use
Analyse > Set Measurements
to configure what to measure:
- Area
- Centroid
- Perimeter
- Fit Ellipse
- Feret’s Diameter
- Shape Descriptors
- Display label (adds a column with the object name)
- Use
ROI Manager > More > Multi Measure
to measure all ROIs at once- Use
Image > Properties
to check the image calibration- Use
Results > File > Rename
to indicate the image calibration in the table name
- Use
Image > Properties
to change the image to pixel units- Measure all ROIs again and change the table name to indicate the calibration
- Understand all the measurements
- Compare calibrated and pixel unit measurements
- Go through the columns and see which object has an extreme value and why
- See ImageJ measurements documentation
- Select one object and use
Edit > Selection > Convex Hull
to see the convex hull
ImageJ GUI MorphoLibJ
- Open image xy_8bit_labels__four_objects.tif
- Perform shape measurements and discuss their meanings [Plugins > MorphoLibJ > Analyze > Analyze Regions]
- see also MorphoLibJ Documentation
- Explore results visualisation [Plugins > MorphoLibJ > Label Images > Assign Measure to Label]
- Add a calibration of 2 micrometer to the image and check which shape measurements are affected.
- Perform a shape analysis for 3D image xyz_16bit_labels__spindle_spots.tif and [Plugins > MorphoLibJ > Analyze > Analyze Regions 3D]
skimage napari
Practice measuring object shapes in an image
Practice performing shape measurements.
Show activity for:
ImageJ GUI
Open image xy_16bit_labels__nuclei.tif Using MorpholibJ:
- Measure object shapes and find the label index of the nucleus with the largest perimeter
- Change the pixel size to 0.5 um and repeat the measurements. Why do some parameters change while others don’t?
- (Optional) Create an image where each object is coloured according to the measured circularity
Solution
- [Plugins > MorphoLibJ > Analyze > Analyze Regions] the upper right nuclei.
- Some features are the ratio of dimensional features and so are independent of the spatial calibration.
- [Plugins > MorphoLibJ > Label Regions > Assign Measure to Label].
skimage napari
Assessment
True or false? Discuss with your neighbour
- Circularity is independent of image calibration.
- Area is independent of image calibration.
- Perimeter can strongly depend on spatial sampling.
- Volume can strongly depend on spatial sampling.
- Drawing test images to check how certain shape parameters behave is a good idea.
Solution
- Circularity is independent of image calibration True
- Area is independent of image calibration. False
- Perimeter can strongly depend on spatial sampling. True
- Volume can strongly depend on spatial sampling. True
- Drawing test images to check how certain shape parameters behave is a good idea. True
Explanations
Follow-up material
Recommended follow-up modules:
Learn more:
ImageJ: Results visualisation. Label visualization in 3D viewer
Coastal line paradox. Effect of Sampling and resolution on the measurements