Monday, 6 October 2014

Automated segmentation of the fetal brain in MRI

This summer, I had a paper accepted in NeuroImage [1] on a fully automated pipeline for motion correction of the fetal brain in MRI. My main contribution is on detecting the brain and extracting it in the unprocessed data in order to automatically provide an input for motion correction. The motion correction code is the work of Maria Murgasova [2], I incorporated in it the realignment of the slice segmentations in  order to refine the brain extraction throughout the motion correction process.

I recently installed the code on a new machine and tested it using the example on github. As installing research code is rarely a simple matter of downloading the source and running "make", I took notes of all the steps for future reference:

mkdir ~/Prachi
cd ~/Prachi

# install Anaconda Python
source ~/.bashrc # this changes the version of Python you'll be using

# install missing packages
conda install opencv
easy_install joblib

# install IRTK (version used for the github example)
mv irtk.git irtk
cd irtk/

## get rid of the FLTK dependency (no GUI needed)
e packages/CMakeLists.txt # remove rview
e config/IRTKInclude.cmake # remove FLTK

## take from Anaconda the libraries which are not installed on the system, namely libpng in this case
mkdir build
cd build/
cmake -DPNG_LIBRARY:FILEPATH=/home/kke14/Prachi/anaconda/lib/ -DPNG_PNG_INCLUDE_DIR:DIRPATH=/home/kke14/Prachi/anaconda/include/ -D BUILD_WITH_PNG=ON -D WRAP_CYTHON=ON ..
make -j 8

## build the "external" cython code
cd ~/Prachi/irtk/wrapping/cython/ext

echo "export PYTHONPATH=/home/kke14/Prachi/irtk/build/lib:\$PYTHONPATH" >> ~/.bashrc
source ~/.bashrc

# try out the example from gitlab
cd ~/Prachi
git clone
cd example-motion-correction/
make clean
e # edit $ROOT_DIR
./ -a

I will give a short talk on this topic tomorrow at the CDT launch event, King's College London.


This brain extraction method could potentially be used with other motion correction softwares (excluding the segmentation refinement occuring during motion correction), such as SLIMMER or BTK.

A template based extraction method, developped by Taleb et al. [3] is available as part of BTK, and is used for comparison in [1].


[1] Keraudren, K., Kuklisova-Murgasova, M., Kyriakopoulou, V., Malamateniou, C., Rutherford, M.A., Kainz, B., Hajnal, J.V., Rueckert, D., 2014. Automated Fetal Brain Segmentation from 2D MRI Slices for Motion Correction. NeuroImage. PDF
[2] Kuklisova-Murgasova, M., Quaghebeur, G., Rutherford, M.A., Hajnal, J.V., Schnabel, J.A., 2012. Reconstruction of Fetal Brain MRI with Intensity Matching and Complete Outlier Removal. Medical Image Analysis. PDF
[3] Taleb, Y., Schweitzer, M., Studholme, C., Koob, M., Dietemann, J.-L., Rousseau, F., 2013. Automatic Template-based Brain Extraction in Fetal MR Images. PDF

1 comment:

  1. Some notes for MacOSX: