NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkImageRegistrationFilter.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkImageRegistrationFilter_h
16 #define itkImageRegistrationFilter_h
17 
18 
19 #include <itkImageToImageFilter.h>
20 
21 #include <itkCastImageFilter.h>
22 #include <itkResampleImageFilter.h>
26 #include <itkAbsImageFilter.h>
27 
28 namespace itk
29 {
58 template <typename TInputImageType, typename TOutputImageType, unsigned int Dimension, class TScalarType, typename TDeformationScalar, typename TPyramidFilter = RecursiveMultiResolutionPyramidImageFilter< TInputImageType, TInputImageType > >
59 class ITK_EXPORT ImageRegistrationFilter : public ImageToImageFilter< TInputImageType, TOutputImageType >
60 {
61  public:
62 
65  typedef ImageToImageFilter< TInputImageType, TOutputImageType > Superclass;
66  typedef SmartPointer<Self> Pointer;
67  typedef SmartPointer<const Self> ConstPointer;
68 
70  itkNewMacro(Self);
71 
73  itkTypeMacro(ImageRegistrationFilter, ImageToImageFilter);
74 
77  typedef typename TInputImageType::Pointer InputImagePointer;
78  typedef typename TInputImageType::ConstPointer InputImageConstPointer;
79 
87  typedef itk::ImageRegistrationFactory<TInputImageType, Dimension,
90 
97  typedef itk::InterpolateImageFunction< TInputImageType, TScalarType > InterpolatorType;
98  typedef typename InterpolatorType::Pointer InterpolatorPointer;
99  typedef itk::ResampleImageFilter<TInputImageType, TInputImageType > ResampleFilterType;
100  typedef typename ResampleFilterType::Pointer ResampleFilterPointer;
101  typedef itk::AbsImageFilter<TInputImageType, TInputImageType > AbsImageFilterType;
102  typedef itk::CastImageFilter<TInputImageType, TOutputImageType > CastToOutputFilterType;
103  typedef typename CastToOutputFilterType::Pointer CastToOutputFilterPointer;
104 
106 
108  itkSetObjectMacro( MultiResolutionRegistrationMethod, MultiResolutionRegistrationType );
109  itkGetObjectMacro( MultiResolutionRegistrationMethod, MultiResolutionRegistrationType );
110 
112  itkSetObjectMacro( Interpolator, InterpolatorType );
113  itkGetObjectMacro( Interpolator, InterpolatorType );
114 
116  void SetFixedImage(InputImagePointer fixedImage) { this->SetInput(0, fixedImage); }
117 
119  void SetMovingImage(InputImagePointer movingImage) { this->m_MovingImage = movingImage; }
120 
122  void SetFixedMask(InputImagePointer fixedMask) {this->SetInput(1, fixedMask); }
123 
125  void SetMovingMask(InputImagePointer movingMask) { this->m_MovingMask = movingMask; }
126 
128  itkSetMacro(DoReslicing, bool);
129  itkGetMacro(DoReslicing, bool);
130 
132  itkSetMacro(IsOutputAbsIntensity, bool);
133  itkGetMacro(IsOutputAbsIntensity, bool);
134 
136  itkSetMacro(IsotropicVoxelSize, double);
137  itkGetMacro(IsotropicVoxelSize, double);
138 
140  itkSetMacro(ResampleImageInterpolation, InterpolationTypeEnum);
141  itkGetMacro(ResampleImageInterpolation, InterpolationTypeEnum);
142 
144  itkSetMacro(ResampleMaskInterpolation, InterpolationTypeEnum);
145  itkGetMacro(ResampleMaskInterpolation, InterpolationTypeEnum);
146 
148  itkSetMacro(ResampledMovingImagePadValue, InputPixelType);
149  itkGetMacro(ResampledMovingImagePadValue, InputPixelType);
150 
152  itkSetMacro(ResampledFixedImagePadValue, InputPixelType);
153  itkGetMacro(ResampledFixedImagePadValue, InputPixelType);
154 
156  InputImagePointer ResampleToVoxelSize(const TInputImageType* image, const InputPixelType defaultPixelValue, InterpolationTypeEnum interpolation, typename TInputImageType::SpacingType voxelSize);
157 
158  protected:
159 
162  void PrintSelf(std::ostream& os, Indent indent) const;
163 
165  void GenerateData();
166 
170  virtual void Initialize();
171 
173  ImageRegistrationFactoryPointer m_ImageRegistrationFactory;
174 
176  CastToOutputFilterPointer m_FinalCaster;
177 
179  ResampleFilterPointer m_FinalResampler;
180 
182  InterpolatorPointer m_Interpolator;
183 
185  MultiResolutionRegistrationPointer m_MultiResolutionRegistrationMethod;
186 
188  typename AbsImageFilterType::Pointer m_AbsImageFilter;
189 
191  typename TInputImageType::ConstPointer m_ResampledFixedImage;
192 
194  typename TInputImageType::ConstPointer m_ResampledMovingImage;
195 
197  typename TInputImageType::ConstPointer m_ResampledFixedMask;
198 
200  typename TInputImageType::ConstPointer m_ResampledMovingMask;
201 
204 
207 
208  private:
209 
210  ImageRegistrationFilter(const Self&); // purposefully not implemented
211  void operator=(const Self&); // purposefully not implemented
212 
214  InputImagePointer m_MovingImage;
215 
217  InputImagePointer m_MovingMask;
218 
220  InputPixelType m_ResampledMovingImagePadValue;
221 
223  InputPixelType m_ResampledFixedImagePadValue;
224 
226  bool m_DoReslicing;
227 
229  bool m_IsOutputAbsIntensity;
230 
232  double m_IsotropicVoxelSize;
233 
234 };
235 
236 } // end namespace itk
237 
238 
239 #ifndef ITK_MANUAL_INSTANTIATION
240 #include "itkImageRegistrationFilter.txx"
241 #endif
242 
243 #endif
InterpolationTypeEnum
Definition: itkImageRegistrationFactory.h:79
InterpolationTypeEnum m_ResampleMaskInterpolation
Definition: itkImageRegistrationFilter.h:206
MultiResolutionRegistrationType::SingleResType SingleResType
Definition: itkImageRegistrationFilter.h:85
SmartPointer< Self > Pointer
Definition: itkImageRegistrationFactory.h:167
Base class for NifTK Image Registration Methods employing a binary mask.
Definition: itkMaskedImageRegistrationMethod.h:55
MultiResolutionRegistrationPointer m_MultiResolutionRegistrationMethod
Definition: itkImageRegistrationFilter.h:185
Used to plug registration methods into a filter based pipeline.
Definition: itkImageRegistrationFilter.h:59
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
itk::MultiResolutionImageRegistrationWrapper< TInputImageType, TPyramidFilter > MultiResolutionRegistrationType
Definition: itkImageRegistrationFilter.h:83
TInputImageType::PixelType InputPixelType
Definition: itkImageRegistrationFilter.h:73
Definition: niftkITKAffineResampleImage.cxx:74
SmartPointer< Self > Pointer
Definition: itkImageRegistrationFilter.h:66
CastToOutputFilterType::Pointer CastToOutputFilterPointer
Definition: itkImageRegistrationFilter.h:103
TInputImageType::Pointer InputImagePointer
Definition: itkImageRegistrationFilter.h:77
InterpolatorPointer m_Interpolator
Definition: itkImageRegistrationFilter.h:182
ImageToImageFilter< TInputImageType, TOutputImageType > Superclass
Definition: itkImageRegistrationFilter.h:65
InterpolationTypeEnum m_ResampleImageInterpolation
Definition: itkImageRegistrationFilter.h:203
TInputImageType::ConstPointer m_ResampledFixedMask
Definition: itkImageRegistrationFilter.h:197
TInputImageType::ConstPointer InputImageConstPointer
Definition: itkImageRegistrationFilter.h:78
ResampleFilterType::Pointer ResampleFilterPointer
Definition: itkImageRegistrationFilter.h:100
void SetMovingMask(InputImagePointer movingMask)
Definition: itkImageRegistrationFilter.h:125
itk::CastImageFilter< TInputImageType, TOutputImageType > CastToOutputFilterType
Definition: itkImageRegistrationFilter.h:102
itk::FluidDeformableTransform< TInputImageType, TScalarType, Dimension, TDeformationScalar > FluidDeformableTransformType
Definition: itkImageRegistrationFilter.h:105
SmartPointer< const Self > ConstPointer
Definition: itkImageRegistrationFilter.h:67
InterpolatorType::Pointer InterpolatorPointer
Definition: itkImageRegistrationFilter.h:98
void SetMovingImage(InputImagePointer movingImage)
Definition: itkImageRegistrationFilter.h:119
CastToOutputFilterPointer m_FinalCaster
Definition: itkImageRegistrationFilter.h:176
ImageRegistrationFactoryPointer m_ImageRegistrationFactory
Definition: itkImageRegistrationFilter.h:173
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
Superclass::TransformType TransformType
Definition: itkMaskedImageRegistrationMethod.h:129
itk::ImageRegistrationFactory< TInputImageType, Dimension, TScalarType > ImageRegistrationFactoryType
Definition: itkImageRegistrationFilter.h:88
itk::ResampleImageFilter< TInputImageType, TInputImageType > ResampleFilterType
Definition: itkImageRegistrationFilter.h:99
itk::AbsImageFilter< TInputImageType, TInputImageType > AbsImageFilterType
Definition: itkImageRegistrationFilter.h:101
TInputImageType::ConstPointer m_ResampledMovingImage
Definition: itkImageRegistrationFilter.h:194
TInputImageType::ConstPointer m_ResampledFixedImage
Definition: itkImageRegistrationFilter.h:191
ImageRegistrationFilter Self
Definition: itkImageRegistrationFilter.h:64
itk::InterpolateImageFunction< TInputImageType, TScalarType > InterpolatorType
Definition: itkImageRegistrationFilter.h:97
virtual ~ImageRegistrationFilter()
Definition: itkImageRegistrationFilter.h:161
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
void SetFixedMask(InputImagePointer fixedMask)
Definition: itkImageRegistrationFilter.h:122
SingleResType::TransformType TransformType
Definition: itkImageRegistrationFilter.h:86
MultiResolutionRegistrationType::Pointer MultiResolutionRegistrationPointer
Definition: itkImageRegistrationFilter.h:84
Deformable transform using a fluid representation.
Definition: itkFluidDeformableTransform.h:35
TInputImageType::ConstPointer m_ResampledMovingMask
Definition: itkImageRegistrationFilter.h:200
ResampleFilterPointer m_FinalResampler
Definition: itkImageRegistrationFilter.h:179
SmartPointer< Self > Pointer
Definition: itkMultiResolutionImageRegistrationWrapper.h:47
ImageRegistrationFactoryType::Pointer ImageRegistrationFactoryPointer
Definition: itkImageRegistrationFilter.h:89
Parameterised Factory Pattern [2] for creating registration objects.
Definition: itkImageRegistrationFactory.h:160
void SetFixedImage(InputImagePointer fixedImage)
Definition: itkImageRegistrationFilter.h:116
AbsImageFilterType::Pointer m_AbsImageFilter
Definition: itkImageRegistrationFilter.h:188
UCL Base class for multi-resolution image registration methods.
Definition: itkMultiResolutionImageRegistrationWrapper.h:41