SimpleITK  1.0.1
sitkVersorTransform.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 sitkVersorTransform_h
19 #define sitkVersorTransform_h
20 
21 #include "sitkCommon.h"
22 #include "sitkTransform.h"
23 
24 namespace itk
25 {
26 namespace simple
27 {
28 
35  : public Transform
36 {
37 public:
40 
41 // construct identity
43 
45 
46  explicit VersorTransform( const Transform & );
47 
48  explicit VersorTransform( const std::vector< double > &versor,
49  const std::vector< double> &fixedCenter =
50  std::vector< double >(3, 0.0) );
51 
52  VersorTransform( const std::vector< double > &axis,
53  double angle,
54  const std::vector< double> &fixedCenter =
55  std::vector< double >(3, 0.0) );
56 
57  VersorTransform &operator=( const VersorTransform & );
58 
60  SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
61  std::vector<double> GetCenter( ) const;
62 
63 
65  SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &versor);
66  SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &axis, double angle);
67  std::vector<double> GetVersor() const;
68 
70  std::vector<double> GetMatrix() const;
71  SITK_RETURN_SELF_TYPE_HEADER SetMatrix(const std::vector<double> &matrix, double tolerance = 1e-10);
72 
73 protected:
74 
75  virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
76 
77 private:
78 
79  using Superclass::AddTransform;
80 
81  void InternalInitialization(itk::TransformBase *transform);
82 
83  template <typename TransformType>
84  void InternalInitialization(TransformType *transform);
85 
86 
87  nsstd::function<void(const std::vector<double>&)> m_pfSetCenter;
88  nsstd::function<std::vector<double>()> m_pfGetCenter;
89  nsstd::function<void(const std::vector<double>&)> m_pfSetRotation1;
90  nsstd::function<void(const std::vector<double>&,double)> m_pfSetRotation2;
91  nsstd::function<std::vector<double>()> m_pfGetVersor;
92  nsstd::function<std::vector<double>()> m_pfGetMatrix;
93  nsstd::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
94 };
95 }
96 }
97 
98 #endif // sitkVersorTransform_h
A 3D rotation transform with rotation as a versor around a fixed center.
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:83
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41