csci 6971: image registration lecture 20: demons registration april 16, 2004

50
CSci 6971: Image Registration Lecture 20: Demons Registration April 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware

Upload: osmond

Post on 19-Jan-2016

42 views

Category:

Documents


0 download

DESCRIPTION

CSci 6971: Image Registration Lecture 20: Demons Registration April 16, 2004. Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware. Deformable Registration. Deformable Registration. Deformable Transforms. Deformable Transforms. Deformable Transformation. y. y. Transform. x. x. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

CSci 6971: Image Registration Lecture 20: Demons Registration

April 16, 2004

CSci 6971: Image Registration Lecture 20: Demons Registration

April 16, 2004

Prof. Chuck Stewart, RPIDr. Luis Ibanez, KitwareProf. Chuck Stewart, RPIDr. Luis Ibanez, Kitware

Page 2: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 2

Deformable RegistrationDeformable Registration

Deformable Registration

Page 3: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 3

Deformable TransformsDeformable Transforms

Deformable Transforms

Page 4: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 4

Deformable TransformationDeformable Transformation

y

Fixed Image

Transform

x

y

Moving Image

x

Page 5: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 5

Deformable TransformationDeformable Transformation

y

Fixed Image

Transform

x

y

Moving Image

x

Page 6: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 6

Deformable TransformationDeformable Transformation

y

Fixed Image

Transform

x

y

Moving Image

x

Page 7: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 7

Image ResamplingImage Resampling

FixedImage

MovingImage

Transform

Interpolator

ResampleImageFilter

DeformedImage

Page 8: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 8

Image ResamplingImage Resampling

FixedImage

MovingImage

Transform

Interpolator

ResampleImageFilter

DeformedImage

High OrderPolynomialsOrthogonal

BasisSplines

Explicit VectorField

Page 9: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 9

Kernel Splines TransformsKernel Splines Transforms

SourceLandmarks

TargetLandmarks

DisplacementVectors

InterpolatedValues

Page 10: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 10

Kernel Spline TransformsKernel Spline Transforms

• Thin Plates

• Thin Plates R2 log R

• Elastic Body

• Elastic Body Reciprocal

• Volume

Page 11: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 11

Kernel Spline TransformsKernel Spline Transforms

InsightApplications / ThinPlateSplines

Page 12: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 12

Resampling: Kernel Spline TransformResampling: 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 13

Resampling: Kernel Spline TransformResampling: 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 14

Resampling: Kernel Spline TransformResampling: 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 15

Resampling: Kernel Spline TransformResampling: Kernel Spline Transform

sources->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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 16

Kernel Spline TransformsKernel Spline Transforms

VolView : ITK Plugin

Page 17: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 17

Kernel Spline TransformsKernel Spline Transforms

VolView : ITK Plugin

Page 18: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 18

Deformable TransformsDeformable Transforms

Deformation Fields

Page 19: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 19

Deformation Vector FieldDeformation Vector Field

ParaView: http://www.paraview.org

Page 20: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 20

Warp Image FilterWarp 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 21

Warp Image FilterWarp Image Filter

typedef 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 22

Demons RegistrationDemons Registration

Demons Registration

Page 23: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 23

Demons RegistrationDemons Registration

Demons is a Family

of Algorithms

Page 24: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 24

Demons RegistrationDemons Registration

Demons Type 0

Page 25: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 25

Demons Registration: Type 0Demons Registration: Type 0

Scene

Model

Transform

Page 26: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 26

Demons Registration: Type 0Demons Registration: Type 0

Scene

Model

Transform

Gradients

Page 27: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 27

Demons Registration: Type 0Demons Registration: Type 0

Scene

Model

Transform

Forces

Page 28: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 28

Demons RegistrationDemons Registration

Demons Type 1

Page 29: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 29

Demons Registration: Type 1Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 30: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 30

Demons Registration: Type 1Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 31: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 31

Demons Registration: Type 1Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 32: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 32

Demons Registration: Type 1Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 33: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 33

Demons Registration: Type 1Demons Registration: Type 1

Scene

Gradient

Page 34: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 34

Demons Registration: Type 1Demons Registration: Type 1

Scene

Gradient

Intensity

Space

Desired Displacement

CurrentEstimation

Page 35: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 35

Demons Registration: Type 1Demons Registration: Type 1

Scene Model

Transform

Vector Field

Page 36: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 36

Demons Registration: Type 1Demons Registration: Type 1

Scene

Page 37: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 37

Demons Registration: Type 1Demons Registration: Type 1

Previous Field Incremental Field Next Field

Iterations

GaussianSmoothing

Page 38: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 38

Demons Registration: Type 1Demons 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 39

Image Registration FrameworkImage Registration Framework

FixedImage

MovingImage

IncrementComputation

Transform

InterpolatorPDE

Solver

DeformationField

Page 40: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 40

Demons Registration: Type 1Demons 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 41

Demons Registration: Type 1Demons 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: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 42

Demons Registration: Type 1Demons Registration: Type 1

Scene

Page 43: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 43

Demons Registration: Type 1Demons Registration: Type 1

Model

Page 44: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 44

Demons Registration: Type 1Demons Registration: Type 1

After

Registration

Page 45: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 45

Demons Registration: Type 1Demons Registration: Type 1

Scene

Page 46: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 46

Demons Registration: Type 1Demons Registration: Type 1

Scene

Page 47: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 47

RequirementsRequirements

Fixed and Moving images should have

the same intensity distribution !

Page 48: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 48

Eventual PreprocessingEventual Preprocessing

- Histogram Matching Filter

- Anisotropic Diffusion Filtering

Page 49: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 49

Image Registration FrameworkImage Registration Framework

FixedImage

MovingImage

IncrementComputation

Transform

InterpolatorPDE

Solver

Resampler

MovingRegistered

DeformationField

Page 50: CSci 6971: Image Registration  Lecture 20:  Demons Registration April 16, 2004

Image Registration Lecture 20 50

EndEnd

Enjoy ITK !