# mmdbrain
Extract the lateral ventricle from an MRI image of the brain.

## Description

This procedure extracts the lateral ventricle from an MRI image of the brain. This example was kindly provided by Prof. John Goutsias from The Johns Hopkins University and appears in Goutsias and S. Batman, Morphological Methods for Biomedical Image Analysis, In the Handbook of Medical Imaging: Volume 3. Progress in Medical Image Processing and Analysis, J. M. Fitzpatrick and M. Sonka (Eds.)(To Appear). SPIE Optical Engineering Press, May 2000.

## Demo Script

### Reading

The MRI image of a brain slice is read.

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

    >>> mmshow(a);

a |

### Ventricle detection I

The ventricle is enhanced using an opening with a disk of radius 10 followed by a reconstruction.

    >>> b = mmopen(a,mmsedisk(10));

    >>> c = mminfrec(b,a);

    >>> mmshow(b);

    >>> mmshow(c);

b | c |

### Ventricle detection II

The result of the open by reconstruction is subtracted from the original image. Note that the three operations: open, reconstruction and the subtraction could be done at once using the mmopenrecth (open by reconstruction top-hat) function. On the right, the enhanced ventricle is thresholded.

    >>> d = mmsubm(a,c);

    >>> mmshow(d);

    >>> e = mmcmp(d,'>=',uint8(50));

    >>> mmshow(e);

d | e |

### Selecting the ventricle

Finally, the ventricle is selected as the connected object with area larger than 70 pixels. For visualization purposes, the result of the segmentation is overlayed on the original brain image.

    >>> f= mmareaopen(e,70);

    >>> mmshow(f);

    >>> mmshow(a,f);

f | a,f |

[`mmdblob`] [Up] [`mmdcalc`] |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center.