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 
24 namespace itk::simple
25 {
26 
34 {
35 public:
38 
39  ~Euler3DTransform() override;
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 
55  operator=(const Euler3DTransform &);
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>
82  GetTranslation() const;
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
89  GetComputeZYX() const;
90  SITK_RETURN_SELF_TYPE_HEADER
92  {
93  return this->SetComputeZYX(true);
94  }
95  SITK_RETURN_SELF_TYPE_HEADER
97  {
98  return this->SetComputeZYX(false);
99  }
100 
101 
103  std::vector<double>
104  GetMatrix() const;
105  SITK_RETURN_SELF_TYPE_HEADER
106  SetMatrix(const std::vector<double> & matrix, double tolerance = 1e-10);
107 
108 protected:
109  void
110  SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
111 
112 private:
113  void
114  InternalInitialization(itk::TransformBase * transform);
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
itk::simple::Euler3DTransform::m_pfGetCenter
std::function< std::vector< double >)> m_pfGetCenter
Definition: sitkEuler3DTransform.h:122
itk::simple::Euler3DTransform::ComputeZYXOn
Self & ComputeZYXOn()
Definition: sitkEuler3DTransform.h:91
itk::simple::Euler3DTransform::m_pfGetAngleY
std::function< double()> m_pfGetAngleY
Definition: sitkEuler3DTransform.h:125
itk::simple::Euler3DTransform::GetName
std::string GetName() const override
Definition: sitkEuler3DTransform.h:59
itk::simple::Transform
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:86
itk::simple::Euler3DTransform::ComputeZYXOff
Self & ComputeZYXOff()
Definition: sitkEuler3DTransform.h:96
sitkCommon.h
itk::simple::Euler3DTransform::m_pfSetComputeZYX
std::function< void(bool)> m_pfSetComputeZYX
Definition: sitkEuler3DTransform.h:129
itk::simple::Euler3DTransform::m_pfSetRotation
std::function< void(double, double, double)> m_pfSetRotation
Definition: sitkEuler3DTransform.h:123
itk::simple::Euler3DTransform::m_pfGetAngleZ
std::function< double()> m_pfGetAngleZ
Definition: sitkEuler3DTransform.h:126
SITKCommon_EXPORT
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
itk::simple::Euler3DTransform::m_pfSetMatrix
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
Definition: sitkEuler3DTransform.h:132
itk::simple::Euler3DTransform::m_pfSetTranslation
std::function< void(const std::vector< double > &)> m_pfSetTranslation
Definition: sitkEuler3DTransform.h:127
itk::simple::Euler3DTransform::m_pfGetComputeZYX
std::function< bool()> m_pfGetComputeZYX
Definition: sitkEuler3DTransform.h:130
sitkTransform.h
itk::simple::Euler3DTransform::m_pfGetMatrix
std::function< std::vector< double >)> m_pfGetMatrix
Definition: sitkEuler3DTransform.h:131
itk::simple::Euler3DTransform
A rigid 3D transform with rotation in radians around a fixed center with translation.
Definition: sitkEuler3DTransform.h:33
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::Euler3DTransform::m_pfGetTranslation
std::function< std::vector< double >)> m_pfGetTranslation
Definition: sitkEuler3DTransform.h:128
itk::simple::Euler3DTransform::m_pfGetAngleX
std::function< double()> m_pfGetAngleX
Definition: sitkEuler3DTransform.h:124
itk::TransformBaseTemplate
Definition: sitkTransform.h:32
itk::simple::Euler3DTransform::m_pfSetCenter
std::function< void(const std::vector< double > &)> m_pfSetCenter
Definition: sitkEuler3DTransform.h:121