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