go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedRigid3DTransform.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAdvancedRigid3DTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-02-13 21:46:04 $
00007   Version:   $Revision: 1.38 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkAdvancedRigid3DTransform_h
00018 #define __itkAdvancedRigid3DTransform_h
00019 
00020 #include <iostream>
00021 #include "itkAdvancedMatrixOffsetTransformBase.h"
00022 #include "itkExceptionObject.h"
00023 #include "itkMatrix.h"
00024 #include "itkVersor.h"
00025 
00026 namespace itk
00027 {
00028 
00048 template < class TScalarType=double >    // type for scalars (float or double)
00049 class ITK_EXPORT AdvancedRigid3DTransform :
00050    public AdvancedMatrixOffsetTransformBase< TScalarType, 3, 3>
00051 {
00052 public:
00054   typedef AdvancedRigid3DTransform                                 Self;
00055   typedef AdvancedMatrixOffsetTransformBase< TScalarType, 3, 3 >   Superclass;
00056   typedef SmartPointer<Self>                               Pointer;
00057   typedef SmartPointer<const Self>                         ConstPointer;
00058 
00060   itkTypeMacro( AdvancedRigid3DTransform, AdvancedMatrixOffsetTransformBase );
00061 
00063   itkNewMacro( Self );
00064 
00066   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00069   itkStaticConstMacro(ParametersDimension, unsigned int, 12);
00070 
00071   typedef typename Superclass::ParametersType             ParametersType;
00072   typedef typename Superclass::JacobianType               JacobianType;
00073   typedef typename Superclass::ScalarType                 ScalarType;
00074   typedef typename Superclass::InputVectorType            InputVectorType;
00075   typedef typename Superclass::OutputVectorType           OutputVectorType;
00076   typedef typename Superclass::InputCovariantVectorType
00077                                                      InputCovariantVectorType;
00078   typedef typename Superclass::OutputCovariantVectorType
00079                                                      OutputCovariantVectorType;
00080   typedef typename Superclass::InputVnlVectorType         InputVnlVectorType;
00081   typedef typename Superclass::OutputVnlVectorType        OutputVnlVectorType;
00082   typedef typename Superclass::InputPointType             InputPointType;
00083   typedef typename Superclass::OutputPointType            OutputPointType;
00084   typedef typename Superclass::MatrixType                 MatrixType;
00085   typedef typename Superclass::InverseMatrixType          InverseMatrixType;
00086   typedef typename Superclass::CenterType                 CenterType;
00087   typedef typename Superclass::TranslationType            TranslationType;
00088   typedef typename Superclass::OffsetType                 OffsetType;
00089 
00090   typedef typename Superclass
00091     ::NonZeroJacobianIndicesType                    NonZeroJacobianIndicesType;
00092   typedef typename Superclass::SpatialJacobianType  SpatialJacobianType;
00093   typedef typename Superclass
00094     ::JacobianOfSpatialJacobianType                 JacobianOfSpatialJacobianType;
00095   typedef typename Superclass::SpatialHessianType   SpatialHessianType;
00096   typedef typename Superclass
00097     ::JacobianOfSpatialHessianType                  JacobianOfSpatialHessianType;
00098   typedef typename Superclass::InternalMatrixType   InternalMatrixType;
00099 
00110    virtual void SetParameters( const ParametersType & parameters );
00111 
00117   virtual void SetMatrix(const MatrixType &matrix);
00118 
00127    const MatrixType & GetRotationMatrix()
00128      { return this->GetMatrix(); }
00129 
00140   virtual void SetRotationMatrix(const MatrixType & matrix)
00141       { this->SetMatrix(matrix); }
00142 
00150   void Translate(const OffsetType & offset, bool pre=false);
00151 
00163   InputPointType      BackTransform(const OutputPointType
00164                                                    &point ) const;
00165   InputVectorType     BackTransform(const OutputVectorType
00166                                                    &vector) const;
00167   InputVnlVectorType  BackTransform( const OutputVnlVectorType
00168                                                    &vector) const;
00169   InputCovariantVectorType BackTransform(const OutputCovariantVectorType
00170                                                    &vector) const;
00171 
00176   bool MatrixIsOrthogonal( const MatrixType & matrix, double tol = 1e-10 );
00177 
00178 protected:
00179   AdvancedRigid3DTransform(unsigned int spaceDim,
00180                    unsigned int paramDim);
00181   AdvancedRigid3DTransform(const MatrixType & matrix,
00182                    const OutputVectorType & offset);
00183   AdvancedRigid3DTransform();
00184   ~AdvancedRigid3DTransform();
00185 
00189   void PrintSelf(std::ostream &os, Indent indent) const;
00190 
00191 private:
00192   AdvancedRigid3DTransform(const Self&); //purposely not implemented
00193   void operator=(const Self&); //purposely not implemented
00194 
00195 }; //class AdvancedRigid3DTransform
00196 
00197 
00198 }  // namespace itk
00199 
00200 // Define instantiation macro for this template.
00201 #define ITK_TEMPLATE_AdvancedRigid3DTransform(_, EXPORT, x, y) namespace itk { \
00202   _(1(class EXPORT AdvancedRigid3DTransform< ITK_TEMPLATE_1 x >)) \
00203   namespace Templates { typedef AdvancedRigid3DTransform< ITK_TEMPLATE_1 x > AdvancedRigid3DTransform##y; } \
00204   }
00205 
00206 #if ITK_TEMPLATE_EXPLICIT
00207 # include "Templates/itkAdvancedRigid3DTransform+-.h"
00208 #endif
00209 
00210 #if ITK_TEMPLATE_TXX
00211 # include "itkAdvancedRigid3DTransform.txx"
00212 #endif
00213 
00214 #endif /* __itkAdvancedRigid3DTransform_h */


Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo