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