SimpleITK  1.0.1
sitkTranslationTransform.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 sitkTranslationTransform_h
19 #define sitkTranslationTransform_h
20 
21 #include "sitkCommon.h"
22 #include "sitkTransform.h"
23 
24 namespace itk
25 {
26 namespace simple
27 {
28 
29 
35  : public Transform
36 {
37 public:
40 
41 explicit TranslationTransform(unsigned int dimensions,
42  const std::vector<double> &offset = std::vector<double>(3,0.0) );
43 
45 
47 
48 TranslationTransform &operator=( const TranslationTransform & );
49 
50 SITK_RETURN_SELF_TYPE_HEADER SetOffset(const std::vector<double> &params);
51 std::vector<double> GetOffset( ) const;
52 
53 protected:
54 
55 virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
56 
57 private:
58 
59 using Superclass::AddTransform;
60 
61 struct MyVisitor
62 {
65  template< typename TransformType >
66  void operator() ( void ) const
67  {
68  TransformType *t = dynamic_cast<TransformType*>(transform);
69  if (t && (typeid(*t)==typeid(TransformType)))
70  {
71  that->InternalInitialization<TransformType>(t);
72  }
73  }
74 };
75 
76 void InternalInitialization(itk::TransformBase *transform);
77 
78 template <typename TransformType>
79 void InternalInitialization(TransformType *transform);
80 
81 nsstd::function<void(const std::vector<double> &)> m_pfSetOffset;
82 nsstd::function<std::vector<double>()> m_pfGetOffset;
83 
84 };
85 
86 }
87 }
88 
89 #endif // sitkTranslationTransform_h
Translation of a 2D or 3D coordinate space.
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:83
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
void InternalInitialization(itk::TransformBase *transform)