SimpleITK  
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::simple
25 {
26 
34 {
35 public:
38 
39  ~VersorTransform() override;
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 = std::vector<double>(3, 0.0));
50 
51  VersorTransform(const std::vector<double> & axis,
52  double angle,
53  const std::vector<double> & fixedCenter = std::vector<double>(3, 0.0));
54 
56  operator=(const VersorTransform &);
57 
59  std::string
60  GetName() const override
61  {
62  return std::string("VersorTransform");
63  }
64 
66  SITK_RETURN_SELF_TYPE_HEADER
67  SetCenter(const std::vector<double> & params);
68  std::vector<double>
69  GetCenter() const;
70 
71 
73  SITK_RETURN_SELF_TYPE_HEADER
74  SetRotation(const std::vector<double> & versor);
75  SITK_RETURN_SELF_TYPE_HEADER
76  SetRotation(const std::vector<double> & axis, double angle);
77  std::vector<double>
78  GetVersor() const;
79 
81  std::vector<double>
82  GetMatrix() const;
83  SITK_RETURN_SELF_TYPE_HEADER
84  SetMatrix(const std::vector<double> & matrix, double tolerance = 1e-10);
85 
86 protected:
87  void
88  SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
89 
90 private:
91  void
92  InternalInitialization(itk::TransformBase * transform);
93 
94  template <typename TransformType>
95  void
96  InternalInitialization(TransformType * transform);
97 
98 
99  std::function<void(const std::vector<double> &)> m_pfSetCenter;
100  std::function<std::vector<double>()> m_pfGetCenter;
101  std::function<void(const std::vector<double> &)> m_pfSetRotation1;
102  std::function<void(const std::vector<double> &, double)> m_pfSetRotation2;
103  std::function<std::vector<double>()> m_pfGetVersor;
104  std::function<std::vector<double>()> m_pfGetMatrix;
105  std::function<void(const std::vector<double> &, double)> m_pfSetMatrix;
106 };
107 } // namespace itk::simple
108 
109 #endif // sitkVersorTransform_h
itk::simple::Transform
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:86
sitkCommon.h
itk::simple::VersorTransform::GetName
std::string GetName() const override
Definition: sitkVersorTransform.h:60
itk::simple::VersorTransform::m_pfSetRotation1
std::function< void(const std::vector< double > &)> m_pfSetRotation1
Definition: sitkVersorTransform.h:101
itk::simple::VersorTransform::m_pfSetRotation2
std::function< void(const std::vector< double > &, double)> m_pfSetRotation2
Definition: sitkVersorTransform.h:102
SITKCommon_EXPORT
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
itk::simple::VersorTransform::m_pfGetCenter
std::function< std::vector< double >)> m_pfGetCenter
Definition: sitkVersorTransform.h:100
itk::simple::VersorTransform::m_pfSetMatrix
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
Definition: sitkVersorTransform.h:105
sitkTransform.h
itk::simple::VersorTransform::m_pfGetMatrix
std::function< std::vector< double >)> m_pfGetMatrix
Definition: sitkVersorTransform.h:104
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::VersorTransform::m_pfGetVersor
std::function< std::vector< double >)> m_pfGetVersor
Definition: sitkVersorTransform.h:103
itk::simple::VersorTransform
A 3D rotation transform with rotation as a versor around a fixed center.
Definition: sitkVersorTransform.h:33
itk::simple::VersorTransform::m_pfSetCenter
std::function< void(const std::vector< double > &)> m_pfSetCenter
Definition: sitkVersorTransform.h:99
itk::TransformBaseTemplate
Definition: sitkTransform.h:32