SimpleITK  
sitkEuler3DTransform.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 sitkEuler3DTransform_h
19#define sitkEuler3DTransform_h
20
21#include "sitkCommon.h"
22#include "sitkTransform.h"
23
24namespace itk::simple
25{
26
34{
35public:
38
40
41 // construct identity
43
44 explicit Euler3DTransform(const std::vector<double> & fixedCenter,
45 double angleX = 0.0,
46 double angleY = 0.0,
47 double angleZ = 0.0,
48 const std::vector<double> & translation = std::vector<double>(3, 0.0));
49
51
52 explicit Euler3DTransform(const Transform &);
53
56
58 std::string
59 GetName() const override
60 {
61 return std::string("Euler3DTransform");
62 }
63
65 void
66 SetCenter(const std::vector<double> & params);
67 std::vector<double>
68 GetCenter() const;
69
70 double
71 GetAngleX() const;
72 double
73 GetAngleY() const;
74 double
75 GetAngleZ() const;
76
78 void
79 SetRotation(double angleX, double angleY, double angleZ);
80
81 std::vector<double>
83 void
84 SetTranslation(const std::vector<double> & translation);
85
86 void
87 SetComputeZYX(bool _arg);
88 bool
90 void
92 {
93 return this->SetComputeZYX(true);
94 }
95 void
97 {
98 return this->SetComputeZYX(false);
99 }
100
101
103 std::vector<double>
104 GetMatrix() const;
105 void
106 SetMatrix(const std::vector<double> & matrix, double tolerance = 1e-10);
107
108protected:
109 void
110 SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
111
112private:
113 void
115
116 template <typename TransformType>
117 void
118 InternalInitialization(TransformType * transform);
119
120
121 std::function<void(const std::vector<double> &)> m_pfSetCenter;
122 std::function<std::vector<double>()> m_pfGetCenter;
123 std::function<void(double, double, double)> m_pfSetRotation;
124 std::function<double()> m_pfGetAngleX;
125 std::function<double()> m_pfGetAngleY;
126 std::function<double()> m_pfGetAngleZ;
127 std::function<void(const std::vector<double> &)> m_pfSetTranslation;
128 std::function<std::vector<double>()> m_pfGetTranslation;
129 std::function<void(bool)> m_pfSetComputeZYX;
130 std::function<bool()> m_pfGetComputeZYX;
131 std::function<std::vector<double>()> m_pfGetMatrix;
132 std::function<void(const std::vector<double> &, double)> m_pfSetMatrix;
133};
134
135} // namespace itk::simple
136
137#endif // sitkEuler3DTransform_h
std::function< double()> m_pfGetAngleY
std::function< void(double, double, double)> m_pfSetRotation
std::function< std::vector< double >()> m_pfGetTranslation
Euler3DTransform(const Euler3DTransform &)
std::vector< double > GetTranslation() const
void SetMatrix(const std::vector< double > &matrix, double tolerance=1e-10)
void InternalInitialization(TransformType *transform)
std::function< std::vector< double >()> m_pfGetCenter
std::function< double()> m_pfGetAngleZ
std::function< bool()> m_pfGetComputeZYX
std::function< void(const std::vector< double > &)> m_pfSetTranslation
void SetRotation(double angleX, double angleY, double angleZ)
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
void SetTranslation(const std::vector< double > &translation)
Euler3DTransform(const Transform &)
Euler3DTransform(const std::vector< double > &fixedCenter, double angleX=0.0, double angleY=0.0, double angleZ=0.0, const std::vector< double > &translation=std::vector< double >(3, 0.0))
std::vector< double > GetMatrix() const
Euler3DTransform & operator=(const Euler3DTransform &)
std::function< void(const std::vector< double > &)> m_pfSetCenter
void InternalInitialization(itk::TransformBase *transform)
std::function< void(bool)> m_pfSetComputeZYX
void SetPimpleTransform(std::unique_ptr< PimpleTransformBase > &&pimpleTransform) override
void SetCenter(const std::vector< double > &params)
std::string GetName() const override
std::vector< double > GetCenter() const
std::function< double()> m_pfGetAngleX
std::function< std::vector< double >()> m_pfGetMatrix
Transform()
By default a 3-d identity transform is constructed.
TransformBaseTemplate< double > TransformBase
#define SITKCommon_EXPORT
Definition sitkCommon.h:41