This lesson is still being designed and assembled (Pre-Alpha version)

Filter objects

Prerequisites

Before starting this lesson, you should be familiar with:

Learning Objectives

After completing this lesson, learners should be able to:
  • Remove objects from a label mask image.

Motivation

Once objects have been identified in an image, one often filters the objects based on certain measured criteria. For example, very small objects may be noise rather than real objects and could be removed.

Concept map

graph TD L("Label image") -->|"remove label(s)"| ML("Modified label image")

Example figure

Activity

Open a label mask image and remove labels (objects) from it. Discuss how filtering can also be done afterwards using a spread-sheet software. Advantages to create a filtered label image.

Show activity for:

ImageJ Macro & GUI

run("Close All")

// File > Open
open("https://github.com/NEUBIAS/training-resources/raw/master/image_data/xy_8bit_labels__nuclei_touchborder.tif")

//  Plugins › MorphoLibJ › Label Images › Remove Border Labels
run("Remove Border Labels", "left right top bottom");

// Plugins › MorphoLibJ › Analyze › Analyze Regions
run("Analyze Regions", "area")

// Plugins › MorphoLibJ › Label Images › Label Size Filtering
run("Label Size Filtering", "operation=Lower_Than size=10000");

Exercises

Show exercises for:

ImageJ Macro & GUI

Solution

run("Close All")
// File > Open
open("https://github.com/NEUBIAS/training-resources/raw/master/image_data/xy_8bit_labels__nuclei_touchborder_2.tif")
//  Plugins › MorphoLibJ › Label Images › Remove Border Labels
run("Remove Border Labels", "left right top bottom");
// Plugins › MorphoLibJ › Analyze › Analyze Regions
run("Analyze Regions", "area")
// Plugins › MorphoLibJ › Label Images › Label Size Filtering
run("Label Size Filtering", "operation=Lower_Than size=4000");

Assessment

True of false?

  1. In bioimage analysis one should always remove all labels that touch the image boundary.
  2. The largest object has the highest label index.
  3. If you remove one object the number of distinct labels decreases by one.

Solution

  1. Very often, but not always. Sometimes it also is an option to normalise downstream measurements by the visible size of objects.
  2. No, the label index usually has no meaning.
  3. Yes.

Discuss with your neighbour

  1. Is it a good idea to manually remove objects (labels) from an image or should this rather be an automated procedure?
  2. What are the pros and cons of removing labels from the image as opposed to keeping all of them and removing the corresponding object measurements later during statisitical analysis of the measurement results?

Solution

  1. Automated typically is better as it forces you to define objective and reproducible criteria for which objects to remove.
  2. Very important topic, but too much to write, ask your bioimage analysis consultant ;-)

Follow-up material

We recommend reading these modules next:

Learn more: