ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkPDEDeformableRegistrationFunction.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 itkPDEDeformableRegistrationFunction_h
19 #define itkPDEDeformableRegistrationFunction_h
20 
22 
23 namespace itk
24 {
40 template< typename TFixedImage, typename TMovingImage, typename TDisplacementField >
42  public FiniteDifferenceFunction< TDisplacementField >
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(PDEDeformableRegistrationFunction);
46 
52 
56 
58  using MovingImageType = TMovingImage;
59  using MovingImagePointer = typename MovingImageType::ConstPointer;
60 
62  using FixedImageType = TFixedImage;
63  using FixedImagePointer = typename FixedImageType::ConstPointer;
64 
66  using DisplacementFieldType = TDisplacementField;
67  using DisplacementFieldTypePointer = typename DisplacementFieldType::Pointer;
68 
71  { m_MovingImage = ptr; }
72 
75  { return m_MovingImage; }
76 
78  void SetFixedImage(const FixedImageType *ptr)
79  { m_FixedImage = ptr; }
80 
82  const FixedImageType * GetFixedImage() const
83  { return m_FixedImage; }
84 
87  { m_DisplacementField = ptr; }
88 
92  { return m_DisplacementField; }
93 
94  void SetEnergy(double e) { m_Energy = e; }
95  double GetEnergy() const { return m_Energy; }
96  void SetGradientStep(double e) { m_GradientStep = e; }
97  double GetGradientStep() const { return m_GradientStep; }
99  bool GetNormalizeGradient() const { return m_NormalizeGradient; }
100 
101 protected:
103  {
104  m_MovingImage = nullptr;
105  m_FixedImage = nullptr;
106  m_DisplacementField = nullptr;
107  m_Energy = 0.0;
108  m_NormalizeGradient = true;
109  m_GradientStep = 1.0;
110  }
111 
112  ~PDEDeformableRegistrationFunction() override = default;
113 
114  void PrintSelf(std::ostream & os, Indent indent) const override
115  {
116  Superclass::PrintSelf(os, indent);
117  os << indent << "MovingImage: ";
118  os << m_MovingImage.GetPointer() << std::endl;
119  os << indent << "FixedImage: ";
120  os << m_FixedImage.GetPointer() << std::endl;
121  }
122 
125 
128 
131 
132  mutable double m_Energy;
133 
135 
136  mutable double m_GradientStep;
137 };
138 } // end namespace itk
139 
140 #endif
void SetDisplacementField(DisplacementFieldTypePointer ptr)
Light weight base class for most itk classes.
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
void PrintSelf(std::ostream &os, Indent indent) const override
typename MovingImageType::ConstPointer MovingImagePointer
~PDEDeformableRegistrationFunction() override=default
static constexpr double e
The base of the natural logarithm or Euler&#39;s number
Definition: itkMath.h:53
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename FixedImageType::ConstPointer FixedImagePointer
void PrintSelf(std::ostream &os, Indent indent) const override