SimpleITK  
sitkScaleVersor3DTransform.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 sitkScaleVersor3DTransform_h
19 #define sitkScaleVersor3DTransform_h
20 
21 #include "sitkCommon.h"
22 #include "sitkTransform.h"
23 
24 namespace itk::simple
25 {
26 
27 
36 {
37 public:
40 
41  ~ScaleVersor3DTransform() override;
42 
43  // construct identity
45 
47 
48  explicit ScaleVersor3DTransform(const Transform &);
49 
50  ScaleVersor3DTransform(const std::vector<double> & scale,
51  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  ScaleVersor3DTransform(const std::vector<double> & scale,
56  const std::vector<double> & axis,
57  double angle,
58  const std::vector<double> & translation = std::vector<double>(3, 0.0),
59  const std::vector<double> & fixedCenter = std::vector<double>(3, 0.0));
60 
62  operator=(const ScaleVersor3DTransform &);
63 
65  std::string
66  GetName() const override
67  {
68  return std::string("ScaleVersor3DTransform");
69  }
70 
72  SITK_RETURN_SELF_TYPE_HEADER
73  SetCenter(const std::vector<double> & params);
74  std::vector<double>
75  GetCenter() const;
76 
77 
79  SITK_RETURN_SELF_TYPE_HEADER
80  SetRotation(const std::vector<double> & versor);
81  SITK_RETURN_SELF_TYPE_HEADER
82  SetRotation(const std::vector<double> & axis, double angle);
83  std::vector<double>
84  GetVersor() const;
85 
86  std::vector<double>
87  GetTranslation() const;
88  SITK_RETURN_SELF_TYPE_HEADER
89  SetTranslation(const std::vector<double> & translation);
90 
91  std::vector<double>
92  GetScale() const;
93  SITK_RETURN_SELF_TYPE_HEADER
94  SetScale(const std::vector<double> & scale);
95 
97  SITK_RETURN_SELF_TYPE_HEADER
98  Translate(const std::vector<double> & offset);
99  std::vector<double>
100  GetMatrix() const;
101 
102 protected:
103  void
104  SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform) override;
105 
106 private:
107  void
108  InternalInitialization(itk::TransformBase * transform);
109 
110  template <typename TransformType>
111  void
112  InternalInitialization(TransformType * transform);
113 
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(const std::vector<double> &)> m_pfSetTranslation;
121  std::function<std::vector<double>()> m_pfGetTranslation;
122  std::function<void(const std::vector<double> &)> m_pfSetScale;
123  std::function<std::vector<double>()> m_pfGetScale;
124  std::function<void(const std::vector<double> &)> m_pfTranslate;
125  std::function<std::vector<double>()> m_pfGetMatrix;
126 };
127 
128 } // namespace itk::simple
129 
130 #endif // sitkVersorTransform_h
itk::simple::ScaleVersor3DTransform::m_pfGetCenter
std::function< std::vector< double >)> m_pfGetCenter
Definition: sitkScaleVersor3DTransform.h:116
itk::simple::Transform
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:86
itk::simple::ScaleVersor3DTransform::m_pfTranslate
std::function< void(const std::vector< double > &)> m_pfTranslate
Definition: sitkScaleVersor3DTransform.h:124
sitkCommon.h
itk::simple::ScaleVersor3DTransform::m_pfSetRotation2
std::function< void(const std::vector< double > &, double)> m_pfSetRotation2
Definition: sitkScaleVersor3DTransform.h:118
itk::simple::ScaleVersor3DTransform::m_pfGetMatrix
std::function< std::vector< double >)> m_pfGetMatrix
Definition: sitkScaleVersor3DTransform.h:125
itk::simple::ScaleVersor3DTransform::m_pfGetScale
std::function< std::vector< double >)> m_pfGetScale
Definition: sitkScaleVersor3DTransform.h:123
SITKCommon_EXPORT
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
itk::simple::ScaleVersor3DTransform::m_pfSetScale
std::function< void(const std::vector< double > &)> m_pfSetScale
Definition: sitkScaleVersor3DTransform.h:122
itk::simple::ScaleVersor3DTransform::m_pfSetRotation1
std::function< void(const std::vector< double > &)> m_pfSetRotation1
Definition: sitkScaleVersor3DTransform.h:117
itk::simple::ScaleVersor3DTransform
A parameterized 3D transform composed of the addition of a versor rotation matrix and a scale matrix ...
Definition: sitkScaleVersor3DTransform.h:35
itk::simple::ScaleVersor3DTransform::GetName
std::string GetName() const override
Definition: sitkScaleVersor3DTransform.h:66
sitkTransform.h
itk::simple::ScaleVersor3DTransform::m_pfGetVersor
std::function< std::vector< double >)> m_pfGetVersor
Definition: sitkScaleVersor3DTransform.h:119
itk::simple::ScaleVersor3DTransform::m_pfSetTranslation
std::function< void(const std::vector< double > &)> m_pfSetTranslation
Definition: sitkScaleVersor3DTransform.h:120
itk::simple::ScaleVersor3DTransform::m_pfSetCenter
std::function< void(const std::vector< double > &)> m_pfSetCenter
Definition: sitkScaleVersor3DTransform.h:115
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::TransformBaseTemplate
Definition: sitkTransform.h:32
itk::simple::ScaleVersor3DTransform::m_pfGetTranslation
std::function< std::vector< double >)> m_pfGetTranslation
Definition: sitkScaleVersor3DTransform.h:121