itk deformable registration demons methods. deformable registration

50
ITK Deformable Registration Demons Methods

Upload: erin-whitehead

Post on 27-Mar-2015

269 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ITK Deformable Registration Demons Methods. Deformable Registration

ITK Deformable Registration

DemonsMethods

Page 2: ITK Deformable Registration Demons Methods. Deformable Registration

Deformable Registration

Deformable Registration

Page 3: ITK Deformable Registration Demons Methods. Deformable Registration

Deformable Transforms

Deformable Transforms

Page 4: ITK Deformable Registration Demons Methods. Deformable Registration

Deformable Transformation

y

Fixed Image

Transform

x

y

Moving Image

x

Page 5: ITK Deformable Registration Demons Methods. Deformable Registration

Deformable Transformation

y

Fixed Image

Transform

x

y

Moving Image

x

Page 6: ITK Deformable Registration Demons Methods. Deformable Registration

Deformable Transformation

y

Fixed Image

Transform

x

y

Moving Image

x

Page 7: ITK Deformable Registration Demons Methods. Deformable Registration

Image Resampling

FixedImage

MovingImage

Transform

Interpolator

ResampleImageFilter

DeformedImage

Page 8: ITK Deformable Registration Demons Methods. Deformable Registration

Image Resampling

FixedImage

MovingImage

Transform

Interpolator

ResampleImageFilter

DeformedImage

High OrderPolynomialsOrthogonal

BasisSplines

Explicit VectorField

Page 9: ITK Deformable Registration Demons Methods. Deformable Registration

Kernel Splines Transforms

SourceLandmarks

TargetLandmarks

DisplacementVectors

InterpolatedValues

Page 10: ITK Deformable Registration Demons Methods. Deformable Registration

Kernel Spline Transforms

• Thin Plates

• Thin Plates R2 log R

• Elastic Body

• Elastic Body Reciprocal

• Volume

Page 11: ITK Deformable Registration Demons Methods. Deformable Registration

Kernel Spline Transforms

InsightApplications / ThinPlateSplines

Page 12: ITK Deformable Registration Demons Methods. Deformable Registration

Resampling: Kernel Spline Transform

#include "itkImage.h"#include "itkResampleImageFilter.h"#include "itkLinearInterpolateImageFunction.h"#include "itkElasticBodySplineKernelTransform.h"

typedef itk::Image< char, 2 > ImageType;

ImageType::ConstPointer fixedImage = GetFixedImage(); ImageType::ConstPointer movingImage = GetMovingImage();

typedef itk::LinearInterpolateImageFunction< ImageType, double > InterpolatorType;

InterpolatorType::Pointer interpolator = InterpolatorType::New();

typedef itk::ResampleImageFilter< ImageType, ImageType > FilterType;

FilterType::Pointer resampler = FilterType::New();

Page 13: ITK Deformable Registration Demons Methods. Deformable Registration

Resampling: Kernel Spline Transform

typedef itk::ElasticBodySplineKernelTransform< double, 2 > TransformType;

TransformType::Pointer transform = TransformType::New();

resampler->SetInterpolator( interpolator );

resampler->SetInput( movingImage );

ImageType::RegionType region = fixedImage->GetBufferedRegion();

resampler->SetSize( region->GetSize() );resampler->SetOutputStartIndex( region->GetIndex() );

resampler->SetOutputSpacing( fixedImage->GetSpacing() );

resampler->SetOutputOrigin( fixedImage->GetOrigin() );

Page 14: ITK Deformable Registration Demons Methods. Deformable Registration

Resampling: Kernel Spline Transform

resampler->SetTransform( transform );

typedef TransformType::PointSetType PointSetType;

PointSetType::Pointer sourceLandmarks = PointSetType::New();PointSetType::Pointer targetLandmarks = PointSetType::New();

transform->SetSourceLandmarks( sourceLandmarks );transform->SetTargetLandmarks( targetLandmarks );

typedef PointSetType::PointsContainer PointsContainer;

PointsContainer::Pointer sources = sourceLandmarks->GetPoints();PointsContainer::Pointer targets = targetLandmarks->GetPoints();

Page 15: ITK Deformable Registration Demons Methods. Deformable Registration

Resampling: Kernel Spline Transformsources->Reserve( numberOfLandmarks );targets->Reserve( numberOfLandmarks );

typedef PointSetType::PointType PointType;PointType source;PointType target;

for( int i = 0; i < numberOfLandmarks; i++ ){

inputFile >> source; inputFile >> target;

sources->InsertElement( i, source );targets->InsertElement( i, target );}

transform->ComputeWMatrix();

resampler->Update(); // Finally !!

ImageType::ConstPointer deformedImage = resampler->GetOutput();

Page 16: ITK Deformable Registration Demons Methods. Deformable Registration

Kernel Spline Transforms

VolView : ITK Plugin

Page 17: ITK Deformable Registration Demons Methods. Deformable Registration

Kernel Spline Transforms

VolView : ITK Plugin

Page 18: ITK Deformable Registration Demons Methods. Deformable Registration

Deformable Transforms

Deformation Fields

Page 19: ITK Deformable Registration Demons Methods. Deformable Registration

Deformation Vector Field

ParaView: http://www.paraview.org

Page 20: ITK Deformable Registration Demons Methods. Deformable Registration

Warp Image Filter#include "itkImage.h"#include "itkWarpImageFilter.h"#include "itkLinearInterpolateImageFunction.h"

typedef itk::Image< char, 2 > ImageType;

ImageType::ConstPointer fixedImage = GetFixedImage(); ImageType::ConstPointer movingImage = GetMovingImage();

typedef itk::LinearInterpolateImageFunction< ImageType, double > InterpolatorType;

InterpolatorType::Pointer interpolator = InterpolatorType::New();

typedef itk::Vector< float, 2 > VectorType;typedef itk::Image< VectorType , 2 > VectorFieldType;

VectorFieldType::Pointer vectorField = GetVectorField();

Page 21: ITK Deformable Registration Demons Methods. Deformable Registration

Warp Image Filtertypedef itk::WarpImageFilter< ImageType,

ImageType, VectorFieldType > WarpFilterType;

WarpFilterType::Pointer warpFilter = WarpFilterType::New();

warpFilter->SetInterpolator( interpolator );

warpFilter->SetInput( movingImage );

warpFilter->SetOutputSpacing( fixedImage->GetSpacing() );

warpFilter->SetOutputOrigin( fixedImage->GetOrigin() );

warpFilter->SetDeformationField( vectorField );

warpFilter->Update();

ImageType::ConstPointer deformedImage = warpFilter->GetOutput();

Page 22: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration

Demons Registration

Page 23: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration

Demons is a Family

of Algorithms

Page 24: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration

Demons Type 0

Page 25: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 0

Scene

Model

Transform

Page 26: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 0

Scene

Model

Transform

Gradients

Page 27: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 0

Scene

Model

Transform

Forces

Page 28: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration

Demons Type 1

Page 29: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 30: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 31: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 32: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 33: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene

Gradient

Page 34: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene

Gradient

Intensity

Space

Desired Displacement

CurrentEstimation

Page 35: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 36: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene

Page 37: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Previous Field Incremental Field Next Field

Iterations

GaussianSmoothing

Page 38: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

V =( s – m ) . Grad(s)

Grad(s)2

V =( s – m ) . Grad(s)

Grad(s)2 + (s-m)2 K

Page 39: ITK Deformable Registration Demons Methods. Deformable Registration

Image Registration Framework

FixedImage

MovingImage

IncrementComputation

Transform

InterpolatorPDE

Solver

DeformationField

Page 40: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

#include "itkImage.h"#include "itkDemonsRegistrationFilter.h"

typedef itk::Image< char, 2 > ImageType;

ImageType::ConstPointer fixedImage = GetFixedImage(); ImageType::ConstPointer movingImage = GetMovingImage();

typedef itk::Vector< float, 2 > VectorType;typedef itk::Image< VectorType , 2 > VectorFieldType;

typedef itk::DemonsRegistrationFilter< ImageType, ImageType, VectorFieldType > DemonsType;

DemonsType::Pointer demons = DemonsType::New();

Page 41: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

demons->SetFixedImage( fixedImage );

demons->SetMovingImage( movingImage );

demons->SetNumberOfIterations( 200 );

demons->SetStandardDeviations( 1.0 );

demons->Update();

ImageType::ConstPointer vectorField = demons->GetOutput();

Page 42: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene

Page 43: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Model

Page 44: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

After

Registration

Page 45: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene

Page 46: ITK Deformable Registration Demons Methods. Deformable Registration

Demons Registration: Type 1

Scene

Page 47: ITK Deformable Registration Demons Methods. Deformable Registration

Requirements

Fixed and Moving images should have

the same intensity distribution !

Page 48: ITK Deformable Registration Demons Methods. Deformable Registration

Eventual Preprocessing

- Histogram Matching Filter

- Anisotropic Diffusion Filtering

Page 49: ITK Deformable Registration Demons Methods. Deformable Registration

Image Registration Framework

FixedImage

MovingImage

IncrementComputation

Transform

InterpolatorPDE

Solver

Resampler

MovingRegistered

DeformationField

Page 50: ITK Deformable Registration Demons Methods. Deformable Registration

Enjoy ITK !