After completing this lesson, learners should be able to:
Segment cells and nuclei, using nuclei as seeds for watershed segmentation of the cells.
Motivation
It is quite common to have fluorescence microscopy images with stainings for both nuclei and cytoplasm. While nuclei are typically separate and thus easy to segment, cells are often touching each other, which makes their segmentation much more challenging. The workflow presented in this module is a common approach to tackle this challenge and thus very useful to know.
Concept map
graph TD
N("Nuclei") --> NM("Nuclei label mask")
C("Cells") --> W("Watershed transform")
NM -->|seeds| W
W --> S("Cells label mask")
Figure
Workflow for nuclei and cell segmentation using marker-controlled watershed (magenta - H2B-mCherry; green - GFP-tubulin). The nuclei mask is used to define the seeds/markers, the tubulin-channel is used to define the overall cells boundaries, finally the inverted intensity image is used for the watershed transform (i.e. flooding).
Segment nuclei and cells following the workflow depicted in the module figure.
Show activity for:
ImageJ Macro
/*
* Nuclei and cells segmentation in Fiji
*
* Requirements:
* - IJPB-Plugins update site
*/run("Close All");setOption("BlackBackground",true);// open the imagesopen("https://github.com/NEUBIAS/training-resources/raw/master/image_data/xyc_16bit__nuclei_tubulin_crop.tif");run("Duplicate...","duplicate title=input");run("Split Channels","keep");run("Grays");selectWindow("C1-input");rename("cells");run("Grays");selectWindow("C2-input");rename("nuclei");run("Grays");// segment nucleiselectWindow("nuclei");run("Duplicate...","title=nuclei-binary");run("Median...","radius=5");setThreshold(33089,65535);run("Convert to Mask");run("Connected Components Labeling","connectivity=4 type=[8 bits]");run("glasbey_on_dark");rename("nuclei-labels");// smooth cellsselectWindow("cells");run("Duplicate...","title=cells-smooth");run("Mean...","radius=3");// create cells binary maskrun("Duplicate...","title=cells-binary");setThreshold(33565,65535);run("Convert to Mask");// perform seeded watershed on inverted and smoothed cell signalselectWindow("cells-smooth");run("Duplicate...","title=cells-smooth-invert");run("Invert");run("Marker-controlled Watershed","input=cells-smooth-invert marker=nuclei-binary mask=cells-binary compactness=0 binary use");rename("watershed-segmentation");// remove border cells and change LUTrun("Remove Border Labels","left right top bottom");rename("cell-labels")run("glasbey_on_dark");// overlay on input imageselectWindow("cells");run("Enhance Contrast","saturated=0.35");run("Add Image...","image=cell-labels x=0 y=0 opacity=40");;run("Tile");
Assessment
Discuss with your neighbour
For a marker controlled watershed what will happen if you remove seeds touching the boundary before the watershed transform?
Can you use the cell-mask, instead of the intensity image, for the watershed transform?
Solution
This is not a good idea as you may not be able to find all cells and properly separate those. For instance merged cells may still touch the boundary.
Apply a distance transform to the cell-mask and apply the watershed transform on its inverse.
True or false?
For cell segmentation with a watershed transform one always needs nuclei as seeds.
Nuclei are less likely to touch each other than cells.
For a watershed transform, it is very important to image the cytoplasmic signal at the highest resolution.
Solution
False; if the cellular signal happens to, e.g., be very dim in the cell center and bright at the cell boundaries one may try directly using it as an input to a watershed transform.
True; nuclei have the cytoplasm around them, which often creates a spatial gap between neighbouring nuclei, making them easier to segment
False; in fact, typically, the blurrier this signal is the better it is suited for separating cells using the watershed transform.