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  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkAdvancedRigid2DTransform.h,v $
5  Language: C++
6  Date: $Date: 2009-01-14 18:39:05 $
7  Version: $Revision: 1.22 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkAdvancedRigid2DTransform_h
18 #define __itkAdvancedRigid2DTransform_h
19 
20 #include <iostream>
22 #include "itkExceptionObject.h"
23 
24 namespace itk
25 {
26 
57 template < class TScalarType=double > // Data type for scalars (float or double)
58 class ITK_EXPORT AdvancedRigid2DTransform :
59  public AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2> // Dimensions of input and output spaces
60 {
61 public:
65  typedef SmartPointer<Self> Pointer;
66  typedef SmartPointer<const Self> ConstPointer;
67 
70 
72  itkNewMacro( Self );
73 
75  itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
76  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
77  itkStaticConstMacro(ParametersDimension, unsigned int, 3);
78 
81 
84 
87 
90 
93 
97 
101 
105 
109 
110  typedef typename Superclass
113  typedef typename Superclass
116  typedef typename Superclass
119 
132  virtual void SetMatrix( const MatrixType & matrix );
133 
139  virtual void SetRotationMatrix(const MatrixType &matrix)
140  { this->SetMatrix( matrix ); }
141  const MatrixType & GetRotationMatrix() const
142  { return this->GetMatrix(); }
143 
144 
152  void Translate(const OffsetType &offset, bool pre=false);
153 
162  inline InputPointType BackTransform(const OutputPointType &point ) const;
163  inline InputVectorType BackTransform(const OutputVectorType &vector) const;
164  inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
165 
166  inline InputCovariantVectorType BackTransform(
167  const OutputCovariantVectorType &vector) const;
168 
170  void SetAngle(TScalarType angle);
171  itkGetConstReferenceMacro( Angle, TScalarType );
172 
174  void SetAngleInDegrees(TScalarType angle);
175 
179  void SetRotation(TScalarType angle)
180  { this->SetAngle(angle); }
181  virtual const TScalarType & GetRotation() const
182  { return m_Angle; }
183 
192  void SetParameters( const ParametersType & parameters );
193 
202  const ParametersType & GetParameters( void ) const;
203 
208  virtual void GetJacobian(
209  const InputPointType &,
210  JacobianType &,
211  NonZeroJacobianIndicesType & ) const;
212 
217  void CloneInverseTo( Pointer & newinverse ) const;
218 
223  void CloneTo( Pointer & clone ) const;
224 
226  virtual void SetIdentity(void);
227 
228 
229 protected:
231  AdvancedRigid2DTransform( unsigned int outputSpaceDimension,
232  unsigned int parametersDimension);
233 
235 
239  void PrintSelf(std::ostream &os, Indent indent) const;
240 
245  virtual void ComputeMatrix(void);
246 
251  virtual void ComputeMatrixParameters(void);
252 
254  void SetVarAngle( TScalarType angle )
255  { m_Angle = angle; }
256 
258  virtual void PrecomputeJacobianOfSpatialJacobian(void);
259 
260 
261 private:
262  AdvancedRigid2DTransform(const Self&); //purposely not implemented
263  void operator=(const Self&); //purposely not implemented
264 
265  TScalarType m_Angle;
266 
267 }; //class AdvancedRigid2DTransform
268 
269 
270 // Back transform a point
271 template<class TScalarType>
272 inline
275 BackTransform(const OutputPointType &point) const
276 {
277  itkWarningMacro(
278  <<"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."
279  );
280  return this->GetInverseMatrix() * (point - this->GetOffset());
281 }
282 
283 // Back transform a vector
284 template<class TScalarType>
285 inline
288 BackTransform(const OutputVectorType &vect ) const
289 {
290  itkWarningMacro(
291  <<"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."
292  );
293  return this->GetInverseMatrix() * vect;
294 }
295 
296 // Back transform a vnl_vector
297 template<class TScalarType>
298 inline
302 {
303  itkWarningMacro(
304  <<"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."
305  );
306  return this->GetInverseMatrix() * vect;
307 }
308 
309 
310 // Back Transform a CovariantVector
311 template<class TScalarType>
312 inline
316 {
317  itkWarningMacro(
318  <<"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."
319  );
320  return this->GetMatrix() * vect;
321 }
322 
323 } // namespace itk
324 
325 
326 // Define instantiation macro for this template.
327 #define ITK_TEMPLATE_AdvancedRigid2DTransform(_, EXPORT, x, y) namespace itk { \
328  _(1(class EXPORT AdvancedRigid2DTransform< ITK_TEMPLATE_1 x >)) \
329  namespace Templates { typedef AdvancedRigid2DTransform< ITK_TEMPLATE_1 x > AdvancedRigid2DTransform##y; } \
330  }
331 
332 #if ITK_TEMPLATE_EXPLICIT
333 # include "Templates/itkAdvancedRigid2DTransform+-.h"
334 #endif
335 
336 #if ITK_TEMPLATE_TXX
337 # include "itkAdvancedRigid2DTransform.txx"
338 #endif
339 
340 #endif /* __itkAdvancedRigid2DTransform_h */


Generated on 27-06-2013 for elastix by doxygen 1.8.3.1 elastix logo