ITK  5.4.0
Insight Toolkit
itkMultiResolutionPDEDeformableRegistration.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkMultiResolutionPDEDeformableRegistration_h
19 #define itkMultiResolutionPDEDeformableRegistration_h
20 
21 #include "itkImage.h"
24 #include "itkResampleImageFilter.h"
25 #include "itkArray.h"
26 
27 namespace itk
28 {
80 template <
81  typename TFixedImage,
82  typename TMovingImage,
83  typename TDisplacementField,
84  typename TRealType = float,
85  typename TFloatImageType = Image<TRealType, TFixedImage::ImageDimension>,
86  typename TRegistrationType = PDEDeformableRegistrationFilter<TFloatImageType, TFloatImageType, TDisplacementField>,
87  typename TDefaultRegistrationType = DemonsRegistrationFilter<TFloatImageType, TFloatImageType, TDisplacementField>>
89  : public ImageToImageFilter<TDisplacementField, TDisplacementField>
90 {
91 public:
92  ITK_DISALLOW_COPY_AND_MOVE(MultiResolutionPDEDeformableRegistration);
93 
99 
101  itkNewMacro(Self);
102 
104  itkOverrideGetNameOfClassMacro(MultiResolutionPDEDeformableRegistration);
105 
107  using FixedImageType = TFixedImage;
110 
112  using MovingImageType = TMovingImage;
115 
117  using DisplacementFieldType = TDisplacementField;
119 
121  static constexpr unsigned int ImageDimension = FixedImageType::ImageDimension;
122 
124  using FloatImageType = TFloatImageType;
125 
127  using RegistrationType = TRegistrationType;
129 
131  using DefaultRegistrationType = TDefaultRegistrationType;
132 
136 
140 
144 
146 
148  virtual void
149  SetFixedImage(const FixedImageType * ptr);
150 
152  const FixedImageType *
153  GetFixedImage() const;
154 
156  virtual void
157  SetMovingImage(const MovingImageType * ptr);
158 
160  const MovingImageType *
161  GetMovingImage() const;
162 
165  virtual void
167  {
168  this->m_InitialDisplacementField = ptr;
169  }
170 
174  virtual void
176  {
177  this->SetInput(ptr);
178  }
179 
181  const DisplacementFieldType *
183  {
184  return this->GetOutput();
185  }
186 
193  std::vector<SmartPointer<DataObject>>::size_type
194  GetNumberOfValidRequiredInputs() const override;
195 
197  itkSetObjectMacro(RegistrationFilter, RegistrationType);
198  itkGetModifiableObjectMacro(RegistrationFilter, RegistrationType);
202  itkSetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
203  itkGetModifiableObjectMacro(FixedImagePyramid, FixedImagePyramidType);
207  itkSetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
208  itkGetModifiableObjectMacro(MovingImagePyramid, MovingImagePyramidType);
212  virtual void
213  SetNumberOfLevels(unsigned int num);
214 
216  itkGetConstReferenceMacro(NumberOfLevels, unsigned int);
217 
219  itkGetConstReferenceMacro(CurrentLevel, unsigned int);
220 
222  itkSetObjectMacro(FieldExpander, FieldExpanderType);
223  itkGetModifiableObjectMacro(FieldExpander, FieldExpanderType);
227  itkSetMacro(NumberOfIterations, NumberOfIterationsType);
228  itkSetVectorMacro(NumberOfIterations, unsigned int, m_NumberOfLevels);
232  itkGetConstReferenceMacro(NumberOfIterations, NumberOfIterationsType);
233 
235  virtual void
236  StopRegistration();
237 
238 protected:
240  ~MultiResolutionPDEDeformableRegistration() override = default;
241 
242  void
243  PrintSelf(std::ostream & os, Indent indent) const override;
244 
256  void
257  GenerateData() override;
258 
262  void
263  GenerateInputRequestedRegion() override;
264 
271  void
272  GenerateOutputInformation() override;
273 
277  void
278  EnlargeOutputRequestedRegion(DataObject * ptr) override;
279 
282  virtual bool
283  Halt();
284 
290  void
291  VerifyInputInformation() ITKv5_CONST override
292  {}
293 
294 private:
295  RegistrationPointer m_RegistrationFilter{};
296  FixedImagePyramidPointer m_FixedImagePyramid{};
297  MovingImagePyramidPointer m_MovingImagePyramid{};
298  FieldExpanderPointer m_FieldExpander{};
299  DisplacementFieldPointer m_InitialDisplacementField{};
300 
301  unsigned int m_NumberOfLevels{};
302  unsigned int m_CurrentLevel{};
303  NumberOfIterationsType m_NumberOfIterations{};
304 
306  bool m_StopRegistrationFlag{};
307 };
308 } // end namespace itk
309 
310 #ifndef ITK_MANUAL_INSTANTIATION
311 # include "itkMultiResolutionPDEDeformableRegistration.hxx"
312 #endif
313 
314 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::MultiResolutionPDEDeformableRegistration::GetDisplacementField
const DisplacementFieldType * GetDisplacementField()
Definition: itkMultiResolutionPDEDeformableRegistration.h:182
itk::MultiResolutionPDEDeformableRegistration::FixedImagePointer
typename FixedImageType::Pointer FixedImagePointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:108
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkMultiResolutionPyramidImageFilter.h
itk::MultiResolutionPDEDeformableRegistration::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkMultiResolutionPDEDeformableRegistration.h:117
itk::MultiResolutionPDEDeformableRegistration::VerifyInputInformation
void VerifyInputInformation() ITKv5_CONST override
Definition: itkMultiResolutionPDEDeformableRegistration.h:291
itk::MultiResolutionPDEDeformableRegistration::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:109
itkDemonsRegistrationFilter.h
itk::MultiResolutionPDEDeformableRegistration::MovingImageType
TMovingImage MovingImageType
Definition: itkMultiResolutionPDEDeformableRegistration.h:112
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MultiResolutionPDEDeformableRegistration::MovingImageConstPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:114
itk::MultiResolutionPDEDeformableRegistration::FieldExpanderPointer
typename FieldExpanderType::Pointer FieldExpanderPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:143
itk::MultiResolutionPDEDeformableRegistration::FixedImagePyramidPointer
typename FixedImagePyramidType::Pointer FixedImagePyramidPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:135
itk::MultiResolutionPDEDeformableRegistration::SetArbitraryInitialDisplacementField
virtual void SetArbitraryInitialDisplacementField(DisplacementFieldType *ptr)
Definition: itkMultiResolutionPDEDeformableRegistration.h:175
itk::MultiResolutionPDEDeformableRegistration::FixedImageType
TFixedImage FixedImageType
Definition: itkMultiResolutionPDEDeformableRegistration.h:107
itk::MultiResolutionPDEDeformableRegistration::RegistrationPointer
typename RegistrationType::Pointer RegistrationPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:128
itk::MultiResolutionPDEDeformableRegistration::RegistrationType
TRegistrationType RegistrationType
Definition: itkMultiResolutionPDEDeformableRegistration.h:127
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::MultiResolutionPDEDeformableRegistration::MovingImagePointer
typename MovingImageType::Pointer MovingImagePointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:113
itk::MultiResolutionPDEDeformableRegistration::FloatImageType
TFloatImageType FloatImageType
Definition: itkMultiResolutionPDEDeformableRegistration.h:124
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::MultiResolutionPDEDeformableRegistration::MovingImagePyramidPointer
typename MovingImagePyramidType::Pointer MovingImagePyramidPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:139
itkArray.h
itk::MultiResolutionPyramidImageFilter
Framework for creating images in a multi-resolution pyramid.
Definition: itkMultiResolutionPyramidImageFilter.h:109
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::MultiResolutionPDEDeformableRegistration
Framework for performing multi-resolution PDE deformable registration.
Definition: itkMultiResolutionPDEDeformableRegistration.h:88
itk::Array< unsigned int >
itk::ResampleImageFilter
Resample an image via a coordinate transform.
Definition: itkResampleImageFilter.h:90
itk::MultiResolutionPDEDeformableRegistration::SetInitialDisplacementField
virtual void SetInitialDisplacementField(DisplacementFieldType *ptr)
Definition: itkMultiResolutionPDEDeformableRegistration.h:166
itk::MultiResolutionPDEDeformableRegistration::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:118
itkResampleImageFilter.h
itk::MultiResolutionPDEDeformableRegistration::DefaultRegistrationType
TDefaultRegistrationType DefaultRegistrationType
Definition: itkMultiResolutionPDEDeformableRegistration.h:131
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293