ITK  4.6.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 TScalar = double, // Data type for scalars (e.g. float or double)
35  unsigned int NDimensions = 3 >
36 // Number of dimensions in the input space
38  public AffineTransform< TScalar, NDimensions >
39 {
40 public:
46 
49 
51  itkNewMacro(Self);
52 
54  itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions);
55  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions);
56  itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
57  itkStaticConstMacro( ParametersDimension, unsigned int,
58  NDimensions * ( NDimensions + 1 ) );
60 
80 
84  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
85 
89  void SetIdentity(void);
90 
92  virtual void SetScale(const InputVectorType & scale);
93 
94  virtual void SetScaleComponent(const InputVectorType & scale)
95  { this->SetScale(scale); }
96 
98  virtual void SetScale(const double scale[NDimensions]);
99 
100  virtual void SetScaleComponent(const double scale[NDimensions])
101  { this->SetScale(scale); }
102 
104  virtual const double * GetScale() const
105  { return m_Scale; }
106  virtual const double * GetScaleComponent() const
107  { return m_Scale; }
109 
111  bool GetInverse(Self *inverse) const;
112 
115 
119  itkLegacyMacro(void SetMatrixComponent(const MatrixType & matrix));
120 
123  itkLegacyMacro(const MatrixType & GetMatrixComponent() const);
124 
127  itkLegacyMacro(void SetOffsetComponent(const OffsetType & offset) );
128 
131  itkLegacyMacro(const OffsetType & GetOffsetComponent(void) const );
132 
133 protected:
141  ScalableAffineTransform(const MatrixType & matrix,
142  const OutputVectorType & offset);
143  ScalableAffineTransform(unsigned int outputSpaceDimension,
144  unsigned int parametersDimension);
145  ScalableAffineTransform(unsigned int parametersDimension);
148 
149  void ComputeMatrix();
150 
152  virtual ~ScalableAffineTransform();
153 
155  void PrintSelf(std::ostream & s, Indent indent) const;
156 
157  void SetVarScale(const double *scale)
158  { for ( int i = 0; i < InputSpaceDimension; i++ ) { m_Scale[i] = scale[i]; } }
159 
160 private:
161 
162  ScalableAffineTransform(const Self & other);
163  const Self & operator=(const Self &);
164 
165  double m_Scale[NDimensions];
167 }; //class ScalableAffineTransform
168 } // namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "itkScalableAffineTransform.hxx"
172 #endif
173 
174 #endif /* __itkScalableAffineTransform_h */
Superclass::InputVnlVectorType InputVnlVectorType
virtual void SetScaleComponent(const InputVectorType &scale)
virtual void SetScaleComponent(const double scale[NDimensions])
InverseTransformBaseType::Pointer InverseTransformBasePointer
Light weight base class for most itk classes.
static const unsigned int InputSpaceDimension
Superclass::ScalarType ScalarType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::ParametersType ParametersType
Superclass::OutputPointType OutputPointType
Superclass::InputCovariantVectorType InputCovariantVectorType
virtual const double * GetScaleComponent() const
Superclass::OutputPointType OutputPointType
Superclass::InputVectorType InputVectorType
Superclass::ParametersValueType ParametersValueType
void SetVarScale(const double *scale)
static const unsigned int ParametersDimension
Superclass::InputPointType InputPointType
Superclass::MatrixValueType MatrixValueType
Superclass::InputPointType InputPointType
Superclass::OutputVnlVectorType OutputVnlVectorType
Superclass::JacobianType JacobianType
Superclass::InputCovariantVectorType InputCovariantVectorType
itkLegacyMacro(void SetMatrixComponent(const MatrixType &matrix))
Superclass::InverseTransformBaseType InverseTransformBaseType
virtual void SetScale(const InputVectorType &scale)
Superclass::InputVnlVectorType InputVnlVectorType
Superclass::InverseMatrixType InverseMatrixType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
bool GetInverse(Self *inverse) const
virtual InverseTransformBasePointer GetInverseTransform() const
void PrintSelf(std::ostream &s, Indent indent) const
virtual const double * GetScale() const
Superclass::OutputVnlVectorType OutputVnlVectorType
const Self & operator=(const Self &)
Superclass::OffsetType OffsetType
Superclass::OutputVectorType OutputVectorType
static const unsigned int SpaceDimension
AffineTransform< TScalar, NDimensions > Superclass
Superclass::TranslationType TranslationType
Superclass::JacobianType JacobianType
SmartPointer< const Self > ConstPointer
Superclass::InverseTransformBaseType InverseTransformBaseType
Superclass::InverseMatrixType InverseMatrixType
Superclass::InputVectorType InputVectorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::ParametersType ParametersType
Superclass::TranslationType TranslationType
static const unsigned int OutputSpaceDimension
Affine transformation with a specified center of rotation.
Superclass::MatrixType MatrixType
Superclass::OutputVectorType OutputVectorType
Superclass::CenterType CenterType