SimpleITK  1.3.0.dev466
sitkEuler2DTransform.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 sitkEuler2DTransform_h
19 #define sitkEuler2DTransform_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  virtual ~Euler2DTransform();
43 
44  // construct identity
46 
47  explicit Euler2DTransform(const std::vector<double> &fixedCenter,
48  double angle=0.0,
49  const std::vector<double> &translation = std::vector<double>(2,0.0) );
50 
52 
53  explicit Euler2DTransform( const Transform & );
54 
55  Euler2DTransform &operator=( const Euler2DTransform & );
56 
58  std::string GetName() const { return std::string ("Euler2DTransform"); }
59 
61  SITK_RETURN_SELF_TYPE_HEADER SetCenter(const std::vector<double> &params);
62  std::vector<double> GetCenter( ) const;
63 
65  SITK_RETURN_SELF_TYPE_HEADER SetAngle (double angle);
66  double GetAngle () const;
67 
68  std::vector<double> GetTranslation( ) const;
69  SITK_RETURN_SELF_TYPE_HEADER SetTranslation(const std::vector<double>& translation);
70 
72  std::vector<double> GetMatrix() const;
73  SITK_RETURN_SELF_TYPE_HEADER SetMatrix(const std::vector<double> &matrix, double tolerance = 1e-10);
74 
75 protected:
76 
77  virtual void SetPimpleTransform( PimpleTransformBase *pimpleTransform );
78 
79 private:
80 
81  using Superclass::AddTransform;
82 
83  void InternalInitialization(itk::TransformBase *transform);
84 
85  template <typename TransformType>
86  void InternalInitialization(TransformType *transform);
87 
88  nsstd::function<void(const std::vector<double>&)> m_pfSetCenter;
89  nsstd::function<std::vector<double>()> m_pfGetCenter;
90  nsstd::function<void(double)> m_pfSetAngle;
91  nsstd::function<double()> m_pfGetAngle;
92  nsstd::function<void(const std::vector<double>&)> m_pfSetTranslation;
93  nsstd::function<std::vector<double>()> m_pfGetTranslation;
94  nsstd::function<std::vector<double>()> m_pfGetMatrix;
95  nsstd::function<void(const std::vector<double>&, double)> m_pfSetMatrix;
96 
97 };
98 
99 }
100 }
101 
102 #endif // sitkEuler2DTransform_h
nsstd::function< double()> m_pfGetAngle
nsstd::function< void(double)> m_pfSetAngle
A simplified wrapper around a variety of ITK transforms.
Definition: sitkTransform.h:84
A rigid 2D transform with rotation in radians around a fixed center with translation.
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41