SimpleITK  1.0.1
sitkEuler3DTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
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 
35  : public Transform
36 {
37 public:
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 
54 Euler3DTransform &operator=( const Euler3DTransform & );
55 
57 std::string GetName() const { return std::string ("Euler3DTransform"); }
58 
60 SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
61 std::vector<double> GetCenter( ) const;
62 
63 double GetAngleX () const;
64 double GetAngleY () const;
65 double GetAngleZ () const;
66 
68 SITK_RETURN_SELF_TYPE_HEADER SetRotation (double angleX, double angleY, double angleZ);
69 
70 std::vector<double> GetTranslation( ) const;
71 SITK_RETURN_SELF_TYPE_HEADER SetTranslation( const std::vector<double>& translation);
72 
73 SITK_RETURN_SELF_TYPE_HEADER SetComputeZYX (bool _arg);
74 bool GetComputeZYX () const;
75 SITK_RETURN_SELF_TYPE_HEADER ComputeZYXOn () {return this->SetComputeZYX(true);}
76 SITK_RETURN_SELF_TYPE_HEADER ComputeZYXOff () {return this->SetComputeZYX(false);}
77 
78 
80  std::vector<double> GetMatrix() const;
81  SITK_RETURN_SELF_TYPE_HEADER SetMatrix(const std::vector<double> &matrix, double tolerance = 1e-10);
82 
83 protected:
84 
85 virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
86 
87 private:
88 
89 using Superclass::AddTransform;
90 
91 void InternalInitialization(itk::TransformBase *transform);
92 
93 template <typename TransformType>
94 void InternalInitialization(TransformType *transform);
95 
96 
97 nsstd::function<void(const std::vector<double>&)> m_pfSetCenter;
98 nsstd::function<std::vector<double>()> m_pfGetCenter;
99 nsstd::function<void(double,double,double)> m_pfSetRotation;
100 nsstd::function<double()> m_pfGetAngleX;
101 nsstd::function<double()> m_pfGetAngleY;
102 nsstd::function<double()> m_pfGetAngleZ;
103 nsstd::function<void(const std::vector<double>&)> m_pfSetTranslation;
104 nsstd::function<std::vector<double>()> m_pfGetTranslation;
105 nsstd::function<void(bool)> m_pfSetComputeZYX;
106 nsstd::function<bool()> m_pfGetComputeZYX;
107 nsstd::function<std::vector<double>()> m_pfGetMatrix;
108 nsstd::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
109 
110 
111 };
112 
113 }
114 }
115 
116 #endif // sitkEuler3DTransform_h
nsstd::function< void(double, double, double)> m_pfSetRotation
nsstd::function< double()> m_pfGetAngleY
A rigid 3D transform with rotation in radians around a fixed center with translation.
nsstd::function< void(bool)> m_pfSetComputeZYX
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:83
nsstd::function< bool()> m_pfGetComputeZYX
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
nsstd::function< double()> m_pfGetAngleX
nsstd::function< double()> m_pfGetAngleZ