ITK  5.2.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  * http://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 
105 
107  using FixedImageType = TFixedImage;
108  using FixedImagePointer = typename FixedImageType::Pointer;
109  using FixedImageConstPointer = typename FixedImageType::ConstPointer;
110 
112  using MovingImageType = TMovingImage;
113  using MovingImagePointer = typename MovingImageType::Pointer;
114  using MovingImageConstPointer = typename MovingImageType::ConstPointer;
115 
117  using DisplacementFieldType = TDisplacementField;
118  using DisplacementFieldPointer = typename DisplacementFieldType::Pointer;
119 
121  static constexpr unsigned int ImageDimension = FixedImageType::ImageDimension;
122 
124  using FloatImageType = TFloatImageType;
125 
127  using RegistrationType = TRegistrationType;
128  using RegistrationPointer = typename RegistrationType::Pointer;
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);
200 
202  itkSetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
203  itkGetModifiableObjectMacro(FixedImagePyramid, FixedImagePyramidType);
205 
207  itkSetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
208  itkGetModifiableObjectMacro(MovingImagePyramid, MovingImagePyramidType);
210 
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);
225 
227  itkSetMacro(NumberOfIterations, NumberOfIterationsType);
228  itkSetVectorMacro(NumberOfIterations, unsigned int, m_NumberOfLevels);
230 
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 
247  void
248  GenerateData() override;
249 
253  void
254  GenerateInputRequestedRegion() override;
255 
262  void
263  GenerateOutputInformation() override;
264 
268  void
269  EnlargeOutputRequestedRegion(DataObject * ptr) override;
270 
273  virtual bool
274  Halt();
275 
281  void
282  VerifyInputInformation() ITKv5_CONST override
283  {}
284 
285 private:
291 
292  unsigned int m_NumberOfLevels;
293  unsigned int m_CurrentLevel;
295 
298 };
299 } // end namespace itk
300 
301 #ifndef ITK_MANUAL_INSTANTIATION
302 # include "itkMultiResolutionPDEDeformableRegistration.hxx"
303 #endif
304 
305 #endif
itk::MultiResolutionPDEDeformableRegistration::GetDisplacementField
const DisplacementFieldType * GetDisplacementField()
Definition: itkMultiResolutionPDEDeformableRegistration.h:182
itk::MultiResolutionPDEDeformableRegistration::FixedImagePointer
typename FixedImageType::Pointer FixedImagePointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:108
itkMultiResolutionPyramidImageFilter.h
itk::MultiResolutionPDEDeformableRegistration::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkMultiResolutionPDEDeformableRegistration.h:117
itk::MultiResolutionPDEDeformableRegistration::m_NumberOfLevels
unsigned int m_NumberOfLevels
Definition: itkMultiResolutionPDEDeformableRegistration.h:292
itk::MultiResolutionPDEDeformableRegistration::VerifyInputInformation
void VerifyInputInformation() ITKv5_CONST override
Definition: itkMultiResolutionPDEDeformableRegistration.h:282
itk::MultiResolutionPDEDeformableRegistration::m_CurrentLevel
unsigned int m_CurrentLevel
Definition: itkMultiResolutionPDEDeformableRegistration.h:293
itk::MultiResolutionPDEDeformableRegistration::m_RegistrationFilter
RegistrationPointer m_RegistrationFilter
Definition: itkMultiResolutionPDEDeformableRegistration.h:286
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::MultiResolutionPDEDeformableRegistration::m_MovingImagePyramid
MovingImagePyramidPointer m_MovingImagePyramid
Definition: itkMultiResolutionPDEDeformableRegistration.h:288
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:59
itk::MultiResolutionPDEDeformableRegistration::MovingImagePyramidPointer
typename MovingImagePyramidType::Pointer MovingImagePyramidPointer
Definition: itkMultiResolutionPDEDeformableRegistration.h:139
itk::MultiResolutionPDEDeformableRegistration::m_FixedImagePyramid
FixedImagePyramidPointer m_FixedImagePyramid
Definition: itkMultiResolutionPDEDeformableRegistration.h:287
itk::MultiResolutionPDEDeformableRegistration::m_NumberOfIterations
NumberOfIterationsType m_NumberOfIterations
Definition: itkMultiResolutionPDEDeformableRegistration.h:294
itk::MultiResolutionPDEDeformableRegistration::m_StopRegistrationFlag
bool m_StopRegistrationFlag
Definition: itkMultiResolutionPDEDeformableRegistration.h:297
itkArray.h
itk::MultiResolutionPDEDeformableRegistration::m_FieldExpander
FieldExpanderPointer m_FieldExpander
Definition: itkMultiResolutionPDEDeformableRegistration.h:289
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::m_InitialDisplacementField
DisplacementFieldPointer m_InitialDisplacementField
Definition: itkMultiResolutionPDEDeformableRegistration.h:290
itk::MultiResolutionPDEDeformableRegistration::DefaultRegistrationType
TDefaultRegistrationType DefaultRegistrationType
Definition: itkMultiResolutionPDEDeformableRegistration.h:131
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293