ITK  6.0.0
Insight Toolkit
itkPDEDeformableRegistrationFilter.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 itkPDEDeformableRegistrationFilter_h
19 #define itkPDEDeformableRegistrationFilter_h
20 
23 
24 namespace itk
25 {
72 template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
73 class ITK_TEMPLATE_EXPORT PDEDeformableRegistrationFilter
74  : public DenseFiniteDifferenceImageFilter<TDisplacementField, TDisplacementField>
75 {
76 public:
77  ITK_DISALLOW_COPY_AND_MOVE(PDEDeformableRegistrationFilter);
78 
84 
86  itkNewMacro(Self);
87 
89  itkOverrideGetNameOfClassMacro(PDEDeformableRegistrationFilter);
90 
92  using FixedImageType = TFixedImage;
95 
97  using MovingImageType = TMovingImage;
100 
102  using DisplacementFieldType = TDisplacementField;
104 
106  using typename Superclass::OutputImageType;
107 
109  using typename Superclass::FiniteDifferenceFunctionType;
110 
114 
116  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
117 
119  itkSetInputMacro(FixedImage, FixedImageType);
120 
122  itkGetInputMacro(FixedImage, FixedImageType);
123 
125  itkSetInputMacro(MovingImage, MovingImageType);
126 
128  itkGetInputMacro(MovingImage, MovingImageType);
129 
131  itkSetInputMacro(InitialDisplacementField, DisplacementFieldType);
132 
134  itkGetInputMacro(InitialDisplacementField, DisplacementFieldType);
135 
139  {
140  return this->GetOutput();
141  }
142 
148  std::vector<SmartPointer<DataObject>>::size_type
149  GetNumberOfValidRequiredInputs() const override;
150 
156  itkSetMacro(SmoothDisplacementField, bool);
157  itkGetConstMacro(SmoothDisplacementField, bool);
158  itkBooleanMacro(SmoothDisplacementField);
162 
166  itkSetMacro(StandardDeviations, StandardDeviationsType);
167  virtual void
168  SetStandardDeviations(double value);
173  itkGetConstReferenceMacro(StandardDeviations, StandardDeviationsType);
174 
180  itkSetMacro(SmoothUpdateField, bool);
181  itkGetConstMacro(SmoothUpdateField, bool);
182  itkBooleanMacro(SmoothUpdateField);
187  itkSetMacro(UpdateFieldStandardDeviations, StandardDeviationsType);
188  virtual void
189  SetUpdateFieldStandardDeviations(double value);
194  itkGetConstReferenceMacro(UpdateFieldStandardDeviations, StandardDeviationsType);
195 
197  virtual void
199  {
200  m_StopRegistrationFlag = true;
201  }
202 
205  itkSetMacro(MaximumError, double);
206  itkGetConstMacro(MaximumError, double);
211  itkSetMacro(MaximumKernelWidth, unsigned int);
212  itkGetConstMacro(MaximumKernelWidth, unsigned int);
215 protected:
217  ~PDEDeformableRegistrationFilter() override = default;
218  void
219  PrintSelf(std::ostream & os, Indent indent) const override;
220 
223  bool
224  Halt() override
225  {
226  if (m_StopRegistrationFlag)
227  {
228  return true;
229  }
230 
231  return this->Superclass::Halt();
232  }
233 
237  void
238  CopyInputToOutput() override;
239 
242  void
243  InitializeIteration() override;
244 
248  virtual void
249  SmoothDisplacementField();
250 
254  virtual void
255  SmoothUpdateField();
256 
261  void
262  PostProcessOutput() override;
263 
268  void
269  Initialize() override;
270 
275  void
276  GenerateOutputInformation() override;
277 
284  void
285  GenerateInputRequestedRegion() override;
286 
287 private:
289  StandardDeviationsType m_StandardDeviations{};
290  StandardDeviationsType m_UpdateFieldStandardDeviations{};
291 
293  bool m_SmoothDisplacementField{};
294  bool m_SmoothUpdateField{};
295 
299 
300 private:
302  double m_MaximumError{};
303 
305  unsigned int m_MaximumKernelWidth{};
306 
308  bool m_StopRegistrationFlag{};
309 };
310 } // end namespace itk
311 
312 #ifndef ITK_MANUAL_INSTANTIATION
313 # include "itkPDEDeformableRegistrationFilter.hxx"
314 #endif
315 
316 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::PDEDeformableRegistrationFilter::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkPDEDeformableRegistrationFilter.h:94
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkPDEDeformableRegistrationFunction.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DenseFiniteDifferenceImageFilter
Definition: itkDenseFiniteDifferenceImageFilter.h:70
itk::PDEDeformableRegistrationFilter::FixedImageType
TFixedImage FixedImageType
Definition: itkPDEDeformableRegistrationFilter.h:92
itk::PDEDeformableRegistrationFilter::MovingImageConstPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
Definition: itkPDEDeformableRegistrationFilter.h:99
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::PDEDeformableRegistrationFilter::GetDisplacementField
DisplacementFieldType * GetDisplacementField()
Definition: itkPDEDeformableRegistrationFilter.h:138
itk::PDEDeformableRegistrationFunction
Definition: itkPDEDeformableRegistrationFunction.h:41
itk::PDEDeformableRegistrationFilter::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkPDEDeformableRegistrationFilter.h:102
itk::PDEDeformableRegistrationFilter::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkPDEDeformableRegistrationFilter.h:103
itk::FixedArray< double, ImageDimension >
itkDenseFiniteDifferenceImageFilter.h
itk::PDEDeformableRegistrationFilter::StopRegistration
virtual void StopRegistration()
Definition: itkPDEDeformableRegistrationFilter.h:198
itk::PDEDeformableRegistrationFilter::Halt
bool Halt() override
Definition: itkPDEDeformableRegistrationFilter.h:224
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::PDEDeformableRegistrationFilter::FixedImagePointer
typename FixedImageType::Pointer FixedImagePointer
Definition: itkPDEDeformableRegistrationFilter.h:93
itk::PDEDeformableRegistrationFilter::MovingImageType
TMovingImage MovingImageType
Definition: itkPDEDeformableRegistrationFilter.h:97
itk::PDEDeformableRegistrationFilter
Deformably register two images using a PDE algorithm.
Definition: itkPDEDeformableRegistrationFilter.h:73
itk::PDEDeformableRegistrationFilter::MovingImagePointer
typename MovingImageType::Pointer MovingImagePointer
Definition: itkPDEDeformableRegistrationFilter.h:98