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