go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkGPUTransformCopier.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 __itkGPUTransformCopier_h
19 #define __itkGPUTransformCopier_h
20 
21 #include "itkTransform.h"
22 
23 namespace itk
24 {
61 template< typename TTypeList, typename NDimensions,
62 typename TTransform, typename TOutputTransformPrecisionType >
63 class GPUTransformCopier : public Object
64 {
65 public:
66 
69  typedef Object Superclass;
71  typedef SmartPointer< const Self > ConstPointer;
72 
74  itkNewMacro( Self );
75 
77  itkTypeMacro( GPUTransformCopier, Object );
78 
80  typedef TTransform CPUTransformType;
81  typedef typename CPUTransformType::ConstPointer CPUTransformConstPointer;
82  typedef typename CPUTransformType::ParametersType CPUParametersType;
83  typedef typename CPUTransformType::ScalarType CPUScalarType;
84 
86  itkStaticConstMacro( InputSpaceDimension, unsigned int, CPUTransformType::InputSpaceDimension );
87  itkStaticConstMacro( OutputSpaceDimension, unsigned int, CPUTransformType::OutputSpaceDimension );
88 
90  typedef TOutputTransformPrecisionType GPUScalarType;
91  typedef Transform< GPUScalarType, InputSpaceDimension, OutputSpaceDimension >
93  typedef typename GPUTransformType::Pointer GPUTransformPointer;
94  typedef typename GPUTransformType::ParametersType GPUParametersType;
95 
97  itkSetConstObjectMacro( InputTransform, CPUTransformType );
98 
101 
110  itkGetConstMacro( ExplicitMode, bool );
111  itkSetMacro( ExplicitMode, bool );
112 
114  void Update( void );
115 
116 #ifdef ITK_USE_CONCEPT_CHECKING
117  // Begin concept checking
118  itkConceptMacro( OutputTransformPrecisionTypeIsFloatingPointCheck,
119  ( Concept::IsFloatingPoint< TOutputTransformPrecisionType > ) );
120  // End concept checking
121 #endif
122 
123 protected:
124 
126  virtual ~GPUTransformCopier() {}
127  virtual void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE;
128 
130  bool CopyTransform(
131  const CPUTransformConstPointer & fromTransform,
132  GPUTransformPointer & toTransform );
133 
136  const CPUTransformConstPointer & fromTransform,
137  GPUTransformPointer & toTransform );
138 
140  void CastCopyParameters(
141  const CPUParametersType & from,
142  GPUParametersType & to );
143 
144 private:
145 
148  const CPUTransformConstPointer & fromTransform,
149  GPUTransformPointer & toTransform );
150 
152  template< unsigned int Dimension >
154 
156  template< unsigned int InputSpaceDimension >
158  const CPUTransformConstPointer &,
159  GPUTransformPointer &,
161  {
162  return false;
163  }
164 
165 
167  template< unsigned int InputSpaceDimension >
169  const CPUTransformConstPointer &,
170  GPUTransformPointer &,
172  {
173  return false;
174  }
175 
176 
179  const CPUTransformConstPointer & fromTransform,
180  GPUTransformPointer & toTransform, TransformSpaceDimensionToType< 2 > );
181 
184  const CPUTransformConstPointer & fromTransform,
185  GPUTransformPointer & toTransform, TransformSpaceDimensionToType< 3 > );
186 
188  template< unsigned int InputSpaceDimension >
190  const CPUTransformConstPointer &,
191  GPUTransformPointer &,
193  {
194  return false;
195  }
196 
197 
199  template< unsigned int InputSpaceDimension >
201  const CPUTransformConstPointer &,
202  GPUTransformPointer &,
204  {
205  return false;
206  }
207 
208 
211  const CPUTransformConstPointer & fromTransform,
212  GPUTransformPointer & toTransform, TransformSpaceDimensionToType< 2 > );
213 
216  const CPUTransformConstPointer & fromTransform,
217  GPUTransformPointer & toTransform, TransformSpaceDimensionToType< 3 > );
218 
219 private:
220 
221  GPUTransformCopier( const Self & ); // purposely not implemented
222  void operator=( const Self & ); // purposely not implemented
223 
224  CPUTransformConstPointer m_InputTransform;
225  GPUTransformPointer m_Output;
226  ModifiedTimeType m_InternalTransformTime;
228 };
229 
230 } // end namespace itk
231 
232 #ifndef ITK_MANUAL_INSTANTIATION
233 #include "itkGPUTransformCopier.hxx"
234 #endif
235 
236 #endif /* __itkGPUTransformCopier_h */
bool CopyEuler3DTransform(const CPUTransformConstPointer &, GPUTransformPointer &, TransformSpaceDimensionToType< InputSpaceDimension >)
CPUTransformType::ScalarType CPUScalarType
GPUTransformPointer m_Output
itkGetModifiableObjectMacro(Output, GPUTransformType)
Transform< GPUScalarType, InputSpaceDimension, OutputSpaceDimension > GPUTransformType
A helper class which creates an GPU Transform which is perfect copy of the CPU Transform.
itkStaticConstMacro(InputSpaceDimension, unsigned int, CPUTransformType::InputSpaceDimension)
ModifiedTimeType m_InternalTransformTime
GPUTransformType::ParametersType GPUParametersType
bool CopySimilarity3DTransform(const CPUTransformConstPointer &, GPUTransformPointer &, TransformSpaceDimensionToType< InputSpaceDimension >)
CPUTransformConstPointer m_InputTransform
void CastCopyTransformParameters(const CPUTransformConstPointer &fromTransform, GPUTransformPointer &toTransform)
bool CopyEuler2DTransform(const CPUTransformConstPointer &, GPUTransformPointer &, TransformSpaceDimensionToType< InputSpaceDimension >)
bool CopyBSplineTransform(const CPUTransformConstPointer &fromTransform, GPUTransformPointer &toTransform)
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
SmartPointer< const Self > ConstPointer
void CastCopyParameters(const CPUParametersType &from, GPUParametersType &to)
bool CopyTransform(const CPUTransformConstPointer &fromTransform, GPUTransformPointer &toTransform)
bool CopySimilarity2DTransform(const CPUTransformConstPointer &, GPUTransformPointer &, TransformSpaceDimensionToType< InputSpaceDimension >)
CPUTransformType::ConstPointer CPUTransformConstPointer
TOutputTransformPrecisionType GPUScalarType
void operator=(const Self &)
CPUTransformType::ParametersType CPUParametersType
SmartPointer< Self > Pointer
GPUTransformType::Pointer GPUTransformPointer


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo