ITK  4.13.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:
50 
54 
56  typedef TMovingImage MovingImageType;
57  typedef typename MovingImageType::ConstPointer MovingImagePointer;
58 
60  typedef TFixedImage FixedImageType;
61  typedef typename FixedImageType::ConstPointer FixedImagePointer;
62 
64  typedef TDisplacementField DisplacementFieldType;
65  typedef typename DisplacementFieldType::Pointer DisplacementFieldTypePointer;
66 
69  {
70  m_MovingImage = ptr;
71  }
72 
74  const MovingImageType * GetMovingImage(void) const
75  {
76  return m_MovingImage;
77  }
78 
80  void SetFixedImage(const FixedImageType *ptr)
81  {
82  m_FixedImage = ptr;
83  }
84 
86  const FixedImageType * GetFixedImage(void) const
87  {
88  return m_FixedImage;
89  }
90 
93  {
94  m_DisplacementField = ptr;
95  }
96 
100  {
101  return m_DisplacementField;
102  }
103 
104  void SetEnergy(double e)
105  {
106  m_Energy = e;
107  }
108 
109  double GetEnergy() const
110  {
111  return m_Energy;
112  }
113 
114  void SetGradientStep(double e)
115  {
116  m_GradientStep = e;
117  }
118 
119  double GetGradientStep() const
120  {
121  return m_GradientStep;
122  }
123 
125  {
127  }
128 
129  bool GetNormalizeGradient() const
130  {
131  return m_NormalizeGradient;
132  }
133 
134 protected:
136  {
137  m_MovingImage = ITK_NULLPTR;
138  m_FixedImage = ITK_NULLPTR;
139  m_DisplacementField = ITK_NULLPTR;
140  m_Energy = 0.0;
141  m_NormalizeGradient = true;
142  m_GradientStep = 1.0;
143  }
144 
146 
147  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE
148  {
149  Superclass::PrintSelf(os, indent);
150  os << indent << "MovingImage: ";
151  os << m_MovingImage.GetPointer() << std::endl;
152  os << indent << "FixedImage: ";
153  os << m_FixedImage.GetPointer() << std::endl;
154  }
155 
158 
161 
164 
165  mutable double m_Energy;
166 
168 
169  mutable double m_GradientStep;
170 
171 private:
172  ITK_DISALLOW_COPY_AND_ASSIGN(GPUPDEDeformableRegistrationFunction);
173 
174 };
175 } // end namespace itk
176 
177 #endif
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void PrintSelf(std::ostream &os, Indent indent) const override
GPUFiniteDifferenceFunction< TDisplacementField > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
static ITK_CONSTEXPR_VAR double e
The base of the natural logarithm or Euler&#39;s number
Definition: itkMath.h:56