2D noisy object segmentation and filtering


Before starting this lesson, you should be familiar with:

Learning Objectives

After completing this lesson, learners should be able to:
  • Create an image analysis workflow comprising image denoising and object filtering.


Finding objects in images typically presents itself with two challenges. First, the input image may not lend itseld to a simple intensity thresholding operation for binarisation. Second, there may be unwanted objects in the image such as hot pixels or objects that are not fully in the image. The first challenge typically is tackled by applying appropriate image filters to the raw data. The second challenge is tackled by defining and applying reproducible criteria to remove certain objects from the image.

Concept map

graph TD GI["Grayscale input image"] --> FGI["Filtered grayscale image"] FGI -->|has property|P["Interesting stuff is bright"] FGI --> BI["Binary image"] BI --> LI["Label image"] LI --> FLI["Subset label image"] FLI -->|has property|U["Unwanted labels are removed"] FLI --> S("Shape measurement") S --> SFT["Object feature table"]


Nuclei segmentation and area measurement, including image denoising and object filtering.


Input images


Apply the workflow outlined above (see Concept map and Example figure) to both images. The modules listed in this module’s Prerequisites contain the information as to how to conduct each step of the workflow.

Show activity for:

ImageJ Macro & GUI

 * 2D nuclei segmentation, including
 *  - image denoising by a mean filter
 *  - removal of small and boundary objects
 * Requirements:
 *   - Update site: IJPB-Plugins (MorpholibJ)

run("Close All");
run("Options...", "iterations=1 count=1 black do=Nothing");

analyseNuclei( "Ctrl", "https://github.com/NEUBIAS/training-resources/raw/master/image_data/xy_8bit__nuclei_noisy_small.tif" );
analyseNuclei( "Treat", "https://github.com/NEUBIAS/training-resources/raw/master/image_data/xy_8bit__nuclei_noisy_large.tif" );

function analyseNuclei( name, filePath )
	// File › Open...
	// Image › Rename...
	// Image › Adjust › Brightness/Contrast...
	setMinAndMax(0, 100);
	// Image › Duplicate...
	run("Duplicate...", "title=" + name + "_denoise" );
	// Process › Filters › Mean...
	run("Mean...", "radius=3");
	// Image › Duplicate...
	run("Duplicate...", "title=" + name + "_binary" );
	// Image › Adjust › Threshold...  [ Apply ]
	setThreshold(25, 255);
	run("Convert to Mask");
	// Plugins › MorphoLibJ › Binary Images › Connected Components Labeling
	run("Connected Components Labeling", "connectivity=4 type=[8 bits]");
	// Image › Lookup Tables › glasbey_on_dark
	// Plugins › MorphoLibJ › Label Images › Label Size Opening
	run("Label Size Opening", "min=100");
	// Plugins › MorphoLibJ › Label Images › Remove Border Labels
	run("Remove Border Labels", "left right top bottom");
	// Plugins › MorphoLibJ › Analyze › Analyze Regions
	run("Analyze Regions", "area");


Follow-up material

Recommended follow-up modules:

Learn more: