SimpleITK  
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
24namespace itk::simple
25{
26
34{
35public:
38
40
41 // construct identity
43
45
47
48 Similarity3DTransform(double scaleFactor,
49 const std::vector<double> & versor,
50 const std::vector<double> & translation = std::vector<double>(3, 0.0),
51 const std::vector<double> & fixedCenter = std::vector<double>(3, 0.0));
52
53 Similarity3DTransform(double scaleFactor,
54 const std::vector<double> & axis,
55 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
61
63 std::string
64 GetName() const override
65 {
66 return std::string("Similarity3DTransform");
67 }
68
70 SITK_RETURN_SELF_TYPE_HEADER
71 SetCenter(const std::vector<double> & params);
72 std::vector<double>
73 GetCenter() const;
74
75
77 SITK_RETURN_SELF_TYPE_HEADER
78 SetRotation(const std::vector<double> & versor);
79 SITK_RETURN_SELF_TYPE_HEADER
80 SetRotation(const std::vector<double> & axis, double angle);
81 std::vector<double>
82 GetVersor() const;
83
84 SITK_RETURN_SELF_TYPE_HEADER
85 SetScale(double scale);
86 double
87 GetScale() const;
88
89 std::vector<double>
91 SITK_RETURN_SELF_TYPE_HEADER
92 SetTranslation(const std::vector<double> & translation);
93
94
96 SITK_RETURN_SELF_TYPE_HEADER
97 Translate(const std::vector<double> & offset);
98 std::vector<double>
99 GetMatrix() const;
100 SITK_RETURN_SELF_TYPE_HEADER
101 SetMatrix(const std::vector<double> & matrix, double tolerance = 1e-10);
102
103protected:
104 void
105 SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
106
107private:
108 void
110
111 template <typename TransformType>
112 void
113 InternalInitialization(TransformType * transform);
114
115 std::function<void(const std::vector<double> &)> m_pfSetCenter;
116 std::function<std::vector<double>()> m_pfGetCenter;
117 std::function<void(const std::vector<double> &)> m_pfSetRotation1;
118 std::function<void(const std::vector<double>, double &)> m_pfSetRotation2;
119 std::function<std::vector<double>()> m_pfGetVersor;
120 std::function<void(double)> m_pfSetScale;
121 std::function<double()> m_pfGetScale;
122 std::function<void(const std::vector<double> &)> m_pfSetTranslation;
123 std::function<std::vector<double>()> m_pfGetTranslation;
124 std::function<void(const std::vector<double> &)> m_pfTranslate;
125 std::function<std::vector<double>()> m_pfGetMatrix;
126 std::function<void(const std::vector<double> &, double)> m_pfSetMatrix;
127};
128
129} // namespace itk::simple
130
131#endif // sitkSimilarity3DTransform_h
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
Similarity3DTransform(double scaleFactor, const std::vector< double > &versor, const std::vector< double > &translation=std::vector< double >(3, 0.0), const std::vector< double > &fixedCenter=std::vector< double >(3, 0.0))
Self & SetTranslation(const std::vector< double > &translation)
std::function< void(const std::vector< double >, double &)> m_pfSetRotation2
std::vector< double > GetMatrix() const
Similarity3DTransform & operator=(const Similarity3DTransform &)
Self & Translate(const std::vector< double > &offset)
void InternalInitialization(itk::TransformBase *transform)
std::vector< double > GetVersor() const
std::vector< double > GetTranslation() const
Similarity3DTransform(const Similarity3DTransform &)
std::function< std::vector< double >()> m_pfGetCenter
Self & SetMatrix(const std::vector< double > &matrix, double tolerance=1e-10)
std::function< std::vector< double >()> m_pfGetMatrix
void InternalInitialization(TransformType *transform)
Self & SetRotation(const std::vector< double > &versor)
void SetPimpleTransform(std::unique_ptr< PimpleTransformBase > &&pimpleTransform) override
std::vector< double > GetCenter() const
Similarity3DTransform(double scaleFactor, const std::vector< double > &axis, double angle, const std::vector< double > &translation=std::vector< double >(3, 0.0), const std::vector< double > &fixedCenter=std::vector< double >(3, 0.0))
std::function< void(const std::vector< double > &)> m_pfTranslate
std::function< void(const std::vector< double > &)> m_pfSetTranslation
std::function< std::vector< double >()> m_pfGetVersor
Self & SetRotation(const std::vector< double > &axis, double angle)
Similarity3DTransform(const Transform &)
std::function< void(const std::vector< double > &)> m_pfSetRotation1
Self & SetCenter(const std::vector< double > &params)
std::function< void(const std::vector< double > &)> m_pfSetCenter
std::function< std::vector< double >()> m_pfGetTranslation
Transform()
By default a 3-d identity transform is constructed.
TransformBaseTemplate< double > TransformBase
#define SITKCommon_EXPORT
Definition sitkCommon.h:41