Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Dilating regions in code

A demonstration of using region dilation on a thresholded image using Python in Fiji

As we have seen, often regions in thresholded images need tidying up to remove gaps in the thesholded foreground object, or remove noise in the background

One way to do this is using morphological operators such as erosion and dilation. Here’s how to perform the dilation step using Python in Fiji. The code here is more complicated than in previous videos, but uses the same basic blocks we’ve seen before, such as for loops and if statements.

The code can be downloaded for you to try out yourself at

This article is from the free online

Introduction to Image Analysis for Plant Phenotyping

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now