SimpleITK  1.2.4
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 
36  : public Transform
37 {
38 public:
41 
42 virtual ~Euler3DTransform();
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 { 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 virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
89 
90 private:
91 
92 using Superclass::AddTransform;
93 
94 void InternalInitialization(itk::TransformBase *transform);
95 
96 template <typename TransformType>
97 void InternalInitialization(TransformType *transform);
98 
99 
100 nsstd::function<void(const std::vector<double>&)> m_pfSetCenter;
101 nsstd::function<std::vector<double>()> m_pfGetCenter;
102 nsstd::function<void(double,double,double)> m_pfSetRotation;
103 nsstd::function<double()> m_pfGetAngleX;
104 nsstd::function<double()> m_pfGetAngleY;
105 nsstd::function<double()> m_pfGetAngleZ;
106 nsstd::function<void(const std::vector<double>&)> m_pfSetTranslation;
107 nsstd::function<std::vector<double>()> m_pfGetTranslation;
108 nsstd::function<void(bool)> m_pfSetComputeZYX;
109 nsstd::function<bool()> m_pfGetComputeZYX;
110 nsstd::function<std::vector<double>()> m_pfGetMatrix;
111 nsstd::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
112 
113 
114 };
115 
116 }
117 }
118 
119 #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:84
nsstd::function< bool()> m_pfGetComputeZYX
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
nsstd::function< double()> m_pfGetAngleX
nsstd::function< double()> m_pfGetAngleZ