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
wget http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-2.1.0-Linux-x86_64.sh
bash Anaconda-2.1.0-Linux-x86_64.sh
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)
wget https://github.com/kevin-keraudren/kevin-keraudren.github.io/raw/master/irtk-6d7d075f69aea616b8cd0d57e07983db6e2f9497.zip
unzip irtk-6d7d075f69aea616b8cd0d57e07983db6e2f9497.zip
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/libpng.so -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
make

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

# try out the example from gitlab
cd ~/Prachi
git clone https://github.com/kevin-keraudren/example-motion-correction.git
cd example-motion-correction/
make clean
e run.sh # edit $ROOT_DIR
./run.sh -a

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


Notes

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].

References

[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: https://gist.github.com/kevin-keraudren/f325344bc262621eed9ce42bfe02b03f

    ReplyDelete