SimpleITK  
sitkEuler2DTransform.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 sitkEuler2DTransform_h
19 #define sitkEuler2DTransform_h
20 
21 #include "sitkCommon.h"
22 #include "sitkTransform.h"
23 
24 namespace itk::simple
25 {
26 
34  : public Transform
35 {
36 public:
39 
40  ~Euler2DTransform() override;
41 
42  // construct identity
44 
45  explicit Euler2DTransform(const std::vector<double> &fixedCenter,
46  double angle=0.0,
47  const std::vector<double> &translation = std::vector<double>(2,0.0) );
48 
50 
51  explicit Euler2DTransform( const Transform & );
52 
53  Euler2DTransform &operator=( const Euler2DTransform & );
54 
56  std::string GetName() const override { return std::string ("Euler2DTransform"); }
57 
59  SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
60  std::vector<double> GetCenter( ) const;
61 
63  SITK_RETURN_SELF_TYPE_HEADER SetAngle (double angle);
64  double GetAngle () const;
65 
66  std::vector<double> GetTranslation( ) const;
67  SITK_RETURN_SELF_TYPE_HEADER SetTranslation(const std::vector<double>& translation);
68 
70  std::vector<double> GetMatrix() const;
71  SITK_RETURN_SELF_TYPE_HEADER SetMatrix(const std::vector<double> &matrix, double tolerance = 1e-10);
72 
73 protected:
74 
75  void SetPimpleTransform(std::unique_ptr<PimpleTransformBase> && pimpleTransform ) override;
76 
77 private:
78 
79  void InternalInitialization(itk::TransformBase *transform);
80 
81  template <typename TransformType>
82  void InternalInitialization(TransformType *transform);
83 
84  std::function<void(const std::vector<double>&)> m_pfSetCenter;
85  std::function<std::vector<double>()> m_pfGetCenter;
86  std::function<void(double)> m_pfSetAngle;
87  std::function<double()> m_pfGetAngle;
88  std::function<void(const std::vector<double>&)> m_pfSetTranslation;
89  std::function<std::vector<double>()> m_pfGetTranslation;
90  std::function<std::vector<double>()> m_pfGetMatrix;
91  std::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
92 
93 };
94 
95 }
96 
97 #endif // sitkEuler2DTransform_h
itk::simple::Transform
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:81
itk::simple::Euler2DTransform::m_pfGetTranslation
std::function< std::vector< double >)> m_pfGetTranslation
Definition: sitkEuler2DTransform.h:89
itk::simple::Euler2DTransform::GetName
std::string GetName() const override
Definition: sitkEuler2DTransform.h:56
itk::simple::Euler2DTransform::m_pfGetAngle
std::function< double()> m_pfGetAngle
Definition: sitkEuler2DTransform.h:87
sitkCommon.h
itk::simple::Euler2DTransform::m_pfSetAngle
std::function< void(double)> m_pfSetAngle
Definition: sitkEuler2DTransform.h:86
itk::simple::Euler2DTransform
A rigid 2D transform with rotation in radians around a fixed center with translation.
Definition: sitkEuler2DTransform.h:33
SITKCommon_EXPORT
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
itk::simple::Euler2DTransform::m_pfGetCenter
std::function< std::vector< double >)> m_pfGetCenter
Definition: sitkEuler2DTransform.h:85
itk::simple::Euler2DTransform::m_pfSetMatrix
std::function< void(const std::vector< double > &, double)> m_pfSetMatrix
Definition: sitkEuler2DTransform.h:91
itk::simple::Euler2DTransform::m_pfSetTranslation
std::function< void(const std::vector< double > &)> m_pfSetTranslation
Definition: sitkEuler2DTransform.h:88
itk::simple::Euler2DTransform::m_pfGetMatrix
std::function< std::vector< double >)> m_pfGetMatrix
Definition: sitkEuler2DTransform.h:90
sitkTransform.h
itk::simple::Euler2DTransform::m_pfSetCenter
std::function< void(const std::vector< double > &)> m_pfSetCenter
Definition: sitkEuler2DTransform.h:84
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::TransformBaseTemplate
Definition: sitkTransform.h:30