CSci 6971: Image Registration Lecture 10: Registration Components February 13, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick The Programming Process rUse an editor to create a program file (source file). l contains the text of.
Advertisements

ITK Registration Methods
ITK Deformable Registration
ITK Deformable Registration
Medical Image Registration Kumar Rajamani. Registration Spatial transform that maps points from one image to corresponding points in another image.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
CSci 6971: Image Registration Lecture 14 Distances and Least Squares March 2, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
NAMIC AHM, Jan 2008 Registration Helper Classes Stephen Aylward Matt Turek Luis Ibanez.
National Alliance for Medical Image Computing ITK The Image Segmentation and Registration Toolkit Julien Jomier Kitware Inc.
Medical Imaging Mohammad Dawood Department of Computer Science University of Münster Germany.
CSci 6971: Image Registration Lecture 3: Images and Transformations January 20, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 6: Getting Started with ITK January 30, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 26: BSpline Transforms April 20, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI.
Motion Analysis (contd.) Slides are from RPI Registration Class.
CSci 6971: Image Registration Lecture 4: First Examples January 23, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.
CSci 6971: Image Registration Lecture 8: Registration Components February 6, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 27: FEM-Based Methods April 23, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.
Different registration methods Narendhran Vijayakumar 01/25/2008.
CSci 6971: Image Registration Lecture 2: Vectors and Matrices January 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI.
CSci 6971: Image Registration Lecture 9: Registration Components February 10, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.
CSci 6971: Image Registration Lecture 20: Demons Registration April 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI.
CSci 6971: Image Registration Lecture 5: Feature-Base Regisration January 27, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 16: View-Based Registration March 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
A Big Thanks Prof. Jason Bohland Quantitative Neuroscience Laboratory Boston University Dr. Luis Ibanez Open Source Proponent,
National Alliance for Medical Image Computing Registration in Slicer3 Julien Jomier Kitware Inc.
CS 192 Lecture 3 Winter 2003 December 5, 2003 Dr. Shafay Shamail.
Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Medical Imaging ITK.
Image Registration Lecture 7: Getting Started with ITK March 15, 2005 Prof. Charlene Tsai.
ITK Lecture 13: Registration
Digital Image Processing Lecture 7: Geometric Transformation March 16, 2005 Prof. Charlene Tsai.
Building Prostate Statistical Atlas using Large-Deformation Image Registration Eric Hui University of Waterloo – MIAMI Bi-weekly.
Unit 5: Geometric Transformations.
CSci 6971: Image Registration Lecture 3: Images and Transformations March 1, 2005 Prof. Charlene Tsai.
ITK Input/Output Kitware Inc.. Overview IO Factory Mechanism Image File IO Transform File IO SpatialObject File IO Logger.
Jan Kamenický Mariánská  We deal with medical images ◦ Different viewpoints - multiview ◦ Different times - multitemporal ◦ Different sensors.
Slicer3 for developers – S.Pujol -1- National Alliance for Medical Image Computing Slicer3 Course for developers Sonia Pujol, Ph.D. Surgical Planning Laboratory.
Overview of C++ Templates
LESSON 5-1 I can draw reflected images. I can recognize and draw lines of symmetry.
ELE 488 Fall 2006 Image Processing and Transmission ( )
CSci 6971: Image Registration Lecture 15: Data Structures & Other RGRL Features March 5, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck.
ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic.
Image registration aligns the common features of two images. The open-source Insight Toolkit (ITK, funded by the National Library of Medicine) provides.
Image Registration Lecture 9: Registration Components March 22, 2005 Prof. Charlene Tsai.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, N Y S S, India DTEL DTEL (Department for Technology.
Kelly Davis Monitoring and Event System Kelly Davis AEI.
Unit 2 Vocabulary. Line of Reflection- A line that is equidistant to each point corresponding point on the pre- image and image Rigid Motion- A transformation.
Advanced Programming Constants, Declarations, and Definitions Derived Data Types.
ITK Statistical Classification Kitware Inc.. Statistical Classification Multiple Components Images K-Means Markov Random Fields.
Geometry Rigid Transformations What do the words below mean? (think 1 min, discuss in group 1 min) Translation Reflection Rotation A SLIDE. The object.
Insight Toolkit Introduction Luis Ibáñez William Schroeder Insight Software Consortium.
What is a rigid transformation?  A transformation that does not change the size or shape of a figure.
C++ Lesson 1.
Parallel Lines and a Transversal Parallel Lines and a Transversal
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Computer Graphics Transformations.
Lecture 7 Geometric Transformations (Continued)
Lecture 12 Theory of Registration ch
Reserved Words.
درس برنامه‌سازي کامپيوتر
ITK Architecture Kitware Inc..
Scale Invariant Feature Transform
Unit 7: Transformations
Seoul National University
Geometry is Everywhere By: Alena Krolczyk
Geometrical Transformations
ITK Workshop Software Design October 5-8, 2005.
NAC: Optimized registration in Slicer
Seoul National University
Pages Draw a Point at the center of dilation (Point P).
Presentation transcript:

CSci 6971: Image Registration Lecture 10: Registration Components February 13, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware

Image RegistrationLecture 10 2 Registration Components Basic Registration Framework

Image RegistrationLecture 10 3 Image Registration Framework Fixed Image Moving Image Metric Transform Interpolator Optimizer Parameters

Image RegistrationLecture 10 4 Image Registration #include ”itkImageRegistrationMethod.h” #include ”itkTranslationTransform.h” #include ”itkMeanSquaresImageToImageMetric.h” #include ”itkLinearInterpolateImageFunction.h” #include ”itkRegularStepGradientDescentOptimizer.h” #include ”itkImage.h” #include ”itkImageFileReader.h” #include ”itkImageFileWriter.h” #include ”itkResampleImageFilter.h”

Image RegistrationLecture 10 5 Image Registration const unsigned int Dimension = 2; typedef unsigned char PixelType; typedef itk::Image FixedImageType; typedef itk::Image MovingImageType; typedef itk::TranslationTransform TransformType; typedef itk::RegularStepGradientDescentOptimizer OptimizerType; typedef itk::LinearInterpolateImageFunction InterpolatorType; typedef itk::MeanSquaresImageToImageMetric MetricType; typedef itk::ImageRegistrationMethod RegistrationType;

Image RegistrationLecture 10 6 Image Registration TransformType::Pointer transform = TransformType::New(); OptimizerType::Pointer optimizer = OptimizerType::New(); InterpolatorType::Pointer interpolator = InterpolatorType::New(); MetricType::Pointer metric = MetricType::New(); RegistrationType::Pointer registrator = RegistrationType::New(); registrator->SetTransform( transform ); registrator->SetOptimizer( optimizer ); registrator->SetInterpolator( interpolator ); registrator->SetMetric( metric ); registrator->SetFixedImage( fixedImageReader->GetOutput() ); registrator->SetMovingImage( movingImageReader->GetOutput() );

Image RegistrationLecture 10 7 Image Registration registrator->SetFixedImageRegion( fixedImageReader->GetOutput()->GetBufferedRegion() ); typedef RegistrationType::ParametersType ParametersType; transform->SetIdentity(); registrator->SetInitialTransformParameters( transform->GetParameters() ); optimizer->SetMaximumStepLength( 4.00 ); optimizer->SetMinimumStepLength( 0.01 ); optimizer->SetNumberOfIterations( 100 ); optimizer->MaximizeOff();

Image RegistrationLecture 10 8 Image Registration try { registrator->StartRegistration (); } catch( itk::ExceptionObject & excp ) { std::cerr << “Error in registration” << std::endl; std::cerr << excp << std::endl; } transform->SetParameters( registrator->GetLastTransformParameters() );

Image RegistrationLecture 10 9 Image Registration Framework Fixed Image Moving Image Metric Transform Interpolator Optimizer Parameters Resampler Moving Registered

Image RegistrationLecture Image Registration typedef itk::ResampleImageFilter ResamplerType; ResamplerType ::Pointer resampler = ResamplerType::New(); resampler->SetTransform ( transform ); resampler->SetInput( movingImageReader->GetOutput() ); FixedImageType ::Pointer fixedImage = fixedImageReader->GetOutput(); resampler->SetOrigin( fixedImage->GetOrigin() ); resampler->SetSpacing( fixedImage->GetSpacing() ); resampler->SetSize( fixedImage->GetLargestPossibleRegion()->GetSize() ); resampler->Update();

Image RegistrationLecture Image Registration Tracking the Registration Process

Image RegistrationLecture Observing Registration #include ”itkCommand.h” class CommandIteration : public itk::Command { public: typedef CommandIteration Self; typedef itk::Command SuperClass; typedef itk::SmartPointer Pointer; itkNewMacro( Self ); protected: CommandIteration() {}; public: typedef itk::RegularStepGradientDescentOptimizer OptimizerType; typedef const OptimizerType * OptimizerPointer;

Image RegistrationLecture Observing Registration void Execute( itk::Object * caller, const itk::EventObject & event ) { this-> Execute( (const itk::Object *) caller, event ); } void Execute( const itk::Object * caller, const itk::EventObject & event ) { OptimizerPointer optimizer = dynamic_cast ( caller ); if( typeid( event ) == typeid( itk::IterationEvent ) ) { std::cout GetCurrentIteration() << “ : “; std::cout GetValue() << “ : “; std::cout GetCurrentPosition() << std::endl; } }

Image RegistrationLecture Observing Registration CommandIteration::Pointer observer = CommandIteration::New(); optimizer->AddObserver( itk::IterationEvent(), observer ) try { registrator->StartRegistration (); } catch( itk::ExceptionObject & excp ) { std::cerr << “Error in registration” << std::endl; std::cerr << excp << std::endl; }

Image RegistrationLecture Registration dirty little secrets Rotation – Translation Parameter Scaling

Image RegistrationLecture Registration dirty little secrets Fixed Image Moving Image Registered Moving Image

Image RegistrationLecture Gradient Descent Optimizer f( x, y ) S = L ∙ G( x, y ) f( x, y ) ∆ G( x, y ) =

Image RegistrationLecture Gradient Descent Optimizer f( x, y ) S = L ∙ G( x, y ) f( x, y ) ∆ G( x, y ) =

Image RegistrationLecture Gradient Descent Optimizer f( x, y ) S = L ∙ G( x, y ) f( x, y ) ∆ G( x, y ) =

Image RegistrationLecture Gradient Descent Optimizer f( x, y ) S = L ∙ G( x, y ) f( x, y ) ∆ G( x, y ) =

Image RegistrationLecture Gradient Descent Optimizer f( x, y ) S = L ∙ G( x, y ) f( x, y ) ∆ G( x, y ) =

Image RegistrationLecture Gradient Descent Optimizer f( x, y ) S = L ∙ G( x, y ) f( x, y ) ∆ G( x, y ) = How about a factor 1:100 ?

Image RegistrationLecture Radians & Millimeters 0.0 rad x y 1.57 rad 180 mm

Image RegistrationLecture Radians & Millimeters 0.0 rad x y 1.57 rad 180 mm 1.57 rad 180 mm 1:100

Image RegistrationLecture Other Transforms Centered Rigid 2D

Image RegistrationLecture Rotation around the Center y Fixed Transform 10 o x y Moving x

Image RegistrationLecture Centered Rigid 2D Transform #include ”itkImageRegistrationMethod.h” #include ”itkCenteredRigid2DTransform.h” #include ”itkMeanSquaresImageToImageMetric.h” #include ”itkLinearInterpolateImageFunction.h” #include ”itkRegularStepGradientDescentOptimizer.h” #include ”itkCenteredTransformInitializer.h” #include ”itkImage.h” #include ”itkImageFileReader.h” #include ”itkImageFileWriter.h” #include ”itkResampleImageFilter.h”

Image RegistrationLecture Centered Rigid 2D Transform const unsigned int Dimension = 2; typedef unsigned char PixelType; typedef itk::Image FixedImageType; typedef itk::Image MovingImageType; typedef itk::CenteredRigid2DTransform TransformType; typedef itk:: CenteredTransformInitializer InitializerType;

Image RegistrationLecture Centered Rigid 2D Transform TransformType::Pointer transform = TransformType::New(); InitializerType::Pointer initializer = InitializerType::New(); OptimizerType::Pointer optimizer = OptimizerType::New(); InterpolatorType::Pointer interpolator = InterpolatorType::New(); MetricType::Pointer metric = MetricType::New(); RegistrationType::Pointer registrator = RegistrationType::New(); registrator->SetTransform( transform ); registrator->SetOptimizer( optimizer ); registrator->SetInterpolator( interpolator ); registrator->SetMetric( metric ); registrator->SetFixedImage( fixedImageReader->GetOutput() ); registrator->SetMovingImage( movingImageReader->GetOutput() );

Image RegistrationLecture Centered Transform Initializer y Fixed Image Transform x y Moving Image x Geometry On

Image RegistrationLecture Centered Transform Initializer y Fixed Image Transform x y Moving Image x Moments On Xm = Sum( x ∙ I ) / Sum( I ) Ym = Sum( y ∙ I ) / Sum( I )

Image RegistrationLecture Centered Rigid 2D Transform registrator->SetFixedImageRegion( fixedImageReader->GetOutput()->GetBufferedRegion() ); initializer->SetTransform ( transform ); initializer->SetFixedImage( fixedImageReader->GetOutput() ); initializer->SetMovingImage( movingImageReader->GetOutput() ); initializer->MomentsOn(); initializer->InitializeTransform(); registrator->SetInitialTransformParameters( transform->GetParameters() );

Image RegistrationLecture Centered Rigid 2D Transform y x Array of Parameters P[ 0 ] P[ 1 ] P[ 2 ] P[ 3 ] P[ 4 ] Angle Center X Center Y Trans X Trans Y

Image RegistrationLecture Centered Rigid 2D Transform typedef OptimizerType::ScaleType OptimizerScalesType; OptimizerScalesType optimizerScales( optimizer->SetMaximumStepLength() ); const double translationScale = 1.0 / ; optimizerScales[ 0 ] = 1.0; optimizerScales[ 1 ] = translationScale; optimizerScales[ 2 ] = translationScale; optimizerScales[ 3 ] = translationScale; optimizerScales[ 4 ] = translationScale; optimizer->SetScales( optimizerScales );

Image RegistrationLecture Centered Rigid 2D Transform try { registrator->StartRegistration (); } catch( itk::ExceptionObject & excp ) { std::cerr << “Error in registration” << std::endl; std::cerr << excp << std::endl; } transform->SetParameters( registrator->GetLastTransformParameters() );

Image RegistrationLecture Image Registration Framework Fixed Image Moving Image Metric Transform Interpolator Optimizer Parameters Resampler Moving Registered

Image RegistrationLecture Centered Rigid 2D Transform typedef itk::ResampleImageFilter ResamplerType; ResamplerType ::Pointer resampler = ResamplerType::New(); resampler->SetTransform ( transform ); resampler->SetInput( movingImageReader->GetOutput() ); FixedImageType ::Pointer fixedImage = fixedImageReader->GetOutput(); resampler->SetOrigin( fixedImage->GetOrigin() ); resampler->SetSpacing( fixedImage->GetSpacing() ); resampler->SetSize( fixedImage->GetLargestPossibleRegion()->GetSize() ); resampler->Update();

Image RegistrationLecture Other Transforms Affine 2D

Image RegistrationLecture Affine Transforms M 11 M 12 T 1 M 21 M 22 T 2

Image RegistrationLecture Affine Transforms Q x M 11 M 12 P x T 1 Q y M 21 M 22 P y T 2 =∙+

Image RegistrationLecture Affine Transform – Shearing Q x 1 a P x T 1 Q y 0 1 P y T 2 =∙+

Image RegistrationLecture Shearing Component y x a 1 (x,y) ( x + ay, y )

Image RegistrationLecture Shearing Component y’ x y x’

Image RegistrationLecture Affine Transform – Shearing Q x 1 0 P x T 1 Q y b 1 P y T 2 =∙+

Image RegistrationLecture Shearing Component y x b 1 (x,y) ( x, y + bx )

Image RegistrationLecture Shearing Component y x y’ x’

Image RegistrationLecture Coefficients - Orders of Magnitude Q x P x 100 Q y P y 100 =∙+

Image RegistrationLecture Affine Transform – Rotation Q x cosθ -sinθ P x T 1 Q y sinθ cosθ P y T 2 = ∙+

Image RegistrationLecture Affine Transform – Scaling Q x S x 0 P x T 1 Q y 0 S y P y T 2 =∙+

Image RegistrationLecture Affine Transform - Parameterization M 11 M 12 T 1 M 21 M 22 T 2 [ P 0 P 1 P 2 P 3 P 4 P 5 ]

Image RegistrationLecture Parameter Scaling M 11 M 12 T 1 M 21 M 22 T 2 [ P 0 P 1 P 2 P 3 P 4 P 5 ] range [ ] scale [ ]

Image RegistrationLecture Centered Affine Transform #include ”itkImageRegistrationMethod.h” #include ”itkCenteredAffineTransform.h” #include ”itkMeanSquaresImageToImageMetric.h” #include ”itkLinearInterpolateImageFunction.h” #include ”itkRegularStepGradientDescentOptimizer.h” #include ”itkCenteredTransformInitializer.h” #include ”itkImage.h” #include ”itkImageFileReader.h” #include ”itkImageFileWriter.h” #include ”itkResampleImageFilter.h”

Image RegistrationLecture Centered Affine Transform const unsigned int Dimension = 2; typedef unsigned char PixelType; typedef itk::Image FixedImageType; typedef itk::Image MovingImageType; typedef itk::CenteredAffineTransform TransformType; typedef itk:: CenteredTransformInitializer InitializerType;

Image RegistrationLecture Centered Affine Transform TransformType::Pointer transform = TransformType::New(); InitializerType::Pointer initializer = InitializerType::New(); OptimizerType::Pointer optimizer = OptimizerType::New(); InterpolatorType::Pointer interpolator = InterpolatorType::New(); MetricType::Pointer metric = MetricType::New(); RegistrationType::Pointer registrator = RegistrationType::New(); registrator->SetTransform( transform ); registrator->SetOptimizer( optimizer ); registrator->SetInterpolator( interpolator ); registrator->SetMetric( metric ); registrator->SetFixedImage( fixedImageReader->GetOutput() ); registrator->SetMovingImage( movingImageReader->GetOutput() );

Image RegistrationLecture Centered Transform Initializer y Fixed Image Transform x y Moving Image x Geometry On

Image RegistrationLecture Centered Transform Initializer y Fixed Image Transform x y Moving Image x Moments On Xm = Sum( x ∙ I ) / Sum( I ) Ym = Sum( y ∙ I ) / Sum( I )

Image RegistrationLecture Centered Affine Transform registrator->SetFixedImageRegion( fixedImageReader->GetOutput()->GetBufferedRegion() ); initializer->SetTransform ( transform ); initializer->SetFixedImage( fixedImageReader->GetOutput() ); initializer->SetMovingImage( movingImageReader->GetOutput() ); initializer->MomentsOn(); initializer->InitializeTransform(); registrator->SetInitialTransformParameters( transform->GetParameters() );

Image RegistrationLecture Affine Transform - Parameterization M 11 M 12 T 1 M 21 M 22 T 2 P[0] P[1] P[2] P[3] P[4] P[5]

Image RegistrationLecture Centered Affine Transform typedef OptimizerType::ScaleType OptimizerScalesType; OptimizerScalesType optimizerScales( optimizer->GetNumberOfParameters() ); optimizerScales[ 0 ] = 1.0; optimizerScales[ 1 ] = 10.0; optimizerScales[ 2 ] = 10.0; optimizerScales[ 3 ] = 1.0; optimizerScales[ 4 ] = 0.01; optimizerScales[ 5 ] = 0.01; optimizer->SetScales( optimizerScales );

Image RegistrationLecture Centered Rigid 2D Transform try { registrator->StartRegistration (); } catch( itk::ExceptionObject & excp ) { std::cerr << “Error in registration” << std::endl; std::cerr << excp << std::endl; } transform->SetParameters( registrator->GetLastTransformParameters() );

Image RegistrationLecture Image Registration Framework Fixed Image Moving Image Metric Transform Interpolator Optimizer Parameters Resampler Moving Registered

Image RegistrationLecture Final Resampling typedef itk::ResampleImageFilter ResamplerType; ResamplerType ::Pointer resampler = ResamplerType::New(); resampler->SetTransform ( transform ); resampler->SetInput( movingImageReader->GetOutput() ); FixedImageType ::Pointer fixedImage = fixedImageReader->GetOutput(); resampler->SetOrigin( fixedImage->GetOrigin() ); resampler->SetSpacing( fixedImage->GetSpacing() ); resampler->SetSize( fixedImage->GetLargestPossibleRegion()->GetSize() ); resampler->Update();

Image RegistrationLecture End Enjoy ITK !