Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::PyramidImageRegistrationMethod Class Reference

The PyramidImageRegistration class implements a multi-scale registration method. More...

#include <mitkPyramidImageRegistrationMethod.h>

Inheritance diagram for mitk::PyramidImageRegistrationMethod:
Collaboration diagram for mitk::PyramidImageRegistrationMethod:

Public Types

typedef itk::OptimizerParameters< double > ParametersType
 
typedef vnl_matrix_fixed< double, 3, 3 > TransformMatrixType
 
typedef itk::AffineTransform< double > AffineTransformType
 
typedef itk::Euler3DTransform< double > RigidTransformType
 

Public Member Functions

 mitkClassMacroItkParent (PyramidImageRegistrationMethod, itk::Object) static Pointer New()
 
Pointer Clone () const
 
void SetCrossModalityOn ()
 
void SetCrossModalityOff ()
 
void SetCrossModality (bool flag)
 
void SetVerbose (bool flag)
 
void SetVerboseOn ()
 
void SetVerboseOff ()
 
void SetTransformToRigid ()
 
void SetTransformToAffine ()
 
void SetFixedImage (mitk::Image::Pointer)
 
void SetMovingImage (mitk::Image::Pointer)
 
void SetFixedImageMask (mitk::Image::Pointer mask)
 
void SetInitializeByGeometry (bool flag)
 Use the itk::CenteredVersorTransformInitializer to perform initialization step for the registration. More...
 
void Update ()
 
unsigned int GetNumberOfParameters ()
 Get the number of parameters optimized ( 12 or 6 ) More...
 
void GetParameters (double *paramArray)
 Copies the estimated parameters to the given array. More...
 
ParametersType GetLastRegistrationParameters ()
 Retrieve the parameters of the last registration computed. More...
 
void SetInitialParameters (ParametersType &params)
 Set the starting position of the registration. More...
 
void SetUseAdvancedInterpolation (bool flag)
 Control the interpolator used for resampling. More...
 
void SetUseNearestNeighborInterpolation (bool flag)
 Control the interpolator used for resampling. More...
 
void SetUseFixedImageMask (bool flag)
 Set if fixed image mask is used to exclude a region. More...
 
mitk::Image::Pointer GetResampledMovingImage ()
 Returns the moving image transformed according to the estimated transformation and resampled to the geometry of the fixed/resampling reference image. More...
 
mitk::Image::Pointer GetResampledMovingImage (mitk::Image::Pointer movingImage, double *transform)
 Returns a provided moving image transformed according to the given transformation and resampled to the geometry of the fixed/resampling reference image. More...
 
TransformMatrixType GetLastRotationMatrix ()
 Get the rotation part of the transformation as a vnl_fixed_matrix<double, 3,3> More...
 

Protected Member Functions

 PyramidImageRegistrationMethod ()
 
 ~PyramidImageRegistrationMethod ()
 
template<typename TPixel1 , unsigned int VImageDimension1, typename TPixel2 , unsigned int VImageDimension2>
void RegisterTwoImagesV4 (itk::Image< TPixel1, VImageDimension1 > *itkImage1, itk::Image< TPixel2, VImageDimension2 > *itkImage2)
 The method takes two itk::Images and performs a multi-scale registration on them. More...
 
template<typename TPixel , unsigned int VDimension>
void ResampleMitkImage (itk::Image< TPixel, VDimension > *itkImage, mitk::Image::Pointer &outputImage)
 ResampleMitkImage applies the functionality of an the itk::ResampleImageFilter to the given mitk::Image. More...
 

Protected Attributes

mitk::Image::Pointer m_FixedImage
 
mitk::Image::Pointer m_MovingImage
 
mitk::Image::Pointer m_FixedImageMask
 
bool m_CrossModalityRegistration
 
bool m_UseAffineTransform
 
bool m_UseWindowedSincInterpolator
 
bool m_UseNearestNeighborInterpolator
 
bool m_UseMask
 
double * m_EstimatedParameters
 
ParametersType m_InitialParameters
 
bool m_Verbose
 
bool m_InitializeByGeometry
 

Detailed Description

The PyramidImageRegistration class implements a multi-scale registration method.

The PyramidImageRegistration class is suitable for aligning (f.e.) brain MR images. The method offers two transform types

  • Rigid: optimizing translation and rotation only and
  • Affine ( default ): with scaling in addition ( 12 DOF )

The error metric is internally chosen based on the selected task type :

See also
SetCrossModalityOn

It uses

  • MattesMutualInformation for CrossModality=on ( default ) and
  • NormalizedCorrelation for CrossModality=off.

Definition at line 58 of file mitkPyramidImageRegistrationMethod.h.

Member Typedef Documentation

typedef itk::AffineTransform< double > mitk::PyramidImageRegistrationMethod::AffineTransformType

Definition at line 75 of file mitkPyramidImageRegistrationMethod.h.

typedef itk::OptimizerParameters<double> mitk::PyramidImageRegistrationMethod::ParametersType

Definition at line 70 of file mitkPyramidImageRegistrationMethod.h.

typedef itk::Euler3DTransform< double > mitk::PyramidImageRegistrationMethod::RigidTransformType

Definition at line 76 of file mitkPyramidImageRegistrationMethod.h.

typedef vnl_matrix_fixed< double, 3, 3> mitk::PyramidImageRegistrationMethod::TransformMatrixType

Typedef for the transformation matrix, corresponds to the InternalMatrixType from ITK transforms

Definition at line 73 of file mitkPyramidImageRegistrationMethod.h.

Constructor & Destructor Documentation

mitk::PyramidImageRegistrationMethod::PyramidImageRegistrationMethod ( )
protected

Definition at line 22 of file mitkPyramidImageRegistrationMethod.cpp.

mitk::PyramidImageRegistrationMethod::~PyramidImageRegistrationMethod ( )
protected

Definition at line 37 of file mitkPyramidImageRegistrationMethod.cpp.

Member Function Documentation

Pointer mitk::PyramidImageRegistrationMethod::Clone ( ) const
ParametersType mitk::PyramidImageRegistrationMethod::GetLastRegistrationParameters ( )
inline

Retrieve the parameters of the last registration computed.

Returns
Parameters array ( as an itk::Array )

Definition at line 195 of file mitkPyramidImageRegistrationMethod.h.

References mitkThrow.

mitk::PyramidImageRegistrationMethod::TransformMatrixType mitk::PyramidImageRegistrationMethod::GetLastRotationMatrix ( )

Get the rotation part of the transformation as a vnl_fixed_matrix<double, 3,3>

It returns identity if the internal parameters are not-yet allocated ( i.e. the filter did not run yet )

Returns
See also
TransformMatrixType

Definition at line 98 of file mitkPyramidImageRegistrationMethod.cpp.

References mitk::New().

unsigned int mitk::PyramidImageRegistrationMethod::GetNumberOfParameters ( )
inline

Get the number of parameters optimized ( 12 or 6 )

Returns
number of paramters

Definition at line 160 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::GetParameters ( double *  paramArray)
inline

Copies the estimated parameters to the given array.

Parameters
paramArray,targetarray for copy, make sure to allocate enough space

Definition at line 173 of file mitkPyramidImageRegistrationMethod.h.

References mitkThrow.

mitk::Image::Pointer mitk::PyramidImageRegistrationMethod::GetResampledMovingImage ( )

Returns the moving image transformed according to the estimated transformation and resampled to the geometry of the fixed/resampling reference image.

Definition at line 139 of file mitkPyramidImageRegistrationMethod.cpp.

References AccessFixedDimensionByItk_1, and mitk::Image::New().

mitk::Image::Pointer mitk::PyramidImageRegistrationMethod::GetResampledMovingImage ( mitk::Image::Pointer  movingImage,
double *  transform 
)

Returns a provided moving image transformed according to the given transformation and resampled to the geometry of the fixed/resampling reference image.

Definition at line 151 of file mitkPyramidImageRegistrationMethod.cpp.

References AccessFixedDimensionByItk_1, and mitk::Image::New().

mitk::PyramidImageRegistrationMethod::mitkClassMacroItkParent ( PyramidImageRegistrationMethod  ,
itk::Object   
)

Typedefs Smart pointer support

template<typename TPixel1 , unsigned int VImageDimension1, typename TPixel2 , unsigned int VImageDimension2>
void mitk::PyramidImageRegistrationMethod::RegisterTwoImagesV4 ( itk::Image< TPixel1, VImageDimension1 > *  itkImage1,
itk::Image< TPixel2, VImageDimension2 > *  itkImage2 
)
protected

The method takes two itk::Images and performs a multi-scale registration on them.

Can be accessed by the AccessTwoImagesFixedDimensionByItk macro.

Note
Currently the access is currently reduced only for short and float ( the only types occuring with mitk::DiffusionImage ) and hence the method is accessed by means of the
See also
AccessTwoImagesFixedDimensionTypeSubsetByItk macro.

Definition at line 194 of file mitkPyramidImageRegistrationMethod.cpp.

References mitk::CastToItkImage(), max(), min(), MITK_ERROR, MITK_INFO, mitkThrow, mitk::New(), and OptimizerIterationCommandv4< OptimizerType >::New().

template<typename TPixel , unsigned int VDimension>
void mitk::PyramidImageRegistrationMethod::ResampleMitkImage ( itk::Image< TPixel, VDimension > *  itkImage,
mitk::Image::Pointer outputImage 
)
protected

ResampleMitkImage applies the functionality of an the itk::ResampleImageFilter to the given mitk::Image.

The API of the function is conform to the interface of

See also
AccessByItk_1 macros.

Definition at line 530 of file mitkPyramidImageRegistrationMethod.cpp.

References mitk::CastToItkImage(), mitk::GrabItkImageMemory(), and mitk::New().

void mitk::PyramidImageRegistrationMethod::SetCrossModality ( bool  flag)
inline

Turn the cross-modality on/off

Definition at line 91 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetCrossModalityOff ( )
inline

Registration is between modalities - will take NormalizedCorrelation as error metric

Definition at line 85 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetCrossModalityOn ( )
inline

Registration is between modalities - will take MattesMutualInformation as error metric

Definition at line 79 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetFixedImage ( mitk::Image::Pointer  fixed)

Input image, the reference one

Definition at line 46 of file mitkPyramidImageRegistrationMethod.cpp.

void mitk::PyramidImageRegistrationMethod::SetFixedImageMask ( mitk::Image::Pointer  mask)

Fixed image mask, excludes the masked voxels from the registration metric

Definition at line 63 of file mitkPyramidImageRegistrationMethod.cpp.

void mitk::PyramidImageRegistrationMethod::SetInitializeByGeometry ( bool  flag)
inline

Use the itk::CenteredVersorTransformInitializer to perform initialization step for the registration.

The initializer takes the geometries and their features to perform an initialization for the successive registration

Definition at line 148 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetInitialParameters ( ParametersType params)
inline

Set the starting position of the registration.

Parameters
paramsmake sure the parameters have the same dimension as the selected transform type otherwise the update call will throw an exception

Definition at line 218 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetMovingImage ( mitk::Image::Pointer  moving)

Input image, the one to be transformed

Definition at line 54 of file mitkPyramidImageRegistrationMethod.cpp.

void mitk::PyramidImageRegistrationMethod::SetTransformToAffine ( )
inline

An affine ( 12dof : Rigid + scale + skew ) transform is optimized

Definition at line 130 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetTransformToRigid ( )
inline

A rigid ( 6dof : translation + rotation ) transform is optimized

Definition at line 124 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetUseAdvancedInterpolation ( bool  flag)
inline

Control the interpolator used for resampling.

The Windowed Sinc Interpolator is more time consuming, but the interpolation preserves more structure in the data

The class uses the

  • Linear interpolator on default ( flag = false )
  • WindowedSinc interpolator if called with true

Definition at line 233 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetUseFixedImageMask ( bool  flag)
inline

Set if fixed image mask is used to exclude a region.

Parameters
flag,trueif mask is to be used, false if mask is to be ignored (default)

Definition at line 256 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetUseNearestNeighborInterpolation ( bool  flag)
inline

Control the interpolator used for resampling.

The class uses the

  • Linear interpolator on default ( flag = false )
  • Nearest neighbor interpolation if this is true

used to resample e.g. segmentations.

Definition at line 247 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetVerbose ( bool  flag)
inline

Controll the verbosity of the registration output

for true, each iteration step of the optimizer is watched and passed to the std::cout

Definition at line 103 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetVerboseOff ( )
inline

Turn verbosity off,

See also
SetVerbose

Definition at line 118 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::SetVerboseOn ( )
inline

Turn verbosity on,

See also
SetVerbose

Definition at line 112 of file mitkPyramidImageRegistrationMethod.h.

void mitk::PyramidImageRegistrationMethod::Update ( )

Member Data Documentation

bool mitk::PyramidImageRegistrationMethod::m_CrossModalityRegistration
protected

Definition at line 297 of file mitkPyramidImageRegistrationMethod.h.

double* mitk::PyramidImageRegistrationMethod::m_EstimatedParameters
protected

Definition at line 307 of file mitkPyramidImageRegistrationMethod.h.

mitk::Image::Pointer mitk::PyramidImageRegistrationMethod::m_FixedImage
protected

Fixed image, used as reference for registration

Definition at line 290 of file mitkPyramidImageRegistrationMethod.h.

mitk::Image::Pointer mitk::PyramidImageRegistrationMethod::m_FixedImageMask
protected

Definition at line 295 of file mitkPyramidImageRegistrationMethod.h.

bool mitk::PyramidImageRegistrationMethod::m_InitializeByGeometry
protected

Definition at line 314 of file mitkPyramidImageRegistrationMethod.h.

ParametersType mitk::PyramidImageRegistrationMethod::m_InitialParameters
protected

Definition at line 309 of file mitkPyramidImageRegistrationMethod.h.

mitk::Image::Pointer mitk::PyramidImageRegistrationMethod::m_MovingImage
protected

Moving image, will be transformed

Definition at line 293 of file mitkPyramidImageRegistrationMethod.h.

bool mitk::PyramidImageRegistrationMethod::m_UseAffineTransform
protected

Definition at line 299 of file mitkPyramidImageRegistrationMethod.h.

bool mitk::PyramidImageRegistrationMethod::m_UseMask
protected

Definition at line 305 of file mitkPyramidImageRegistrationMethod.h.

bool mitk::PyramidImageRegistrationMethod::m_UseNearestNeighborInterpolator
protected

Definition at line 303 of file mitkPyramidImageRegistrationMethod.h.

bool mitk::PyramidImageRegistrationMethod::m_UseWindowedSincInterpolator
protected

Definition at line 301 of file mitkPyramidImageRegistrationMethod.h.

bool mitk::PyramidImageRegistrationMethod::m_Verbose
protected

Control the verbosity of the regsitistration output

Definition at line 312 of file mitkPyramidImageRegistrationMethod.h.


The documentation for this class was generated from the following files: