Capstone Challenge#

Questions

  • How can we automatically count bacterial colonies with image analysis?

Objectives

  • Bring together everything you’ve learnt so far to count bacterial colonies in 3 images.

In this episode, we will provide a final challenge for you to attempt, based on all the skills you have acquired so far. This challenge will be related to the shape of objects in images (morphometrics).

Morphometrics: Bacteria Colony Counting#

As mentioned in the workshop introduction, your morphometric challenge is to determine how many bacteria colonies are in each of these images:

Colony image 1

Colony image 2

Colony image 3

The image files can be found at data/colonies-01.tif, data/colonies-02.tif, and data/colonies-03.tif.

Exercise: Morphometrics for bacterial colonies#

Write a Python program that uses scikit-image to count the number of bacteria colonies in each image, and for each, produce a new image that highlights the colonies. The image should look similar to this one:

Sample morphometric output

Additionally, print out the number of colonies for each image.

Use what you have learnt about histograms, thresholding and connected component analysis. Try to put your code into a re-usable function, so that it can be applied conveniently to any image file.

Exercise: Colony counting with minimum size and automated threshold (optional, not included in timing)#

Modify your function from the previous exercise for colony counting to (i) exclude objects smaller than a specified size and (ii) use an automated thresholding approach, e.g. Otsu, to mask the colonies.

Summary Quiz#