Reading group - 22/05/2013

27
Organ Detection in Fetal MRI Kevin Keraudren Imperial College London May 22 nd , 2013

description

Slides from the reading group presentation where I introduced a new Python interface for IRTK. See http://kevin-keraudren.blogspot.co.uk/2013/12/irtk-python.html for more details and the iPython notebook demo.

Transcript of Reading group - 22/05/2013

Page 1: Reading group - 22/05/2013

Organ Detection in Fetal MRI

Kevin KeraudrenImperial College London

May 22nd, 2013

Page 2: Reading group - 22/05/2013

1 Overview

2 Python interface for IRTK

3 Future work

2/27

Page 3: Reading group - 22/05/2013

1 Overview

2 Python interface for IRTK

3 Future work

3/27

Page 4: Reading group - 22/05/2013

Overview

1 Brain detection &reconstruction

2 3D visualisation

3 Organ localisation

4/27

Page 5: Reading group - 22/05/2013

People

Brain reconstruction:Maria Murgasova

3D visualisation:Christina Malamateniou

Organ detection:Bernhard Kainz

5/27

Page 6: Reading group - 22/05/2013

Localisation of the Brain in Fetal MRI UsingBundled SIFT Features

For every slice Detect MSER regions Filter by size

Classify using SIFT features

RANSAC

6/27

Page 7: Reading group - 22/05/2013

Detections results averaged over the crossvalidation (all orientations combined)

Error (mm)Centiles 2D SIFT 3D SIFT Bundled SIFT

25th 10.9 14.8 4.050th 15.5 20.8 5.775th 20.5 30.4 8.4

Detection 98% 85% 100%Complete brain 38% 23% 85%

7/27

Page 8: Reading group - 22/05/2013

1 Overview

2 Python interface for IRTK

3 Future work

8/27

Page 9: Reading group - 22/05/2013

Why Python?

ls *.nii | python -c ’import sys, irtk;[sys.stdout.write( str(irtk.imread(line.rstrip(),dtype="float32").max())+"\n")for line in sys.stdin]’

numpy, matplotlib, OpenCV, VTK, scipy.ndimage...

& C++ via cython

9/27

Page 10: Reading group - 22/05/2013

Why another library?

import itk

pixelType = itk.UCimageType = itk.Image[pixelType, 3]readerType = itk.ImageFileReader[imageType]writerType = itk.ImageFileWriter[imageType]reader = readerType.New()reader.SetFileName( "input.nii" )reader.Update()

itk2np = itk.PyBuffer[imageType]data = itk2np.GetArrayFromImage( reader.GetOutput() )

...

10/27

Page 11: Reading group - 22/05/2013

Why another library?

import SimpleITK as sitk

img = sitk.ReadImage( "input.nii" )data = sitk.GetArrayFromImage( img )

...

output = sitk.GetImageFromArray( data )output.SetSpacing( img.GetSpacing() )output.SetOrigin( img.GetOrigin() )output.SetDirection( img.GetDirection() )sitk.WriteImage( output, "output.nii" )

11/27

Page 12: Reading group - 22/05/2013

Why another library?

import irtk

img = irtk.imread( "input.nii" )

...

irtk.imwrite( "output.nii", img )

12/27

Page 13: Reading group - 22/05/2013

Key features

simple and pythonic

overload getitem instead of GetRegion

parallelisation using joblib

visualisation functions

13/27

Page 14: Reading group - 22/05/2013

Implementation

template <class dtype>void irtk2py( irtkGenericImage<dtype>& irtk_image,

dtype* img,double* pixelSize,double* xAxis,double* yAxis,double* zAxis,double* origin,int* dim );

14/27

Page 15: Reading group - 22/05/2013

Implementation

void py2rigid( irtkRigidTransformation &transform,double tx,double ty,double tz,double rx,double ry,double rz,bool invert=false );

15/27

Page 16: Reading group - 22/05/2013

Demo

ipython notebook

16/27

Page 17: Reading group - 22/05/2013

Parallelisation example

import irtk from joblib import Parallel, delayed from glob import glob def register( f, img1): img2 = irtk.imread( f, dtype=’float32’) img2 = img2.rescale().resample(2) t = img2.register(img1) return t

filenames = glob( raw_folder + "/" + patient_id + "_*.nii") img1 = irtk.imread(filenames[0], dtype=’float32’) img1 = img1.rescale().resample(2) transformations = [irtk.RigidTransformation()] transformations.extend( Parallel(n_jobs=-1)(delayed(register)(f, img1) for f in filenames[1:] ) )

17/27

Page 18: Reading group - 22/05/2013

1 Overview

2 Python interface for IRTK

3 Future work

18/27

Page 19: Reading group - 22/05/2013

Coarse segmentation as side product of detection

19/27

Page 20: Reading group - 22/05/2013

Convex hull of all detections

20/27

Page 21: Reading group - 22/05/2013

Iterative detection/reconstruction

21/27

Page 22: Reading group - 22/05/2013

Iterative detection/reconstruction

22/27

Page 23: Reading group - 22/05/2013

Iterative detection/reconstruction

23/27

Page 24: Reading group - 22/05/2013

Room for improvement

Refine motion model (statistics on slice transformations)

Patch based segmentation instead of graphcut

Detect head orientation to solve more difficult registrations

Could the detection process producemore than a mask?

24/27

Page 25: Reading group - 22/05/2013

Could we reconstruct more than the brain?

25/27

Page 26: Reading group - 22/05/2013

For the future (hanging projects)

Spine detection using SLIC supervoxels

Dense volumetric features: SURF 3D

Alignment of mothers’ bodies to model of a pregnant woman

26/27

Page 27: Reading group - 22/05/2013

Suggestions or questions?

27/27