ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGPUPDEDeformableRegistrationFunction.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 itkGPUPDEDeformableRegistrationFunction_h
19 #define itkGPUPDEDeformableRegistrationFunction_h
20 
22 
23 namespace itk
24 {
40 template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
42  public GPUFiniteDifferenceFunction<TDisplacementField>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(GPUPDEDeformableRegistrationFunction);
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  {
72  m_MovingImage = ptr;
73  }
74 
77  {
78  return m_MovingImage;
79  }
80 
82  void SetFixedImage(const FixedImageType *ptr)
83  {
84  m_FixedImage = ptr;
85  }
86 
88  const FixedImageType * GetFixedImage() const
89  {
90  return m_FixedImage;
91  }
92 
95  {
96  m_DisplacementField = ptr;
97  }
98 
102  {
103  return m_DisplacementField;
104  }
105 
106  void SetEnergy(double e)
107  {
108  m_Energy = e;
109  }
110 
111  double GetEnergy() const
112  {
113  return m_Energy;
114  }
115 
116  void SetGradientStep(double e)
117  {
118  m_GradientStep = e;
119  }
120 
121  double GetGradientStep() const
122  {
123  return m_GradientStep;
124  }
125 
127  {
129  }
130 
131  bool GetNormalizeGradient() const
132  {
133  return m_NormalizeGradient;
134  }
135 
136 protected:
138  {
139  m_MovingImage = nullptr;
140  m_FixedImage = nullptr;
141  m_DisplacementField = nullptr;
142  m_Energy = 0.0;
143  m_NormalizeGradient = true;
144  m_GradientStep = 1.0;
145  }
146 
148 
149  void PrintSelf(std::ostream & os, Indent indent) const override
150  {
151  Superclass::PrintSelf(os, indent);
152  os << indent << "MovingImage: ";
153  os << m_MovingImage.GetPointer() << std::endl;
154  os << indent << "FixedImage: ";
155  os << m_FixedImage.GetPointer() << std::endl;
156  }
157 
160 
163 
166 
167  mutable double m_Energy;
168 
170 
171  mutable double m_GradientStep;
172 };
173 } // end namespace itk
174 
175 #endif
Light weight base class for most itk classes.
void PrintSelf(std::ostream &os, Indent indent) const override
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
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
void PrintSelf(std::ostream &os, Indent indent) const override