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  : public Transform
35 {
36 public:
39 
40 ~Euler3DTransform() override;
41 
42 // construct identity
44 
45 explicit Euler3DTransform(const std::vector<double> &fixedCenter,
46  double angleX=0.0,
47  double angleY=0.0,
48  double angleZ=0.0,
49  const std::vector<double> &translation = std::vector<double>(3,0.0) );
50 
52 
53 explicit Euler3DTransform( const Transform & );
54 
55 Euler3DTransform &operator=( const Euler3DTransform & );
56 
58 std::string GetName() const override { return std::string ("Euler3DTransform"); }
59 
61 SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
62 std::vector<double> GetCenter( ) const;
63 
64 double GetAngleX () const;
65 double GetAngleY () const;
66 double GetAngleZ () const;
67 
69 SITK_RETURN_SELF_TYPE_HEADER SetRotation (double angleX, double angleY, double angleZ);
70 
71 std::vector<double> GetTranslation( ) const;
72 SITK_RETURN_SELF_TYPE_HEADER SetTranslation( const std::vector<double>& translation);
73 
74 SITK_RETURN_SELF_TYPE_HEADER SetComputeZYX (bool _arg);
75 bool GetComputeZYX () const;
76 SITK_RETURN_SELF_TYPE_HEADER ComputeZYXOn () {return this->SetComputeZYX(true);}
77 SITK_RETURN_SELF_TYPE_HEADER ComputeZYXOff () {return this->SetComputeZYX(false);}
78 
79 
81  std::vector<double> GetMatrix() const;
82  SITK_RETURN_SELF_TYPE_HEADER SetMatrix(const std::vector<double> &matrix, double tolerance = 1e-10);
83 
84 protected:
85 
86 void SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform ) override;
87 
88 private:
89 
90 void InternalInitialization(itk::TransformBase *transform);
91 
92 template <typename TransformType>
93 void InternalInitialization(TransformType *transform);
94 
95 
96 std::function<void(const std::vector<double>&)> m_pfSetCenter;
97 std::function<std::vector<double>()> m_pfGetCenter;
98 std::function<void(double,double,double)> m_pfSetRotation;
99 std::function<double()> m_pfGetAngleX;
100 std::function<double()> m_pfGetAngleY;
101 std::function<double()> m_pfGetAngleZ;
102 std::function<void(const std::vector<double>&)> m_pfSetTranslation;
103 std::function<std::vector<double>()> m_pfGetTranslation;
104 std::function<void(bool)> m_pfSetComputeZYX;
105 std::function<bool()> m_pfGetComputeZYX;
106 std::function<std::vector<double>()> m_pfGetMatrix;
107 std::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
108 
109 
110 };
111 
112 }
113 
114 #endif // sitkEuler3DTransform_h
itk::simple::Euler3DTransform::m_pfGetCenter
std::function< std::vector< double >)> m_pfGetCenter
Definition: sitkEuler3DTransform.h:97
itk::simple::Euler3DTransform::ComputeZYXOn
Self & ComputeZYXOn()
Definition: sitkEuler3DTransform.h:76
itk::simple::Euler3DTransform::m_pfGetAngleY
std::function< double()> m_pfGetAngleY
Definition: sitkEuler3DTransform.h:100
itk::simple::Euler3DTransform::GetName
std::string GetName() const override
Definition: sitkEuler3DTransform.h:58
itk::simple::Transform
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:81
itk::simple::Euler3DTransform::ComputeZYXOff
Self & ComputeZYXOff()
Definition: sitkEuler3DTransform.h:77
sitkCommon.h
itk::simple::Euler3DTransform::m_pfSetComputeZYX
std::function< void(bool)> m_pfSetComputeZYX
Definition: sitkEuler3DTransform.h:104
itk::simple::Euler3DTransform::m_pfGetAngleZ
std::function< double()> m_pfGetAngleZ
Definition: sitkEuler3DTransform.h:101
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:107
itk::simple::Euler3DTransform::m_pfSetCenter
std::function< void(const std::vector< double > &)> m_pfSetCenter
Definition: sitkEuler3DTransform.h:96
itk::simple::Euler3DTransform::m_pfGetComputeZYX
std::function< bool()> m_pfGetComputeZYX
Definition: sitkEuler3DTransform.h:105
itk::simple::Euler3DTransform::m_pfSetRotation
std::function< void(double, double, double)> m_pfSetRotation
Definition: sitkEuler3DTransform.h:98
sitkTransform.h
itk::simple::Euler3DTransform::m_pfSetTranslation
std::function< void(const std::vector< double > &)> m_pfSetTranslation
Definition: sitkEuler3DTransform.h:102
itk::simple::Euler3DTransform::m_pfGetMatrix
std::function< std::vector< double >)> m_pfGetMatrix
Definition: sitkEuler3DTransform.h:106
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:103
itk::simple::Euler3DTransform::m_pfGetAngleX
std::function< double()> m_pfGetAngleX
Definition: sitkEuler3DTransform.h:99
itk::TransformBaseTemplate
Definition: sitkTransform.h:30