ITK  4.4.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 <class TFixedImage, class TMovingImage, class 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 
68  void SetMovingImage(const MovingImageType *ptr)
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 
92  void SetDisplacementField(DisplacementFieldTypePointer ptr)
93  {
94  m_DisplacementField = ptr;
95  }
96 
99  DisplacementFieldType * GetDisplacementField(void)
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 
124  void SetNormalizeGradient(bool e)
125  {
126  m_NormalizeGradient = e;
127  }
128 
129  bool GetNormalizeGradient() const
130  {
131  return m_NormalizeGradient;
132  }
133 
134 protected:
136  {
137  m_MovingImage = NULL;
138  m_FixedImage = NULL;
139  m_DisplacementField = NULL;
140  m_Energy = 0.0;
141  m_NormalizeGradient = true;
142  m_GradientStep = 1.0;
143  }
144 
146  {
147  }
148 
149  void PrintSelf(std::ostream & os, Indent indent) const
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 private:
174  GPUPDEDeformableRegistrationFunction(const Self &); // purposely not
175  // implemented
176  void operator=(const Self &); // purposely not
177 
178  // implemented
179 
180 };
181 } // end namespace itk
182 
183 #endif
184