#include <itkPhaseCorrelationImageRegistrationMethod.h>
Phase Correlation Method (PCM) estimates shift between the Fixed image and Moving image. See C. D. Kuglin and D. C. Hines, “The phase correlation image alignment method,” in Proc. Int. Conf. on Cybernetics and Society, pp. 163–165, IEEE, Sep. 1975 for method description.
The method consists of 4 (5) steps: 0. Resample the images to same spacing and size. 1. Compute FFT of the two images. 2. Compute the ratio of the two spectrums. 3. Compute the inverse FFT of the cross-power spectrum. 4. Find the maximum peak in cross-power spectrum and estimate the shift.
Step 0. is not included in the method itself - it is a prerequisite of PCM. It is performed by padding the smaller image by zeros to obtain two images that has the same real size (in all dimensions). Then it is necessary to resample images to same spacing. Resampling is made by cropping high frequencies in step 2.
Step 1. is performed by this class too using FFT filters supplied by itk::FFTRealToComplexConjugateImageFilter::New() factory.
Step 2. is performed by generic PhaseCorrelationOperator supplied during run time. It has to crop the high frequencies to subsample the two images to the same resolution and compute the spectrum ratio. PhaseCorrelationOperator can be derived to implement some special filtering during this phase.
As some special techniques (e.g. to compute subpixel shifts) require complex correlation surface, while the others compute the shift from real correlation surface, step 3. is carried by this class only when necessary. The IFFT filter is created using itk::FFTComplexConjugateToRealImageFilter::New() factory.
Step 4. is performed by run time supplied PhaseCorrelationOptimizer. It has to determine the shift from the real or complex correlation surface.
First, plug in the operator, optimizer and the input images. The method is executed by calling Update() (or updating some downstream filter).
The output shift can be passed downstreams in the form of TranslationTransform or can be obtained as transform parameters vector. The transform can be directly used to resample the Moving image to match the Fixed image.
Public Types | |
typedef PhaseCorrelationImageRegistrationMethod | Self |
Standard class typedefs. | |
typedef TFixedImage | FixedImageType |
Type of the Fixed image. | |
typedef TMovingImage | MovingImageType |
Type of the Moving image. | |
typedef itk::NumericTraits< FixedImagePixelType >::RealType | InternalPixelType |
Pixel type, that will be used by internal filters. | |
typedef itk::Image< InternalPixelType, itkGetStaticConstMacro(ImageDimension) > | RealImageType |
Type of the image, that is passed between the internal components. | |
typedef itk::Image< std::complex< InternalPixelType >, itkGetStaticConstMacro(ImageDimension) > | ComplexConjugateImageType |
Type of the image, that is passed between the internal components. | |
typedef pcm::PhaseCorrelationOperator< FixedImageType, MovingImageType > | OperatorType |
Type of the Operator. | |
typedef pcm::PhaseCorrelationOptimizer< RealImageType > | RealOptimizerType |
Type of the Optimizer. | |
typedef itk::TranslationTransform< typename MovingImageType::PointType::ValueType, itkGetStaticConstMacro(ImageDimension) > | TransformType |
Type for the transform. | |
typedef TransformType::ParametersType | ParametersType |
Type for the output transform parameters (the shift). | |
typedef itk::DataObjectDecorator< TransformType > | TransformOutputType |
Type for the output: Using Decorator pattern for enabling the Transform to be passed in the data pipeline. | |
typedef itk::DataObject::Pointer | DataObjectPointer |
Smart Pointer type to a DataObject. | |
Public Member Functions | |
itkNewMacro (Self) | |
Method for creation through the object factory. | |
itkTypeMacro (PhaseCorrelationImageRegistrationMethod, itk::ProcessObject) | |
Run-time type information (and related methods). | |
itkStaticConstMacro (ImageDimension, unsigned int, pcm::Dimension) | |
Dimensionality of input and output data is assumed to be the same. | |
void | SetFixedImage (const FixedImageType *fixedImage) |
Set/Get the Fixed image. | |
void | SetMovingImage (const MovingImageType *movingImage) |
Set/Get the Moving image. | |
void | SetReleaseDataFlag (bool flag) |
Passes ReleaseDataFlag to internal filters. | |
void | SetReleaseDataBeforeUpdateFlag (const bool flag) |
Passes ReleaseDataBeforeUpdateFlag to internal filters. | |
itkSetObjectMacro (Operator, OperatorType) | |
Set/Get the Operator. | |
virtual void | SetOptimizer (RealOptimizerType *) |
Set/Get the Optimizer. | |
itkSetObjectMacro (Transform, TransformType) | |
Set/Get the Transfrom. | |
itkGetConstReferenceMacro (LastTransformParameters, ParametersType) | |
Get the last transformation parameters visited by the optimizer. | |
virtual RealImageType * | GetRealCorrelationSurface () |
Get the correlation surface. | |
const TransformOutputType * | GetOutput () const |
Returns the transform resulting from the registration process. | |
virtual DataObjectPointer | MakeOutput (unsigned int idx) |
Make a DataObject of the correct type to be used as the specified output. | |
unsigned long | GetMTime () const |
Method to return the latest modified time of this object or any of its cached ivars. | |
Protected Types | |
typedef itk::ConstantPadImageFilter< FixedImageType, RealImageType > | FixedPadderType |
Types for internal componets. | |
Protected Member Functions | |
virtual void | Initialize () throw (itk::ExceptionObject) |
Initialize by setting the interconnects between the components. | |
void | StartOptimization (void) throw (itk::ExceptionObject) |
Method that initiates the optimization process. | |
void | GenerateData () throw (itk::ExceptionObject) |
Method invoked by the pipeline in order to trigger the computation of the registration. | |
itkSetMacro (LastTransformParameters, ParametersType) | |
Provides derived classes with the ability to set this private var. |
typedef PhaseCorrelationImageRegistrationMethod pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::Self |
Standard class typedefs.
typedef TFixedImage pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::FixedImageType |
Type of the Fixed image.
typedef TMovingImage pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::MovingImageType |
Type of the Moving image.
typedef itk::NumericTraits<FixedImagePixelType>::RealType pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::InternalPixelType |
Pixel type, that will be used by internal filters.
It should be float for integral and float inputs and it should be double for double inputs
typedef itk::Image< InternalPixelType, itkGetStaticConstMacro(ImageDimension) > pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::RealImageType |
Type of the image, that is passed between the internal components.
typedef itk::Image< std::complex< InternalPixelType >, itkGetStaticConstMacro(ImageDimension) > pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::ComplexConjugateImageType |
Type of the image, that is passed between the internal components.
typedef itk::TranslationTransform< typename MovingImageType::PointType::ValueType, itkGetStaticConstMacro(ImageDimension) > pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::TransformType |
Type for the transform.
typedef TransformType::ParametersType pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::ParametersType |
Type for the output transform parameters (the shift).
typedef itk::DataObject::Pointer pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::DataObjectPointer |
Smart Pointer type to a DataObject.
typedef itk::ConstantPadImageFilter< FixedImageType, RealImageType > pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::FixedPadderType [protected] |
Types for internal componets.
pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::itkNewMacro | ( | Self | ) |
Method for creation through the object factory.
pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::itkTypeMacro | ( | PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage > | , | |
itk::ProcessObject | ||||
) |
Run-time type information (and related methods).
pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::itkStaticConstMacro | ( | ImageDimension | , | |
unsigned | int, | |||
pcm::Dimension | ||||
) |
Dimensionality of input and output data is assumed to be the same.
void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::SetFixedImage | ( | const FixedImageType * | fixedImage | ) |
Set/Get the Fixed image.
void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::SetMovingImage | ( | const MovingImageType * | movingImage | ) |
Set/Get the Moving image.
void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::SetReleaseDataFlag | ( | bool | flag | ) |
Passes ReleaseDataFlag to internal filters.
void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::SetReleaseDataBeforeUpdateFlag | ( | const bool | flag | ) |
Passes ReleaseDataBeforeUpdateFlag to internal filters.
pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::itkSetObjectMacro | ( | Operator | , | |
OperatorType | ||||
) |
Set/Get the Operator.
virtual void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::SetOptimizer | ( | RealOptimizerType * | ) | [virtual] |
Set/Get the Optimizer.
pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::itkSetObjectMacro | ( | Transform | , | |
TransformType | ||||
) |
Set/Get the Transfrom.
pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::itkGetConstReferenceMacro | ( | LastTransformParameters | , | |
ParametersType | ||||
) |
Get the last transformation parameters visited by the optimizer.
virtual RealImageType* pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::GetRealCorrelationSurface | ( | ) | [inline, virtual] |
Get the correlation surface.
Use method appropriate to the type (real/complex) of optimizer. If the complex optimizer is used, the real correlation surface is not available or is not up-to-date.
virtual DataObjectPointer pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::MakeOutput | ( | unsigned int | idx | ) | [virtual] |
Make a DataObject of the correct type to be used as the specified output.
virtual void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::Initialize | ( | ) | throw (itk::ExceptionObject) [protected, virtual] |
Initialize by setting the interconnects between the components.
void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::StartOptimization | ( | void | ) | throw (itk::ExceptionObject) [protected] |
Method that initiates the optimization process.
void pcm::PhaseCorrelationImageRegistrationMethod< TFixedImage, TMovingImage >::GenerateData | ( | ) | throw (itk::ExceptionObject) [protected] |
Method invoked by the pipeline in order to trigger the computation of the registration.