csci 6971: image registration lecture 20: demons registration april 16, 2004
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 PresentationTRANSCRIPT
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
Image Registration Lecture 20 2
Deformable RegistrationDeformable Registration
Deformable Registration
Image Registration Lecture 20 3
Deformable TransformsDeformable Transforms
Deformable Transforms
Image Registration Lecture 20 4
Deformable TransformationDeformable Transformation
y
Fixed Image
Transform
x
y
Moving Image
x
Image Registration Lecture 20 5
Deformable TransformationDeformable Transformation
y
Fixed Image
Transform
x
y
Moving Image
x
Image Registration Lecture 20 6
Deformable TransformationDeformable Transformation
y
Fixed Image
Transform
x
y
Moving Image
x
Image Registration Lecture 20 7
Image ResamplingImage Resampling
FixedImage
MovingImage
Transform
Interpolator
ResampleImageFilter
DeformedImage
Image Registration Lecture 20 8
Image ResamplingImage Resampling
FixedImage
MovingImage
Transform
Interpolator
ResampleImageFilter
DeformedImage
High OrderPolynomialsOrthogonal
BasisSplines
Explicit VectorField
Image Registration Lecture 20 9
Kernel Splines TransformsKernel Splines Transforms
SourceLandmarks
TargetLandmarks
DisplacementVectors
InterpolatedValues
Image Registration Lecture 20 10
Kernel Spline TransformsKernel Spline Transforms
• Thin Plates
• Thin Plates R2 log R
• Elastic Body
• Elastic Body Reciprocal
• Volume
Image Registration Lecture 20 11
Kernel Spline TransformsKernel Spline Transforms
InsightApplications / ThinPlateSplines
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();
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() );
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();
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();
Image Registration Lecture 20 16
Kernel Spline TransformsKernel Spline Transforms
VolView : ITK Plugin
Image Registration Lecture 20 17
Kernel Spline TransformsKernel Spline Transforms
VolView : ITK Plugin
Image Registration Lecture 20 18
Deformable TransformsDeformable Transforms
Deformation Fields
Image Registration Lecture 20 19
Deformation Vector FieldDeformation Vector Field
ParaView: http://www.paraview.org
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();
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();
Image Registration Lecture 20 22
Demons RegistrationDemons Registration
Demons Registration
Image Registration Lecture 20 23
Demons RegistrationDemons Registration
Demons is a Family
of Algorithms
Image Registration Lecture 20 24
Demons RegistrationDemons Registration
Demons Type 0
Image Registration Lecture 20 25
Demons Registration: Type 0Demons Registration: Type 0
Scene
Model
Transform
Image Registration Lecture 20 26
Demons Registration: Type 0Demons Registration: Type 0
Scene
Model
Transform
Gradients
Image Registration Lecture 20 27
Demons Registration: Type 0Demons Registration: Type 0
Scene
Model
Transform
Forces
Image Registration Lecture 20 28
Demons RegistrationDemons Registration
Demons Type 1
Image Registration Lecture 20 29
Demons Registration: Type 1Demons Registration: Type 1
Scene Model
Transform
Vector Field
Image Registration Lecture 20 30
Demons Registration: Type 1Demons Registration: Type 1
Scene Model
Transform
Vector Field
Image Registration Lecture 20 31
Demons Registration: Type 1Demons Registration: Type 1
Scene Model
Transform
Vector Field
Image Registration Lecture 20 32
Demons Registration: Type 1Demons Registration: Type 1
Scene Model
Transform
Vector Field
Image Registration Lecture 20 33
Demons Registration: Type 1Demons Registration: Type 1
Scene
Gradient
Image Registration Lecture 20 34
Demons Registration: Type 1Demons Registration: Type 1
Scene
Gradient
Intensity
Space
Desired Displacement
CurrentEstimation
Image Registration Lecture 20 35
Demons Registration: Type 1Demons Registration: Type 1
Scene Model
Transform
Vector Field
Image Registration Lecture 20 36
Demons Registration: Type 1Demons Registration: Type 1
Scene
Image Registration Lecture 20 37
Demons Registration: Type 1Demons Registration: Type 1
Previous Field Incremental Field Next Field
Iterations
GaussianSmoothing
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
Image Registration Lecture 20 39
Image Registration FrameworkImage Registration Framework
FixedImage
MovingImage
IncrementComputation
Transform
InterpolatorPDE
Solver
DeformationField
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();
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();
Image Registration Lecture 20 42
Demons Registration: Type 1Demons Registration: Type 1
Scene
Image Registration Lecture 20 43
Demons Registration: Type 1Demons Registration: Type 1
Model
Image Registration Lecture 20 44
Demons Registration: Type 1Demons Registration: Type 1
After
Registration
Image Registration Lecture 20 45
Demons Registration: Type 1Demons Registration: Type 1
Scene
Image Registration Lecture 20 46
Demons Registration: Type 1Demons Registration: Type 1
Scene
Image Registration Lecture 20 47
RequirementsRequirements
Fixed and Moving images should have
the same intensity distribution !
Image Registration Lecture 20 48
Eventual PreprocessingEventual Preprocessing
- Histogram Matching Filter
- Anisotropic Diffusion Filtering
Image Registration Lecture 20 49
Image Registration FrameworkImage Registration Framework
FixedImage
MovingImage
IncrementComputation
Transform
InterpolatorPDE
Solver
Resampler
MovingRegistered
DeformationField
Image Registration Lecture 20 50
EndEnd
Enjoy ITK !