SimpleITK  2.0.0
sitkVersorTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright NumFOCUS
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 
36  : public Transform
37 {
38 public:
41 
42  ~VersorTransform() override;
43 
44  // construct identity
46 
48 
49  explicit VersorTransform( const Transform & );
50 
51  explicit VersorTransform( const std::vector< double > &versor,
52  const std::vector< double> &fixedCenter =
53  std::vector< double >(3, 0.0) );
54 
55  VersorTransform( const std::vector< double > &axis,
56  double angle,
57  const std::vector< double> &fixedCenter =
58  std::vector< double >(3, 0.0) );
59 
60  VersorTransform &operator=( const VersorTransform & );
61 
63  std::string GetName() const override { return std::string ("VersorTransform"); }
64 
66  SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
67  std::vector<double> GetCenter( ) const;
68 
69 
71  SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &versor);
72  SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &axis, double angle);
73  std::vector<double> GetVersor() const;
74 
76  std::vector<double> GetMatrix() const;
77  SITK_RETURN_SELF_TYPE_HEADER SetMatrix(const std::vector<double> &matrix, double tolerance = 1e-10);
78 
79 protected:
80 
81  void SetPimpleTransform( PimpleTransformBase *pimpleTransform ) override;
82 
83 private:
84 
85  void InternalInitialization(itk::TransformBase *transform);
86 
87  template <typename TransformType>
88  void InternalInitialization(TransformType *transform);
89 
90 
91  std::function<void(const std::vector<double>&)> m_pfSetCenter;
92  std::function<std::vector<double>()> m_pfGetCenter;
93  std::function<void(const std::vector<double>&)> m_pfSetRotation1;
94  std::function<void(const std::vector<double>&,double)> m_pfSetRotation2;
95  std::function<std::vector<double>()> m_pfGetVersor;
96  std::function<std::vector<double>()> m_pfGetMatrix;
97  std::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
98 };
99 }
100 }
101 
102 #endif // sitkVersorTransform_h
itk::simple::Transform
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:80
itk::simple::VersorTransform::m_pfSetRotation1
std::function< void(const std::vector< double > &)> m_pfSetRotation1
Definition: sitkVersorTransform.h:93
sitkCommon.h
itk::simple::VersorTransform::m_pfSetRotation2
std::function< void(const std::vector< double > &, double)> m_pfSetRotation2
Definition: sitkVersorTransform.h:94
itk::simple::VersorTransform::GetName
std::string GetName() const override
Definition: sitkVersorTransform.h:63
SITKCommon_EXPORT
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
itk::simple::VersorTransform::m_pfSetMatrix
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
Definition: sitkVersorTransform.h:97
itk::simple::VersorTransform::m_pfGetCenter
std::function< std::vector< double >)> m_pfGetCenter
Definition: sitkVersorTransform.h:92
sitkTransform.h
itk
itk::simple::VersorTransform::m_pfGetMatrix
std::function< std::vector< double >)> m_pfGetMatrix
Definition: sitkVersorTransform.h:96
itk::simple::VersorTransform::m_pfSetCenter
std::function< void(const std::vector< double > &)> m_pfSetCenter
Definition: sitkVersorTransform.h:91
itk::simple::VersorTransform::m_pfGetVersor
std::function< std::vector< double >)> m_pfGetVersor
Definition: sitkVersorTransform.h:95
itk::simple::VersorTransform
A 3D rotation transform with rotation as a versor around a fixed center.
Definition: sitkVersorTransform.h:35
itk::TransformBaseTemplate
Definition: sitkTransform.h:30