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 
24 namespace itk::simple
25 {
26 
34 {
35 public:
38 
39  ~Euler2DTransform() override;
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 
53  operator=(const Euler2DTransform &);
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>
75  GetTranslation() const;
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 
85 protected:
86  void
87  SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
88 
89 private:
90  void
91  InternalInitialization(itk::TransformBase * transform);
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
itk::simple::Transform
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:86
itk::simple::Euler2DTransform::m_pfGetTranslation
std::function< std::vector< double >)> m_pfGetTranslation
Definition: sitkEuler2DTransform.h:102
itk::simple::Euler2DTransform::GetName
std::string GetName() const override
Definition: sitkEuler2DTransform.h:57
itk::simple::Euler2DTransform::m_pfGetAngle
std::function< double()> m_pfGetAngle
Definition: sitkEuler2DTransform.h:100
sitkCommon.h
itk::simple::Euler2DTransform::m_pfSetAngle
std::function< void(double)> m_pfSetAngle
Definition: sitkEuler2DTransform.h:99
itk::simple::Euler2DTransform::m_pfSetTranslation
std::function< void(const std::vector< double > &)> m_pfSetTranslation
Definition: sitkEuler2DTransform.h:101
itk::simple::Euler2DTransform
A rigid 2D transform with rotation in radians around a fixed center with translation.
Definition: sitkEuler2DTransform.h:33
itk::simple::Euler2DTransform::m_pfSetCenter
std::function< void(const std::vector< double > &)> m_pfSetCenter
Definition: sitkEuler2DTransform.h:97
SITKCommon_EXPORT
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
itk::simple::Euler2DTransform::m_pfGetCenter
std::function< std::vector< double >)> m_pfGetCenter
Definition: sitkEuler2DTransform.h:98
itk::simple::Euler2DTransform::m_pfGetMatrix
std::function< std::vector< double >)> m_pfGetMatrix
Definition: sitkEuler2DTransform.h:103
sitkTransform.h
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::TransformBaseTemplate
Definition: sitkTransform.h:32
itk::simple::Euler2DTransform::m_pfSetMatrix
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
Definition: sitkEuler2DTransform.h:104