510 likes | 774 Views
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.
E N D
CSci 6971: Image Registration Lecture 20: Demons RegistrationApril 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware
Deformable Registration Deformable Registration Lecture 20
Deformable Transforms Deformable Transforms Lecture 20
Deformable Transformation y y Transform x x Fixed Image Moving Image Lecture 20
Deformable Transformation y y Transform x x Fixed Image Moving Image Lecture 20
Deformable Transformation y y Transform x x Fixed Image Moving Image Lecture 20
Image Resampling Interpolator FixedImage Resample Image Filter MovingImage DeformedImage Transform Lecture 20
Image Resampling Interpolator FixedImage Resample Image Filter MovingImage High Order Polynomials Splines Explicit Vector Field Orthogonal Basis DeformedImage Transform Lecture 20
Kernel Splines Transforms Target Landmarks Source Landmarks Interpolated Values Displacement Vectors Lecture 20
Kernel Spline Transforms • Thin Plates • Thin Plates R2 log R • Elastic Body • Elastic Body Reciprocal • Volume Lecture 20
Kernel Spline Transforms InsightApplications / ThinPlateSplines Lecture 20
Resampling: Kernel Spline Transform #include "itkImage.h" #include "itkResampleImageFilter.h" #include "itkLinearInterpolateImageFunction.h" #include "itkElasticBodySplineKernelTransform.h" typedef itk::Image< char, 2 > ImageType; ImageType::ConstPointerfixedImage = GetFixedImage(); ImageType::ConstPointermovingImage = GetMovingImage(); typedef itk::LinearInterpolateImageFunction<ImageType, double >InterpolatorType; InterpolatorType::Pointerinterpolator = InterpolatorType::New(); typedef itk::ResampleImageFilter< ImageType, ImageType > FilterType; FilterType::Pointerresampler = FilterType::New(); Lecture 20
Resampling: Kernel Spline Transform typedef itk::ElasticBodySplineKernelTransform<double, 2 > TransformType; TransformType::Pointertransform = TransformType::New(); resampler->SetInterpolator( interpolator ); resampler->SetInput( movingImage ); ImageType::RegionTyperegion = fixedImage->GetBufferedRegion(); resampler->SetSize(region->GetSize() ); resampler->SetOutputStartIndex( region->GetIndex() ); resampler->SetOutputSpacing( fixedImage->GetSpacing() ); resampler->SetOutputOrigin( fixedImage->GetOrigin() ); Lecture 20
Resampling: Kernel Spline Transform resampler->SetTransform(transform ); typedef TransformType::PointSetType PointSetType; PointSetType::PointersourceLandmarks = PointSetType::New(); PointSetType::PointertargetLandmarks = PointSetType::New(); transform->SetSourceLandmarks(sourceLandmarks ); transform->SetTargetLandmarks(targetLandmarks ); typedef PointSetType::PointsContainer PointsContainer; PointsContainer::Pointer sources = sourceLandmarks->GetPoints(); PointsContainer::Pointer targets = targetLandmarks->GetPoints(); Lecture 20
Resampling: Kernel Spline Transform sources->Reserve( numberOfLandmarks ); targets->Reserve( numberOfLandmarks ); typedef PointSetType::PointType PointType; PointTypesource; PointTypetarget; 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::ConstPointerdeformedImage = resampler->GetOutput(); Lecture 20
Kernel Spline Transforms VolView : ITK Plugin Lecture 20
Kernel Spline Transforms VolView : ITK Plugin Lecture 20
Deformable Transforms Deformation Fields Lecture 20
Deformation Vector Field ParaView: http://www.paraview.org Lecture 20
Warp Image Filter #include "itkImage.h" #include "itkWarpImageFilter.h" #include "itkLinearInterpolateImageFunction.h" typedef itk::Image< char, 2 > ImageType; ImageType::ConstPointerfixedImage = GetFixedImage(); ImageType::ConstPointermovingImage = GetMovingImage(); typedef itk::LinearInterpolateImageFunction<ImageType, double >InterpolatorType; InterpolatorType::Pointerinterpolator = InterpolatorType::New(); typedef itk::Vector< float, 2 > VectorType; typedef itk::Image< VectorType , 2 > VectorFieldType; VectorFieldType::PointervectorField = GetVectorField(); Lecture 20
Warp Image Filter typedef itk::WarpImageFilter< ImageType, ImageType, VectorFieldType > WarpFilterType; WarpFilterType::PointerwarpFilter = WarpFilterType::New(); warpFilter->SetInterpolator( interpolator ); warpFilter->SetInput( movingImage ); warpFilter->SetOutputSpacing( fixedImage->GetSpacing() ); warpFilter->SetOutputOrigin( fixedImage->GetOrigin() ); warpFilter->SetDeformationField( vectorField ); warpFilter->Update(); ImageType::ConstPointerdeformedImage = warpFilter->GetOutput(); Lecture 20
Demons Registration Demons Registration Lecture 20
Demons Registration Demons is a Family of Algorithms Lecture 20
Demons Registration Demons Type 0 Lecture 20
Demons Registration: Type 0 Transform Scene Model Lecture 20
Demons Registration: Type 0 Transform Scene Gradients Model Lecture 20
Demons Registration: Type 0 Transform Scene Forces Model Lecture 20
Demons Registration Demons Type 1 Lecture 20
Demons Registration: Type 1 Transform Scene Vector Field Model Lecture 20
Demons Registration: Type 1 Transform Scene Vector Field Model Lecture 20
Demons Registration: Type 1 Transform Scene Vector Field Model Lecture 20
Demons Registration: Type 1 Transform Scene Vector Field Model Lecture 20
Demons Registration: Type 1 Gradient Scene Lecture 20
Demons Registration: Type 1 Current Estimation Intensity Space Gradient Desired Displacement Scene Lecture 20
Demons Registration: Type 1 Transform Scene Vector Field Model Lecture 20
Demons Registration: Type 1 Scene Lecture 20
Incremental Field Next Field Demons Registration: Type 1 Iterations Previous Field Gaussian Smoothing Lecture 20
Demons Registration: Type 1 ( s – m ) . Grad(s) V = Grad(s)2 ( s – m ) . Grad(s) V = Grad(s)2 + (s-m)2 K Lecture 20
Image Registration Framework FixedImage Increment Computation PDE Solver MovingImage Interpolator DeformationField Transform Lecture 20
Demons Registration: Type 1 #include "itkImage.h" #include "itkDemonsRegistrationFilter.h" typedef itk::Image< char, 2 > ImageType; ImageType::ConstPointerfixedImage = GetFixedImage(); ImageType::ConstPointermovingImage = GetMovingImage(); typedef itk::Vector< float, 2 > VectorType; typedef itk::Image< VectorType , 2 > VectorFieldType; typedef itk::DemonsRegistrationFilter< ImageType, ImageType, VectorFieldType > DemonsType; DemonsType::Pointerdemons = DemonsType::New(); Lecture 20
Demons Registration: Type 1 demons->SetFixedImage( fixedImage ); demons->SetMovingImage( movingImage ); demons->SetNumberOfIterations( 200 ); demons->SetStandardDeviations( 1.0 ); demons->Update(); ImageType::ConstPointervectorField = demons->GetOutput(); Lecture 20
Demons Registration: Type 1 Scene Lecture 20
Demons Registration: Type 1 Model Lecture 20
Demons Registration: Type 1 After Registration Lecture 20
Demons Registration: Type 1 Scene Lecture 20
Demons Registration: Type 1 Scene Lecture 20
Requirements Fixed and Moving images should have the same intensity distribution ! Lecture 20
Eventual Preprocessing - Histogram Matching Filter- Anisotropic Diffusion Filtering Lecture 20
Image Registration Framework FixedImage Increment Computation PDE Solver MovingImage Interpolator DeformationField Transform Resampler MovingRegistered Lecture 20
End Enjoy ITK ! Lecture 20