00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkMultiResolutionPDEDeformableRegistration_h
00018
#define __itkMultiResolutionPDEDeformableRegistration_h
00019
00020
#include "itkImage.h"
00021
#include "itkImageToImageFilter.h"
00022
#include "itkPDEDeformableRegistrationFilter.h"
00023
#include "itkDemonsRegistrationFilter.h"
00024
#include "itkMultiResolutionPyramidImageFilter.h"
00025
#include "itkVectorResampleImageFilter.h"
00026
00027
#include <vector>
00028
00029
namespace itk
00030 {
00075
template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
00076 class ITK_EXPORT MultiResolutionPDEDeformableRegistration :
00077
public ImageToImageFilter <TDeformationField, TDeformationField>
00078 {
00079
public:
00081
typedef MultiResolutionPDEDeformableRegistration
Self;
00082 typedef ImageToImageFilter<TDeformationField, TDeformationField>
00083
Superclass;
00084 typedef SmartPointer<Self> Pointer;
00085 typedef SmartPointer<const Self> ConstPointer;
00086
00088
itkNewMacro(
Self);
00089
00091
itkTypeMacro( MultiResolutionPDEDeformableRegistration,
00092
ImageToImageFilter );
00093
00095
typedef TFixedImage
FixedImageType;
00096 typedef typename FixedImageType::Pointer
FixedImagePointer;
00097 typedef typename FixedImageType::ConstPointer
FixedImageConstPointer;
00098
00100
typedef TMovingImage
MovingImageType;
00101 typedef typename MovingImageType::Pointer
MovingImagePointer;
00102 typedef typename MovingImageType::ConstPointer
MovingImageConstPointer;
00103
00105
typedef TDeformationField
DeformationFieldType;
00106 typedef typename DeformationFieldType::Pointer
DeformationFieldPointer;
00107
00109
itkStaticConstMacro(ImageDimension,
unsigned int,
00110 FixedImageType::ImageDimension);
00111
00113
typedef Image<float,itkGetStaticConstMacro(ImageDimension)> FloatImageType;
00114
00116
typedef PDEDeformableRegistrationFilter<
00117
FloatImageType,
FloatImageType,
DeformationFieldType >
RegistrationType;
00118 typedef typename RegistrationType::Pointer
RegistrationPointer;
00119
00121
typedef DemonsRegistrationFilter<
00122
FloatImageType,
FloatImageType,
DeformationFieldType >
DefaultRegistrationType;
00123
00125
typedef MultiResolutionPyramidImageFilter<
00126
FixedImageType,
FloatImageType >
FixedImagePyramidType;
00127 typedef typename FixedImagePyramidType::Pointer
FixedImagePyramidPointer;
00128
00130
typedef MultiResolutionPyramidImageFilter<
00131
MovingImageType,
FloatImageType >
MovingImagePyramidType;
00132 typedef typename MovingImagePyramidType::Pointer
MovingImagePyramidPointer;
00133
00135
typedef VectorResampleImageFilter<
00136
DeformationFieldType,
DeformationFieldType >
FieldExpanderType;
00137 typedef typename FieldExpanderType::Pointer
FieldExpanderPointer;
00138
00140
virtual void SetFixedImage(
const FixedImageType * ptr );
00141
00143
const FixedImageType * GetFixedImage(
void);
00144
00146
virtual void SetMovingImage(
const MovingImageType * ptr );
00147
00149
const MovingImageType * GetMovingImage(
void);
00150
00152
virtual void SetInitialDeformationField(
DeformationFieldType *
itkNotUsed(ptr) )
00153 {
00154
itkExceptionMacro( <<
"This feature not implemented yet" );
00155
00156 }
00157
00159
const DeformationFieldType * GetDeformationField(
void)
00160 {
return this->GetOutput(); }
00161
00163
itkSetObjectMacro( RegistrationFilter,
RegistrationType );
00164
00166
itkGetObjectMacro( RegistrationFilter,
RegistrationType );
00167
00169
itkSetObjectMacro( FixedImagePyramid,
FixedImagePyramidType );
00170
00172
itkGetObjectMacro( FixedImagePyramid,
FixedImagePyramidType );
00173
00175
itkSetObjectMacro( MovingImagePyramid,
MovingImagePyramidType );
00176
00178
itkGetObjectMacro( MovingImagePyramid,
MovingImagePyramidType );
00179
00181
virtual void SetNumberOfLevels(
unsigned int num );
00182
00184
itkGetMacro( NumberOfLevels,
unsigned int );
00185
00187
itkGetMacro( CurrentLevel,
unsigned int );
00188
00190
itkSetVectorMacro( NumberOfIterations,
unsigned int, m_NumberOfLevels );
00191
00193
virtual const unsigned int * GetNumberOfIterations()
const
00194
{
return &(m_NumberOfIterations[0]); }
00195
00196
protected:
00197 MultiResolutionPDEDeformableRegistration();
00198 ~MultiResolutionPDEDeformableRegistration() {}
00199
void PrintSelf(std::ostream& os,
Indent indent)
const;
00200
00203
virtual void GenerateData();
00204
00208
virtual void GenerateInputRequestedRegion();
00209
00216
virtual void GenerateOutputInformation();
00217
00221
virtual void EnlargeOutputRequestedRegion(
DataObject *ptr );
00222
00223
private:
00224 MultiResolutionPDEDeformableRegistration(
const Self&);
00225
void operator=(
const Self&);
00226
00227
RegistrationPointer m_RegistrationFilter;
00228
FixedImagePyramidPointer m_FixedImagePyramid;
00229
MovingImagePyramidPointer m_MovingImagePyramid;
00230
FieldExpanderPointer m_FieldExpander;
00231
00232
unsigned int m_NumberOfLevels;
00233
unsigned int m_CurrentLevel;
00234 std::vector<unsigned int> m_NumberOfIterations;
00235
00236 };
00237
00238
00239 }
00240
00241
#ifndef ITK_MANUAL_INSTANTIATION
00242
#include "itkMultiResolutionPDEDeformableRegistration.txx"
00243
#endif
00244
00245
00246
#endif