SimpleITK  1.0.1
sitkSimilarity3DTransform.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 sitkSimilarity3DTransform_h
19 #define sitkSimilarity3DTransform_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 
45 
46 explicit Similarity3DTransform( const Transform & );
47 
48 Similarity3DTransform( double scaleFactor, const std::vector< double > &versor,
49  const std::vector< double > &translation=std::vector< double >(3, 0.0),
50  const std::vector< double > &fixedCenter=std::vector< double >(3, 0.0) );
51 
52 Similarity3DTransform( double scaleFactor, const std::vector< double > &axis, double angle,
53  const std::vector< double > &translation=std::vector< double >(3, 0.0),
54  const std::vector< double > &fixedCenter=std::vector< double >(3, 0.0) );
55 
56 Similarity3DTransform &operator=( const Similarity3DTransform & );
57 
59 std::string GetName() const { return std::string ("Similarity3DTransform"); }
60 
62 SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
63 std::vector<double> GetCenter( ) const;
64 
65 
67 SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &versor);
68 SITK_RETURN_SELF_TYPE_HEADER SetRotation(const std::vector<double> &axis, double angle);
69 std::vector<double> GetVersor() const;
70 
71 SITK_RETURN_SELF_TYPE_HEADER SetScale(double scale);
72 double GetScale() const;
73 
74 std::vector<double> GetTranslation( ) const;
75 SITK_RETURN_SELF_TYPE_HEADER SetTranslation(const std::vector<double>& translation);
76 
77 
79 SITK_RETURN_SELF_TYPE_HEADER Translate(const std::vector<double> &offset);
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 nsstd::function<void(const std::vector<double>&)> m_pfSetCenter;
97 nsstd::function<std::vector<double>()> m_pfGetCenter;
98 nsstd::function<void(const std::vector<double>&)> m_pfSetRotation1;
99 nsstd::function<void(const std::vector<double>,double&)> m_pfSetRotation2;
100 nsstd::function<std::vector<double>()> m_pfGetVersor;
101 nsstd::function<void(double)> m_pfSetScale;
102 nsstd::function<double()> m_pfGetScale;
103 nsstd::function<void(const std::vector<double>&)> m_pfSetTranslation;
104 nsstd::function<std::vector<double>()> m_pfGetTranslation;
105 nsstd::function<void(const std::vector<double> &)> m_pfTranslate;
106 nsstd::function<std::vector<double>()> m_pfGetMatrix;
107 nsstd::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
108 };
109 
110 }
111 }
112 
113 #endif // sitkSimilarity3DTransform_h
A similarity 3D transform with rotation as a versor, and isotropic scaling around a fixed center with...
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:83
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
nsstd::function< void(double)> m_pfSetScale