go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedRigid2DTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 /*=========================================================================
19 
20  Program: Insight Segmentation & Registration Toolkit
21  Module: $RCSfile: itkAdvancedRigid2DTransform.h,v $
22  Language: C++
23  Date: $Date: 2009-01-14 18:39:05 $
24  Version: $Revision: 1.22 $
25 
26  Copyright (c) Insight Software Consortium. All rights reserved.
27  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
28 
29  This software is distributed WITHOUT ANY WARRANTY; without even
30  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
31  PURPOSE. See the above copyright notices for more information.
32 
33 =========================================================================*/
34 #ifndef __itkAdvancedRigid2DTransform_h
35 #define __itkAdvancedRigid2DTransform_h
36 
37 #include <iostream>
39 #include "itkExceptionObject.h"
40 
41 namespace itk
42 {
43 
74 template< class TScalarType = double >
75 // Data type for scalars (float or double)
77  public AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 > // Dimensions of input and output spaces
78 {
79 public:
80 
85  typedef SmartPointer< const Self > ConstPointer;
86 
89 
91  itkNewMacro( Self );
92 
94  itkStaticConstMacro( InputSpaceDimension, unsigned int, 2 );
95  itkStaticConstMacro( OutputSpaceDimension, unsigned int, 2 );
96  itkStaticConstMacro( ParametersDimension, unsigned int, 3 );
97 
100 
104 
107 
110 
113 
117 
121 
125 
129 
130  typedef typename Superclass
133  typedef typename Superclass
136  typedef typename Superclass
139 
152  virtual void SetMatrix( const MatrixType & matrix );
153 
159  virtual void SetRotationMatrix( const MatrixType & matrix )
160  { this->SetMatrix( matrix ); }
161  const MatrixType & GetRotationMatrix() const
162  { return this->GetMatrix(); }
163 
171  void Translate( const OffsetType & offset, bool pre = false );
172 
181  inline InputPointType BackTransform( const OutputPointType & point ) const;
182 
183  inline InputVectorType BackTransform( const OutputVectorType & vector ) const;
184 
185  inline InputVnlVectorType BackTransform( const OutputVnlVectorType & vector ) const;
186 
187  inline InputCovariantVectorType BackTransform(
188  const OutputCovariantVectorType & vector ) const;
189 
191  void SetAngle( TScalarType angle );
192 
193  itkGetConstReferenceMacro( Angle, TScalarType );
194 
196  void SetAngleInDegrees( TScalarType angle );
197 
201  void SetRotation( TScalarType angle )
202  { this->SetAngle( angle ); }
203  virtual const TScalarType & GetRotation() const
204  { return m_Angle; }
205 
214  void SetParameters( const ParametersType & parameters );
215 
224  const ParametersType & GetParameters( void ) const;
225 
230  virtual void GetJacobian(
231  const InputPointType &,
232  JacobianType &,
233  NonZeroJacobianIndicesType & ) const;
234 
239  void CloneInverseTo( Pointer & newinverse ) const;
240 
245  void CloneTo( Pointer & clone ) const;
246 
248  virtual void SetIdentity( void );
249 
250 protected:
251 
253  AdvancedRigid2DTransform( unsigned int parametersDimension );
254  AdvancedRigid2DTransform( unsigned int outputSpaceDimension, unsigned int parametersDimension );
255 
257 
261  void PrintSelf( std::ostream & os, Indent indent ) const;
262 
267  virtual void ComputeMatrix( void );
268 
273  virtual void ComputeMatrixParameters( void );
274 
276  void SetVarAngle( TScalarType angle )
277  { m_Angle = angle; }
278 
280  virtual void PrecomputeJacobianOfSpatialJacobian( void );
281 
282 private:
283 
284  AdvancedRigid2DTransform( const Self & ); // purposely not implemented
285  void operator=( const Self & ); // purposely not implemented
286 
287  TScalarType m_Angle;
288 
289 };
290 
291 // Back transform a point
292 template< class TScalarType >
293 inline
296 {
297  itkWarningMacro(
298  << "BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
299  );
300  return this->GetInverseMatrix() * ( point - this->GetOffset() );
301 }
302 
303 
304 // Back transform a vector
305 template< class TScalarType >
306 inline
309 ::BackTransform( const OutputVectorType & vect ) const
310 {
311  itkWarningMacro(
312  << "BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
313  );
314  return this->GetInverseMatrix() * vect;
315 }
316 
317 
318 // Back transform a vnl_vector
319 template< class TScalarType >
320 inline
324 {
325  itkWarningMacro(
326  << "BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
327  );
328  return this->GetInverseMatrix() * vect;
329 }
330 
331 
332 // Back Transform a CovariantVector
333 template< class TScalarType >
334 inline
338 {
339  itkWarningMacro(
340  << "BackTransform(): This method is slated to be removed from ITK. Instead, please use GetInverse() to generate an inverse transform and then perform the transform using that inverted transform."
341  );
342  return this->GetMatrix() * vect;
343 }
344 
345 
346 } // namespace itk
347 
348 #ifndef ITK_MANUAL_INSTANTIATION
349 #include "itkAdvancedRigid2DTransform.hxx"
350 #endif
351 
352 #endif /* __itkAdvancedRigid2DTransform_h */
virtual void ComputeMatrixParameters(void)
Superclass::NumberOfParametersType NumberOfParametersType
SmartPointer< const Self > ConstPointer
void SetAngle(TScalarType angle)
const ParametersType & GetParameters(void) const
virtual void SetIdentity(void)
const MatrixType & GetRotationMatrix() const
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 > Superclass
void SetParameters(const ParametersType &parameters)
Superclass::InputVnlVectorType InputVnlVectorType
Standard vnl_vector type for this class.
Superclass::InputCovariantVectorType InputCovariantVectorType
Standard covariant vector type for this class.
Superclass::SpatialJacobianType SpatialJacobianType
virtual void SetMatrix(const MatrixType &matrix)
void CloneInverseTo(Pointer &newinverse) const
Superclass::OutputCovariantVectorType OutputCovariantVectorType
virtual void PrecomputeJacobianOfSpatialJacobian(void)
Superclass::OutputPointType OutputPointType
InputPointType BackTransform(const OutputPointType &point) const
itkStaticConstMacro(InputSpaceDimension, unsigned int, 2)
Superclass::OutputVnlVectorType OutputVnlVectorType
virtual const TScalarType & GetRotation() const
Superclass::MatrixType MatrixType
Standard matrix type for this class.
virtual void ComputeMatrix(void)
void operator=(const Self &)
virtual void GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
virtual void SetRotationMatrix(const MatrixType &matrix)
void Translate(const OffsetType &offset, bool pre=false)
Superclass::InternalMatrixType InternalMatrixType
Superclass::ParametersType ParametersType
AdvancedRigid2DTransform of a vector space (e.g. space coordinates)
Superclass::InputVectorType InputVectorType
Standard vector type for this class.
Superclass::InputPointType InputPointType
Standard coordinate point type for this class.
Superclass::SpatialHessianType SpatialHessianType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
void SetAngleInDegrees(TScalarType angle)
Superclass::OffsetType OffsetType
Standard vector type for this class.
void CloneTo(Pointer &clone) const
Superclass::OutputVectorType OutputVectorType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo