ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkScalableAffineTransform.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 itkScalableAffineTransform_h
19 #define itkScalableAffineTransform_h
20 
21 #include "itkAffineTransform.h"
22 
23 namespace itk
24 {
33 template<
34  typename TParametersValueType=double,
35  unsigned int NDimensions = 3>
36 class ITK_TEMPLATE_EXPORT ScalableAffineTransform:
37  public AffineTransform<TParametersValueType, NDimensions>
38 {
39 public:
45 
48 
50  itkNewMacro(Self);
51 
53  itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions);
54  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions);
55  itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
56  itkStaticConstMacro( ParametersDimension, unsigned int,
57  NDimensions * ( NDimensions + 1 ) );
59 
61  typedef typename Superclass::ParametersType ParametersType;
62  typedef typename Superclass::ParametersValueType ParametersValueType;
63  typedef typename Superclass::FixedParametersType FixedParametersType;
64  typedef typename Superclass::FixedParametersValueType FixedParametersValueType;
65  typedef typename Superclass::JacobianType JacobianType;
66  typedef typename Superclass::ScalarType ScalarType;
68  typedef typename Superclass::OutputVectorType OutputVectorType;
69  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
70  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
71  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
72  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
73  typedef typename Superclass::InputPointType InputPointType;
74  typedef typename Superclass::OutputPointType OutputPointType;
75  typedef typename Superclass::MatrixType MatrixType;
76  typedef typename Superclass::MatrixValueType MatrixValueType;
77  typedef typename Superclass::InverseMatrixType InverseMatrixType;
78  typedef typename Superclass::CenterType CenterType;
79  typedef typename Superclass::OffsetType OffsetType;
80  typedef typename Superclass::TranslationType TranslationType;
81 
84  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
85  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
86 
90  void SetIdentity(void) ITK_OVERRIDE;
91 
93  virtual void SetScale(const InputVectorType & scale);
94 
95  virtual void SetScaleComponent(const InputVectorType & scale)
96  { this->SetScale(scale); }
97 
99  virtual void SetScale(const double scale[NDimensions]);
100 
101  virtual void SetScaleComponent(const double scale[NDimensions])
102  { this->SetScale(scale); }
103 
105  virtual const double * GetScale() const
106  { return m_Scale; }
107  virtual const double * GetScaleComponent() const
108  { return m_Scale; }
110 
112  bool GetInverse(Self *inverse) const;
113 
115  virtual InverseTransformBasePointer GetInverseTransform() const ITK_OVERRIDE;
116 
120  itkLegacyMacro(void SetMatrixComponent(const MatrixType & matrix));
121 
124  itkLegacyMacro(const MatrixType & GetMatrixComponent() const);
125 
128  itkLegacyMacro(void SetOffsetComponent(const OffsetType & offset) );
129 
132  itkLegacyMacro(const OffsetType & GetOffsetComponent(void) const );
133 
134 protected:
142  ScalableAffineTransform(const MatrixType & matrix,
143  const OutputVectorType & offset);
144  ScalableAffineTransform(unsigned int outputSpaceDimension,
145  unsigned int parametersDimension);
146  ScalableAffineTransform(unsigned int parametersDimension);
149 
150  void ComputeMatrix() ITK_OVERRIDE;
151 
153  virtual ~ScalableAffineTransform() ITK_OVERRIDE;
154 
156  void PrintSelf(std::ostream & s, Indent indent) const ITK_OVERRIDE;
157 
158  void SetVarScale(const double *scale)
159  { for ( int i = 0; i < InputSpaceDimension; i++ ) { m_Scale[i] = scale[i]; } }
160 
161 private:
162 
163  ScalableAffineTransform(const Self & other);
164  const Self & operator=(const Self &);
165 
166  double m_Scale[NDimensions];
168 }; //class ScalableAffineTransform
169 } // namespace itk
170 
171 #ifndef ITK_MANUAL_INSTANTIATION
172 #include "itkScalableAffineTransform.hxx"
173 #endif
174 
175 #endif /* itkScalableAffineTransform_h */
InverseTransformBaseType::Pointer InverseTransformBasePointer
Superclass::ParametersType ParametersType
Light weight base class for most itk classes.
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::ParametersValueType ParametersValueType
Superclass::InverseMatrixType InverseMatrixType
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::InputPointType InputPointType
Superclass::TranslationType TranslationType
Superclass::InputVectorType InputVectorType
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::OutputVectorType OutputVectorType
virtual const double * GetScale() const
Superclass::OutputPointType OutputPointType
Superclass::InverseTransformBaseType InverseTransformBaseType
Superclass::JacobianType JacobianType
AffineTransform< TParametersValueType, NDimensions > Superclass
Superclass::InputVnlVectorType InputVnlVectorType
virtual const double * GetScaleComponent() const
Superclass::FixedParametersType FixedParametersType
virtual void SetScaleComponent(const double scale[NDimensions])
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< const Self > ConstPointer
Superclass::FixedParametersValueType FixedParametersValueType
Affine transformation with a specified center of rotation.
Superclass::InputVectorType InputVectorType
Superclass::MatrixValueType MatrixValueType