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 SITK_RETURN_SELF_TYPE_HEADER
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 SITK_RETURN_SELF_TYPE_HEADER
79 SetRotation(double angleX, double angleY, double angleZ);
80
81 std::vector<double>
83 SITK_RETURN_SELF_TYPE_HEADER
84 SetTranslation(const std::vector<double> & translation);
85
86 SITK_RETURN_SELF_TYPE_HEADER
87 SetComputeZYX(bool _arg);
88 bool
90 SITK_RETURN_SELF_TYPE_HEADER
91 ComputeZYXOn() { return this->SetComputeZYX(true); }
92 SITK_RETURN_SELF_TYPE_HEADER
93 ComputeZYXOff() { return this->SetComputeZYX(false); }
94
95
97 std::vector<double>
98 GetMatrix() const;
99 SITK_RETURN_SELF_TYPE_HEADER
100 SetMatrix(const std::vector<double> & matrix, double tolerance = 1e-10);
101
102protected:
103 void
104 SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
105
106private:
107 void
109
110 template <typename TransformType>
111 void
112 InternalInitialization(TransformType * transform);
113
114
115 std::function<void(const std::vector<double> &)> m_pfSetCenter;
116 std::function<std::vector<double>()> m_pfGetCenter;
117 std::function<void(double, double, double)> m_pfSetRotation;
118 std::function<double()> m_pfGetAngleX;
119 std::function<double()> m_pfGetAngleY;
120 std::function<double()> m_pfGetAngleZ;
121 std::function<void(const std::vector<double> &)> m_pfSetTranslation;
122 std::function<std::vector<double>()> m_pfGetTranslation;
123 std::function<void(bool)> m_pfSetComputeZYX;
124 std::function<bool()> m_pfGetComputeZYX;
125 std::function<std::vector<double>()> m_pfGetMatrix;
126 std::function<void(const std::vector<double> &, double)> m_pfSetMatrix;
127};
128
129} // namespace itk::simple
130
131#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
Self & SetComputeZYX(bool _arg)
Self & SetRotation(double angleX, double angleY, double angleZ)
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
Self & SetTranslation(const std::vector< double > &translation)
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
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
std::string GetName() const override
Self & SetMatrix(const std::vector< double > &matrix, double tolerance=1e-10)
Self & SetCenter(const std::vector< double > &params)
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