[mmdfabric] [Up] [mmdflatzone] Demonstrations

mmdfila
Detect Filarial Worms.

Description

This procedure extracts the filarial worms from a complex microscopic image by eliminating progressively the other objects present in the image. The selection of the structures begins in the gray-scale level and, after a threshold, continues based on the object geometrical properties.

Demo Script

Reading

A microscopic gray-scale image, with two filarial worms, is read.

>>> a = mmreadgray('danaus.tif');

                  
>>> mmshow(a);

                
a

Background regularization.

The Close by Reconstruction Top-Hat operator is applied to regularize the image background.

>>> b = mmcloserecth(a,mmsebox(5));

                  
>>> mmshow(b);

                
b

Removing narrow objects

The gray-scale opening by the elementary cross is applied to remove narrow objects.

>>> c = mmopen(b);

                  
>>> mmshow(c);

                
c

Removing small objects

The gray-scale area open operator is applied to remove small objects.

>>> d = mmareaopen(c,200);

                  
>>> mmshow(d);

                
d

Thresholding

The threshold operator is applied to extract a reduced set of structures that include the two worms present in the image.

>>> e = mmthreshad(d,50);
Warning: Converting input image from int32 to uint8.
>>> mmshow(e);

                
e

Skeleton

The objective of the sequence of transformations, that begin with the homotopic skeleton, is to eliminateg the structures that are not worms. The information used for the filtering is that the worms are longer than any other structure found.

>>> f = mmthin(e);

                  
>>> mmshow(f);

                
f

Elimination of short structures

The first 12 points of the skeleton branches, counting from their extremities, are eliminated. The structures that were not eliminated will be the markers for extracting the two worms.

>>> g = mmthin(f,mmendpoints(), 12);

                  
>>> mmshow(g);

                
g

Extraction of the worms from their markers

The binary reconstruction operator is applied to reconstruct the binary image produced by the threshold from the marker image.

>>> h = mminfrec(g,e);

                  
>>> mmshow(h);

                
h

Final display

The structures extracted are overlaid to the input gray-scale image.

>>> mmshow(a,h);

                
a,h

[mmdfabric] [Up] [mmdflatzone] Python