SimpleITK  
sitkEuler2DTransform.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 sitkEuler2DTransform_h
19#define sitkEuler2DTransform_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 Euler2DTransform(const std::vector<double> & fixedCenter,
45 double angle = 0.0,
46 const std::vector<double> & translation = std::vector<double>(2, 0.0));
47
49
50 explicit Euler2DTransform(const Transform &);
51
54
56 std::string
57 GetName() const override
58 {
59 return std::string("Euler2DTransform");
60 }
61
63 SITK_RETURN_SELF_TYPE_HEADER
64 SetCenter(const std::vector<double> & params);
65 std::vector<double>
66 GetCenter() const;
67
69 SITK_RETURN_SELF_TYPE_HEADER
70 SetAngle(double angle);
71 double
72 GetAngle() const;
73
74 std::vector<double>
76 SITK_RETURN_SELF_TYPE_HEADER
77 SetTranslation(const std::vector<double> & translation);
78
80 std::vector<double>
81 GetMatrix() const;
82 SITK_RETURN_SELF_TYPE_HEADER
83 SetMatrix(const std::vector<double> & matrix, double tolerance = 1e-10);
84
85protected:
86 void
87 SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
88
89private:
90 void
92
93 template <typename TransformType>
94 void
95 InternalInitialization(TransformType * transform);
96
97 std::function<void(const std::vector<double> &)> m_pfSetCenter;
98 std::function<std::vector<double>()> m_pfGetCenter;
99 std::function<void(double)> m_pfSetAngle;
100 std::function<double()> m_pfGetAngle;
101 std::function<void(const std::vector<double> &)> m_pfSetTranslation;
102 std::function<std::vector<double>()> m_pfGetTranslation;
103 std::function<std::vector<double>()> m_pfGetMatrix;
104 std::function<void(const std::vector<double> &, double)> m_pfSetMatrix;
105};
106
107} // namespace itk::simple
108
109#endif // sitkEuler2DTransform_h
Self & SetAngle(double angle)
Euler2DTransform(const Euler2DTransform &)
Self & SetCenter(const std::vector< double > &params)
std::function< std::vector< double >()> m_pfGetTranslation
std::function< void(const std::vector< double > &)> m_pfSetCenter
std::function< double()> m_pfGetAngle
Self & SetMatrix(const std::vector< double > &matrix, double tolerance=1e-10)
void InternalInitialization(TransformType *transform)
std::vector< double > GetCenter() const
std::vector< double > GetMatrix() const
Euler2DTransform(const Transform &)
std::string GetName() const override
Euler2DTransform & operator=(const Euler2DTransform &)
std::vector< double > GetTranslation() const
std::function< std::vector< double >()> m_pfGetCenter
std::function< void(const std::vector< double > &)> m_pfSetTranslation
std::function< void(double)> m_pfSetAngle
void InternalInitialization(itk::TransformBase *transform)
Euler2DTransform(const std::vector< double > &fixedCenter, double angle=0.0, const std::vector< double > &translation=std::vector< double >(2, 0.0))
void SetPimpleTransform(std::unique_ptr< PimpleTransformBase > &&pimpleTransform) override
Self & SetTranslation(const std::vector< double > &translation)
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
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