ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkPDEDeformableRegistrationFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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_ASSIGN(PDEDeformableRegistrationFilter);
78 
84 
86  itkNewMacro(Self);
87 
91 
93  using FixedImageType = TFixedImage;
94  using FixedImagePointer = typename FixedImageType::Pointer;
95  using FixedImageConstPointer = typename FixedImageType::ConstPointer;
96 
98  using MovingImageType = TMovingImage;
99  using MovingImagePointer = typename MovingImageType::Pointer;
100  using MovingImageConstPointer = typename MovingImageType::ConstPointer;
101 
103  using DisplacementFieldType = TDisplacementField;
104  using DisplacementFieldPointer = typename DisplacementFieldType::Pointer;
105 
107  using OutputImageType = typename Superclass::OutputImageType;
108 
110  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
111 
115 
117  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
118 
120  itkSetInputMacro(FixedImage, FixedImageType);
121 
123  itkGetInputMacro(FixedImage, FixedImageType);
124 
126  itkSetInputMacro(MovingImage, MovingImageType);
127 
129  itkGetInputMacro(MovingImage, MovingImageType);
130 
132  itkSetInputMacro(InitialDisplacementField, DisplacementFieldType);
133 
135  itkGetInputMacro(InitialDisplacementField, DisplacementFieldType);
136 
139  { return this->GetOutput(); }
140 
146  std::vector< SmartPointer< DataObject > >::size_type GetNumberOfValidRequiredInputs() const override;
147 
153  itkSetMacro(SmoothDisplacementField, bool);
154  itkGetConstMacro(SmoothDisplacementField, bool);
155  itkBooleanMacro(SmoothDisplacementField);
157 
159 
163  itkSetMacro(StandardDeviations, StandardDeviationsType);
164  virtual void SetStandardDeviations(double value);
166 
169  itkGetConstReferenceMacro(StandardDeviations, StandardDeviationsType);
170 
176  itkSetMacro(SmoothUpdateField, bool);
177  itkGetConstMacro(SmoothUpdateField, bool);
178  itkBooleanMacro(SmoothUpdateField);
180 
183  itkSetMacro(UpdateFieldStandardDeviations, StandardDeviationsType);
184  virtual void SetUpdateFieldStandardDeviations(double value);
186 
189  itkGetConstReferenceMacro(UpdateFieldStandardDeviations, StandardDeviationsType);
190 
192  virtual void StopRegistration()
193  { m_StopRegistrationFlag = true; }
194 
197  itkSetMacro(MaximumError, double);
198  itkGetConstMacro(MaximumError, double);
200 
203  itkSetMacro(MaximumKernelWidth, unsigned int);
204  itkGetConstMacro(MaximumKernelWidth, unsigned int);
206 
207 protected:
209  ~PDEDeformableRegistrationFilter() override = default;
210  void PrintSelf(std::ostream & os, Indent indent) const override;
211 
214  bool Halt() override
215  {
216  if ( m_StopRegistrationFlag )
217  {
218  return true;
219  }
220 
221  return this->Superclass::Halt();
222  }
223 
226  void CopyInputToOutput() override;
227 
230  void InitializeIteration() override;
231 
235  virtual void SmoothDisplacementField();
236 
240  virtual void SmoothUpdateField();
241 
244  void PostProcessOutput() override;
245 
247  void Initialize() override;
248 
253  void GenerateOutputInformation() override;
254 
261  void GenerateInputRequestedRegion() override;
262 
263 private:
267 
271 
275 
276 private:
279 
281  unsigned int m_MaximumKernelWidth;
282 
285 };
286 } // end namespace itk
287 
288 #ifndef ITK_MANUAL_INSTANTIATION
289 #include "itkPDEDeformableRegistrationFilter.hxx"
290 #endif
291 
292 #endif
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
typename FixedImageType::ConstPointer FixedImageConstPointer
Light weight base class for most itk classes.
typename DisplacementFieldType::Pointer DisplacementFieldPointer
typename Superclass::OutputImageType OutputImageType
typename MovingImageType::Pointer MovingImagePointer
Deformably register two images using a PDE algorithm.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename MovingImageType::ConstPointer MovingImageConstPointer