ITK  5.2.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  * 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 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 
90 
92  using FixedImageType = TFixedImage;
93  using FixedImagePointer = typename FixedImageType::Pointer;
94  using FixedImageConstPointer = typename FixedImageType::ConstPointer;
95 
97  using MovingImageType = TMovingImage;
98  using MovingImagePointer = typename MovingImageType::Pointer;
99  using MovingImageConstPointer = typename MovingImageType::ConstPointer;
100 
102  using DisplacementFieldType = TDisplacementField;
103  using DisplacementFieldPointer = typename DisplacementFieldType::Pointer;
104 
106  using OutputImageType = typename Superclass::OutputImageType;
107 
109  using FiniteDifferenceFunctionType = 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);
160 
162 
166  itkSetMacro(StandardDeviations, StandardDeviationsType);
167  virtual void
168  SetStandardDeviations(double value);
170 
173  itkGetConstReferenceMacro(StandardDeviations, StandardDeviationsType);
174 
180  itkSetMacro(SmoothUpdateField, bool);
181  itkGetConstMacro(SmoothUpdateField, bool);
182  itkBooleanMacro(SmoothUpdateField);
184 
187  itkSetMacro(UpdateFieldStandardDeviations, StandardDeviationsType);
188  virtual void
189  SetUpdateFieldStandardDeviations(double value);
191 
194  itkGetConstReferenceMacro(UpdateFieldStandardDeviations, StandardDeviationsType);
195 
197  virtual void
199  {
200  m_StopRegistrationFlag = true;
201  }
202 
205  itkSetMacro(MaximumError, double);
206  itkGetConstMacro(MaximumError, double);
208 
211  itkSetMacro(MaximumKernelWidth, unsigned int);
212  itkGetConstMacro(MaximumKernelWidth, unsigned int);
214 
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 
236  void
237  CopyInputToOutput() override;
238 
241  void
242  InitializeIteration() override;
243 
247  virtual void
248  SmoothDisplacementField();
249 
253  virtual void
254  SmoothUpdateField();
255 
258  void
259  PostProcessOutput() override;
260 
262  void
263  Initialize() override;
264 
269  void
270  GenerateOutputInformation() override;
271 
278  void
279  GenerateInputRequestedRegion() override;
280 
281 private:
285 
289 
293 
294 private:
297 
299  unsigned int m_MaximumKernelWidth;
300 
303 };
304 } // end namespace itk
305 
306 #ifndef ITK_MANUAL_INSTANTIATION
307 # include "itkPDEDeformableRegistrationFilter.hxx"
308 #endif
309 
310 #endif
itk::PDEDeformableRegistrationFilter::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkPDEDeformableRegistrationFilter.h:94
itk::PDEDeformableRegistrationFilter::m_StandardDeviations
StandardDeviationsType m_StandardDeviations
Definition: itkPDEDeformableRegistrationFilter.h:283
itk::PDEDeformableRegistrationFilter::m_MaximumError
double m_MaximumError
Definition: itkPDEDeformableRegistrationFilter.h:296
itk::PDEDeformableRegistrationFilter::FiniteDifferenceFunctionType
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkPDEDeformableRegistrationFilter.h:109
itkPDEDeformableRegistrationFunction.h
itk::PDEDeformableRegistrationFilter::m_UpdateFieldStandardDeviations
StandardDeviationsType m_UpdateFieldStandardDeviations
Definition: itkPDEDeformableRegistrationFilter.h:284
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::PDEDeformableRegistrationFilter::m_MaximumKernelWidth
unsigned int m_MaximumKernelWidth
Definition: itkPDEDeformableRegistrationFilter.h:299
itk::DenseFiniteDifferenceImageFilter
Definition: itkDenseFiniteDifferenceImageFilter.h:69
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:59
itk::PDEDeformableRegistrationFilter::GetDisplacementField
DisplacementFieldType * GetDisplacementField()
Definition: itkPDEDeformableRegistrationFilter.h:138
itk::PDEDeformableRegistrationFilter::OutputImageType
typename Superclass::OutputImageType OutputImageType
Definition: itkPDEDeformableRegistrationFilter.h:106
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 >
itk::PDEDeformableRegistrationFilter::m_TempField
DisplacementFieldPointer m_TempField
Definition: itkPDEDeformableRegistrationFilter.h:292
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: itkAnnulusOperator.h:24
itk::PDEDeformableRegistrationFilter::m_SmoothDisplacementField
bool m_SmoothDisplacementField
Definition: itkPDEDeformableRegistrationFilter.h:287
itk::PDEDeformableRegistrationFilter::m_StopRegistrationFlag
bool m_StopRegistrationFlag
Definition: itkPDEDeformableRegistrationFilter.h:302
itk::PDEDeformableRegistrationFilter::m_SmoothUpdateField
bool m_SmoothUpdateField
Definition: itkPDEDeformableRegistrationFilter.h:288
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