SimpleITK  1.2.4
sitkVersorRigid3DTransform.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 sitkVersorRigid3DTransform_h
19 #define sitkVersorRigid3DTransform_h
20 
21 #include "sitkCommon.h"
22 #include "sitkTransform.h"
23 
24 namespace itk
25 {
26 namespace simple
27 {
28 
29 
37  : public Transform
38 {
39 public:
42 
43  virtual ~VersorRigid3DTransform();
44 
45  // construct identity
47 
49 
50  explicit VersorRigid3DTransform( const Transform & );
51 
52  explicit VersorRigid3DTransform( const std::vector< double > &versor,
53  const std::vector< double > &translation=std::vector< double >(3, 0.0),
54  const std::vector< double> &fixedCenter=std::vector< double >(3, 0.0));
55 
56  VersorRigid3DTransform( const std::vector< double > &axis, double angle,
57  const std::vector< double > &translation=std::vector< double >(3, 0.0),
58  const std::vector< double> &fixedCenter=std::vector< double >(3, 0.0) );
59 
60  VersorRigid3DTransform &operator=( const VersorRigid3DTransform & );
61 
63  SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
64  std::vector<double> GetCenter( ) const;
65 
66 
68  SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &versor);
69  SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &axis, double angle);
70  std::vector<double> GetVersor() const;
71 
72  std::vector<double> GetTranslation( ) const;
73  SITK_RETURN_SELF_TYPE_HEADER SetTranslation(const std::vector<double>& translation);
74 
76  SITK_RETURN_SELF_TYPE_HEADER Translate(const std::vector<double> &offset);
77  std::vector<double> GetMatrix() const;
78  SITK_RETURN_SELF_TYPE_HEADER SetMatrix(const std::vector<double> &matrix, double tolerance = 1e-10);
79 
80 protected:
81 
82  virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
83 
84 private:
85 
86  using Superclass::AddTransform;
87 
88  void InternalInitialization(itk::TransformBase *transform);
89 
90  template <typename TransformType>
91  void InternalInitialization(TransformType *transform);
92 
93 
94  nsstd::function<void(const std::vector<double>&)> m_pfSetCenter;
95  nsstd::function<std::vector<double>()> m_pfGetCenter;
96  nsstd::function<void(const std::vector<double>&)> m_pfSetRotation1;
97  nsstd::function<void(const std::vector<double>&,double)> m_pfSetRotation2;
98  nsstd::function<std::vector<double>()> m_pfGetVersor;
99  nsstd::function<void(const std::vector<double>&)> m_pfSetTranslation;
100  nsstd::function<std::vector<double>()> m_pfGetTranslation;
101  nsstd::function<void(const std::vector<double> &)> m_pfTranslate;
102  nsstd::function<std::vector<double>()> m_pfGetMatrix;
103  nsstd::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
104 };
105 
106 }
107 }
108 
109 #endif // sitkVersorTransform_h
A rotation as a versor around a fixed center with translation of a 3D coordinate space.
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:84
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41