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
24namespace itk::simple
25{
26
34{
35public:
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
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
86protected:
87 void
88 SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
89
90private:
91 void
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
Transform()
By default a 3-d identity transform is constructed.
VersorTransform(const std::vector< double > &versor, const std::vector< double > &fixedCenter=std::vector< double >(3, 0.0))
std::vector< double > GetMatrix() const
void SetPimpleTransform(std::unique_ptr< PimpleTransformBase > &&pimpleTransform) override
std::function< std::vector< double >()> m_pfGetCenter
Self & SetRotation(const std::vector< double > &axis, double angle)
Self & SetCenter(const std::vector< double > &params)
void InternalInitialization(TransformType *transform)
Self & SetMatrix(const std::vector< double > &matrix, double tolerance=1e-10)
std::vector< double > GetVersor() const
std::string GetName() const override
std::function< std::vector< double >()> m_pfGetMatrix
std::vector< double > GetCenter() const
Self & SetRotation(const std::vector< double > &versor)
std::function< void(const std::vector< double > &)> m_pfSetRotation1
std::function< void(const std::vector< double > &)> m_pfSetCenter
VersorTransform(const std::vector< double > &axis, double angle, const std::vector< double > &fixedCenter=std::vector< double >(3, 0.0))
VersorTransform(const VersorTransform &)
std::function< void(const std::vector< double > &, double)> m_pfSetRotation2
VersorTransform(const Transform &)
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
VersorTransform & operator=(const VersorTransform &)
void InternalInitialization(itk::TransformBase *transform)
std::function< std::vector< double >()> m_pfGetVersor
TransformBaseTemplate< double > TransformBase
#define SITKCommon_EXPORT
Definition sitkCommon.h:41