ITK  4.2.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 TDeformationField >
42  public GPUFiniteDifferenceFunction< TDeformationField >
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 TDeformationField DeformationFieldType;
65  typedef typename DeformationFieldType::Pointer DeformationFieldTypePointer;
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 SetDeformationField(DeformationFieldTypePointer ptr)
93  {
94  m_DeformationField = ptr;
95  }
96 
99  DeformationFieldType * GetDeformationField(void)
100  {
101  return m_DeformationField;
102  }
103 
104  void SetEnergy(double e) {
105  m_Energy = e;
106  }
107  double GetEnergy() const {
108  return m_Energy;
109  }
110  void SetGradientStep(double e) {
111  m_GradientStep = e;
112  }
113  double GetGradientStep() const {
114  return m_GradientStep;
115  }
116  void SetNormalizeGradient(bool e) {
117  m_NormalizeGradient = e;
118  }
119  bool GetNormalizeGradient() const {
120  return m_NormalizeGradient;
121  }
122 protected:
124  {
125  m_MovingImage = NULL;
126  m_FixedImage = NULL;
127  m_DeformationField = NULL;
128  m_Energy = 0.0;
129  m_NormalizeGradient = true;
130  m_GradientStep = 1.0;
131  }
132 
134  }
135 
136  void PrintSelf(std::ostream & os, Indent indent) const
137  {
138  Superclass::PrintSelf(os, indent);
139  os << indent << "MovingImage: ";
140  os << m_MovingImage.GetPointer() << std::endl;
141  os << indent << "FixedImage: ";
142  os << m_FixedImage.GetPointer() << std::endl;
143  }
144 
147 
150 
153 
154  mutable double m_Energy;
155 
157 
158  mutable double m_GradientStep;
159 private:
160  GPUPDEDeformableRegistrationFunction(const Self &); //purposely not
161  // implemented
162  void operator=(const Self &); //purposely not
163  // implemented
164 
165 };
166 } // end namespace itk
167 
168 #endif
169