ITK  5.2.0
Insight Toolkit
itkPDEDeformableRegistrationFunction.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 itkPDEDeformableRegistrationFunction_h
19 #define itkPDEDeformableRegistrationFunction_h
20 
22 
23 namespace itk
24 {
40 template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(PDEDeformableRegistrationFunction);
45 
51 
54 
56  using MovingImageType = TMovingImage;
57  using MovingImagePointer = typename MovingImageType::ConstPointer;
58 
60  using FixedImageType = TFixedImage;
61  using FixedImagePointer = typename FixedImageType::ConstPointer;
62 
64  using DisplacementFieldType = TDisplacementField;
65  using DisplacementFieldTypePointer = typename DisplacementFieldType::Pointer;
66 
68  void
70  {
71  m_MovingImage = ptr;
72  }
73 
75  const MovingImageType *
77  {
78  return m_MovingImage;
79  }
80 
82  void
84  {
85  m_FixedImage = ptr;
86  }
87 
89  const FixedImageType *
90  GetFixedImage() const
91  {
92  return m_FixedImage;
93  }
94 
96  void
98  {
99  m_DisplacementField = ptr;
100  }
101 
106  {
107  return m_DisplacementField;
108  }
109 
110  void
111  SetEnergy(double e)
112  {
113  m_Energy = e;
114  }
115  double
116  GetEnergy() const
117  {
118  return m_Energy;
119  }
120  void
122  {
123  m_GradientStep = e;
124  }
125  double
127  {
128  return m_GradientStep;
129  }
130  void
132  {
134  }
135  bool
137  {
138  return m_NormalizeGradient;
139  }
140 
141 protected:
143  {
144  m_MovingImage = nullptr;
145  m_FixedImage = nullptr;
146  m_DisplacementField = nullptr;
147  m_Energy = 0.0;
148  m_NormalizeGradient = true;
149  m_GradientStep = 1.0;
150  }
151 
152  ~PDEDeformableRegistrationFunction() override = default;
153 
154  void
155  PrintSelf(std::ostream & os, Indent indent) const override
156  {
157  Superclass::PrintSelf(os, indent);
158  os << indent << "MovingImage: ";
159  os << m_MovingImage.GetPointer() << std::endl;
160  os << indent << "FixedImage: ";
161  os << m_FixedImage.GetPointer() << std::endl;
162  }
163 
166 
169 
172 
173  mutable double m_Energy;
174 
176 
177  mutable double m_GradientStep;
178 };
179 } // end namespace itk
180 
181 #endif
itk::PDEDeformableRegistrationFunction::MovingImageType
TMovingImage MovingImageType
Definition: itkPDEDeformableRegistrationFunction.h:56
itk::PDEDeformableRegistrationFunction::~PDEDeformableRegistrationFunction
~PDEDeformableRegistrationFunction() override=default
itk::PDEDeformableRegistrationFunction::PDEDeformableRegistrationFunction
PDEDeformableRegistrationFunction()
Definition: itkPDEDeformableRegistrationFunction.h:142
itk::PDEDeformableRegistrationFunction::m_Energy
double m_Energy
Definition: itkPDEDeformableRegistrationFunction.h:173
itk::PDEDeformableRegistrationFunction::MovingImagePointer
typename MovingImageType::ConstPointer MovingImagePointer
Definition: itkPDEDeformableRegistrationFunction.h:57
itk::PDEDeformableRegistrationFunction::GetEnergy
double GetEnergy() const
Definition: itkPDEDeformableRegistrationFunction.h:116
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::PDEDeformableRegistrationFunction::GetFixedImage
const FixedImageType * GetFixedImage() const
Definition: itkPDEDeformableRegistrationFunction.h:90
itk::PDEDeformableRegistrationFunction::m_FixedImage
FixedImagePointer m_FixedImage
Definition: itkPDEDeformableRegistrationFunction.h:168
itkFiniteDifferenceFunction.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::PDEDeformableRegistrationFunction::FixedImagePointer
typename FixedImageType::ConstPointer FixedImagePointer
Definition: itkPDEDeformableRegistrationFunction.h:61
itk::PDEDeformableRegistrationFunction::SetFixedImage
void SetFixedImage(const FixedImageType *ptr)
Definition: itkPDEDeformableRegistrationFunction.h:83
itk::PDEDeformableRegistrationFunction::m_GradientStep
double m_GradientStep
Definition: itkPDEDeformableRegistrationFunction.h:177
itk::PDEDeformableRegistrationFunction::GetNormalizeGradient
bool GetNormalizeGradient() const
Definition: itkPDEDeformableRegistrationFunction.h:136
itk::PDEDeformableRegistrationFunction
Definition: itkPDEDeformableRegistrationFunction.h:41
itk::PDEDeformableRegistrationFunction::SetDisplacementField
void SetDisplacementField(DisplacementFieldTypePointer ptr)
Definition: itkPDEDeformableRegistrationFunction.h:97
itk::PDEDeformableRegistrationFunction::DisplacementFieldTypePointer
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
Definition: itkPDEDeformableRegistrationFunction.h:65
itk::PDEDeformableRegistrationFunction::SetGradientStep
void SetGradientStep(double e)
Definition: itkPDEDeformableRegistrationFunction.h:121
itk::PDEDeformableRegistrationFunction::m_DisplacementField
DisplacementFieldTypePointer m_DisplacementField
Definition: itkPDEDeformableRegistrationFunction.h:171
itk::PDEDeformableRegistrationFunction::GetMovingImage
const MovingImageType * GetMovingImage() const
Definition: itkPDEDeformableRegistrationFunction.h:76
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::PDEDeformableRegistrationFunction::FixedImageType
TFixedImage FixedImageType
Definition: itkPDEDeformableRegistrationFunction.h:60
itk::PDEDeformableRegistrationFunction::GetDisplacementField
DisplacementFieldType * GetDisplacementField()
Definition: itkPDEDeformableRegistrationFunction.h:105
itk::PDEDeformableRegistrationFunction::SetEnergy
void SetEnergy(double e)
Definition: itkPDEDeformableRegistrationFunction.h:111
itk::PDEDeformableRegistrationFunction::m_MovingImage
MovingImagePointer m_MovingImage
Definition: itkPDEDeformableRegistrationFunction.h:165
itk::Math::e
static constexpr double e
Definition: itkMath.h:54
itk::FiniteDifferenceFunction
Definition: itkFiniteDifferenceFunction.h:66
itk::PDEDeformableRegistrationFunction::SetMovingImage
void SetMovingImage(const MovingImageType *ptr)
Definition: itkPDEDeformableRegistrationFunction.h:69
itk::PDEDeformableRegistrationFunction::SetNormalizeGradient
void SetNormalizeGradient(bool e)
Definition: itkPDEDeformableRegistrationFunction.h:131
itk::PDEDeformableRegistrationFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkPDEDeformableRegistrationFunction.h:155
itk::PDEDeformableRegistrationFunction::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkPDEDeformableRegistrationFunction.h:64
itk::FiniteDifferenceFunction< TDisplacementField >::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::PDEDeformableRegistrationFunction::m_NormalizeGradient
bool m_NormalizeGradient
Definition: itkPDEDeformableRegistrationFunction.h:175
itk::PDEDeformableRegistrationFunction::GetGradientStep
double GetGradientStep() const
Definition: itkPDEDeformableRegistrationFunction.h:126