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