Automated Cell Tracking

Tags: #<Tag:0x00007fd542d41ec0> #<Tag:0x00007fd542d41c90> #<Tag:0x00007fd542d41b50>


I’m currently doing flow chamber experiments with endothelial cells under bright field microscopy and would like to automatically track them. I tried out TrackMate, but unfortunately even with inverted colors and contrast adjustments, the plugin tracks the cells in only a fraction of the pictures in a stack. Is there any better way of pre-processing you would advice or a more fitting tracking plugin? I uploaded a sample stack under .
Many thanks in advance,


If you have single cell segmentation Lineage-Mapper (which has a Fiji plugin) might be able to perform tracking for you.

Lineage-Mapper operates on labeled segmentation masks in order to be agnostic to the image type being tracked.

Install Guide

If you need to track using the original grayscale images one of these methods might be appropriate or at least serve as a starting point for finding a suitable automated tracking method. However, I do not know if any of those techniques have Fiji plugins, but most should have open source code.



Hi Michael,

thank you very much for your help. I couldn’t properly use the Lineage-Mapper because I’m struggling a little with a proper segmentation of the cells. But I found some instructions in this forum so I hope that stays just a matter of time :slight_smile: With the other tracking programs I think I’ll look into them once I finished the segmentation problem so I can compare the methods and find out what suits my needs best.

Thanks again,



I took a look at your images, and while I could get a reasonable foreground-background segmentation using EGT I was not able to create a satisfactory single cell segmentation using FogBank. Since I helped develop both tools, I would wager that I am not a novice w.r.t. their use. The largest problem I ran into was that your images are low contrast with no clear delineation of the cell edge. I am used to seeing Phase-Contrast images (these might be brightfield (I am an algorithm dev, not an imaging specialist)) with more cell edge contrast.

The next tool(s) I would reach for when performing single cell segmentation would be:

  1. Weka Segmentation within Fiji
  2. CNN’s like UNet or SegNet.

Best of luck performing cell segmentation.



Hi Michael,

thanks again for your response and sorry for my late answer. I was on vacation and noticed to late.

Yes, these are indeed bright-field images, which was ok for the manual tracking we did in the past. Unfortunately, at the moment, I don’t have access to a phase contrast microscope that fits the experimental conditions.

I experimented a little with the Weka-segmentation tool and this is the best I was able to do so far. The first is done with 2 (cell,background), the second with 4 (cell,background,edges,artefacts). Otherwise I didn’t change any settings (which maybe I should have done?).

I noticed that for some reason the brightness and contrast of my stack changes over time, so on the 4-classes-classifier I trained Weka with the first, most middle and last picture (see 4th folder). This took much more time as I think would be feasible for a reasonable routine. Is there any smarter way to do this?

Would you advice any other processing before trying it with the tracking tools, and would you start doing that with the “results” or the “probability map”. I tried a few things including threshold and some binary manipulations, but somehow I was never really happy with the results. On the other hand I found the “Find Maxima” tool to be quite specific to the cells (see picture in folder). Is there any way I can use that tool to replace all cells be by representative circles? It seemed to me that that my be the cleanest source for any tracking program.

Thank you very much again for your help! :slight_smile:



The two class Weka results look like what I have seen from a phase-contrast (or DIC) to pseudo-fluorescent reconstruction/transformation. I cannot remember the author or paper title, but I will make another reply here if I figure it out.

If the two class probabilities are easy to generate it looks like something that FogBank could easily segment.

However, I don’t have any ideas to try other than converting the brightfield into pseudo-fluorescent images and then segmenting and tracking those.

I will check my desk when I get in on Monday (I should have a physical copy of the fluorescent reconstruction paper). The idea is somewhat similar to this.

If you have centroid locations for each cell, then replacing the centroid pixel location with a circle is certainly possible. My tool of choice for that would be a Matlab or Python script. Open the image, load the centroids, add a single unique labeled pixel at each centroid (pixel value equal to the centroids index in the list), and then perform a grayscale dilation with radius r. So each centroid in the list becomes a single pixel with a unique value. The grayscale dilation then enlarges those single pixels to roughly circular ROIs with the same label.


h = 100;
w = 100;
x = round(w*rand(10,1));
y = round(h*rand(10,1));

Img = zeros(h,w);
for i = 1:numel(x)
	Img(y(i),x(i)) = i;

figure, imshow(Img,[]);

Img = imdilate(Img, strel('disk',5));
figure, imshow(Img,[]);

The Centroids:

The Dilated Circles:

With a little work you can come up with a way to more elegantly handle collisions so that the higher value ROI does not grab all of the area.

On a different note: this is what I was able to get using FogBank really quickly on your two class probability map.

Fogbank Run on 14-Jul-2017 18:02:40

Foreground Segmentation Parameters
Min Cell Area: 1000
Fill Holes Smaller Than: 2000
Fill Holes Larger Than: Inf
Keep Holes with Operator: AND
Fill Holes with percentile intensity less than: 0
Fill Holes with percentile intensity larger than: 100
Morphological Operation: none with radius 2
Greedy: 0

Border Mask Generation
Percentile Threshold: < 30
Thin Mask: 0
Operate on Gradient: 0
Break Holes: 0

Seed Mask Generation
Percentile Threshold: 80 < pixel < 100
Object Size Range: 15 to 1560
Morphological Operation: none with radius 2
Circularity Threshold: 0
Cluster Distance: 10
Use Border Mask: 1
Operate on Gradient: 0

Object Separation
Apply Fogbank On: Grayscale Image
Fogbank Direction: Max -> Min
Min Object Area: 500


DIC to pseudo-fluorescent paper:

or this paper:
Z. Yin, K. Li, T. Kanade, and M. Chen, “Understanding the optics to aid microscopy image segmentation.,” Med. Image Comput. Comput. Interv., pp. 209–17, 2010.

(edit: added second paper)