Thursday, December 16, 2010

Looking for a geodesic operator

In a previous post, I was wondering how to label the chromatids of metaphasic chromosomes. The idea was to use connected components obtained  after high pass filtering, then to assign those region to one chromatid or the other one.
Here, I believe it should be possible to proceed with pre-labelled seeds and let them grow inside a mask as shown in the following images:
 The top left image is the seeds image and the top right one is the mask image. The seeds are allowed to grow only in the white region of the mask image, so this operation is a geodesic transformation.
  • Depending of the usage, different gray-scaled seeds can be designed. For example the big light-blue/magenta one could be used to label the left side and the right side of the large white particle. The smaller blue/yellow seed could be used to label the upper or the lower part of a chromosome like particle.
  • Naively if gray-scale dilation followed by masking is performed on the image seeds, the lower left image is obtained, whereas a result similar to the lower right image was waited. A simple gray-scale dilation yields to imbalanced "blue/pink" regions.

Tuesday, December 14, 2010

Building YAYI under ubuntu maverick

Yayi , according to the author, is a framework focussing on mathematical morphology. To build Yayi, boost is needed. For some reasons, I was not able to build Yayi with the boost binaries avalaible from the ubuntu repository, so prior building yayi, building boost is requiered.
Building Boost 1.44
  • Download boost
  • Decompress the archive in you local directory, my boost source directory is in 
/home/jeanpat/Applications/boost_1_44_0
  • Create a directory to build Boost, for example :
/home/jeanpat/Applications/Boost_1_44_0_Build
  • cd into the source dir and from a terminal:
./bootstrap.sh
  • then
./bjam --prefix=/home/jeanpat/Applications/Boost_1_44_0_Build --build-type=complete --layout=versioned --ignore-config -sBZIP2_INCLUDE=/usr/include -sBZIP2_LIBPATH=/lib install

Building Yayi
  • Download the source
  • Extract the source directory according to the instructions
  • then from the source directory, in a terminal:
BOOST_ROOT_DIRECTORY=/home/jeanpat/Applications/Boost_1_44_0_Build

export BOOST_ROOT_DIRECTORY
cd Yayi
cd build
cmake -DBOOST_INSTALLATION_DIR=$BOOST_ROOT_DIRECTORY -DBOOST_VERSION_MINOR=44 CMakeLists.txt
make

Monday, December 13, 2010

Chromatids segmentation with ImageJ

Let's perform high pass filtering on the DAPI image previously processed:



After thresholding and connected component labeling, we get:

If prior image labelling, watershed is performed, the chromosomes are broken into particles that corresponds mainly to the chromatids of the largest chromosomes:

We can see that most of the chromatids are well detected in large chromosomes but less accurately in small chomosomes such HSA 19 or HSA21:


Some pieces of chromatids are well detected, let's paint ("Human labeling") them by hand:
  • in green or blue for the chromatids 
  • in red for the centromeric labeling
  • in yellow, for the badly segmented chromatids.


Yellow regions needs to be reaffected to blue / green or red region. By hands, it gives:



Can we imagine an algorithm capable to perform that task?
A low level image opening finally yields:

Metaphase chromosomes segmentation with ImageJ

Chromosomes segmentation is the first step of MFISH or QFISH analysis.
Let's try to identify chromosomes from a DAPI stained metaphase:

The image was  acquired with a 12 bits CCD camera. Microscopic field illumination is supposed homogeneous and no flat-field correction will be performed.
To segment the chromosomes, first check that Gabriel Landini's morpholological plugins is installed, and  load the image with ImageJ. ImageJ indicates that the image is now a 16 bits image. 
The interphasic nuclei yield saturated pixels at 4095 in the image histogram :
The gray level value of the first peak corresponding to the backgroung is around 300. Let's substract this value to the image and then perform a local background substraction with a rolling ball value set to 15 using the Hilo LUT to visualize the background.


Now the image histogram yields:

Erase the pieces of nuclei with the eraser tool. Threshold the image interactively and label the binary image then display it with the 3-3-3 RGB LUT:
This procedure yields under segmented chromosomes. From the original binary image. By performing a watershed and relabel the new image, we get:
The touching chromosomes are now well separated but most chromosomes are now over segmented, anyway the result may be interesting since the parts obtained grossly corresponds to p and q chromosomal arms.
To get a good segmentation, an interactive step with the drawing tool may be here necessary:

Another example of chromosomes segmentation without manual modification (that is without painting tools) leading to over segmentation:



Here identifying first the chromosomes help to choose parameters to perform chromosomes segmentation. Some iterations between image segmentation and the chromosomes recognition step must be introduced to automatise the process.