go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedTransform.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003 This file is part of the elastix software.
00004 
00005 Copyright (c) University Medical Center Utrecht. All rights reserved.
00006 See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007 details.
00008 
00009 This software is distributed WITHOUT ANY WARRANTY; without even
00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011 PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 /*=========================================================================
00016 
00017   Program:   Insight Segmentation & Registration Toolkit
00018   Module:    $RCSfile: itkTransform.h,v $
00019   Language:  C++
00020   Date:      $Date: 2008-06-29 12:58:58 $
00021   Version:   $Revision: 1.64 $
00022 
00023   Copyright (c) Insight Software Consortium. All rights reserved.
00024   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00025 
00026      This software is distributed WITHOUT ANY WARRANTY; without even
00027      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00028      PURPOSE.  See the above copyright notices for more information.
00029 
00030 =========================================================================*/
00031 #ifndef __itkAdvancedTransform_h
00032 #define __itkAdvancedTransform_h
00033 
00034 #include "itkTransform.h"
00035 #include "itkMatrix.h"
00036 #include "itkFixedArray.h"
00037 
00038 namespace itk
00039 {
00040 
00079 template <class TScalarType,
00080   unsigned int NInputDimensions = 3,
00081   unsigned int NOutputDimensions = 3>
00082 class ITK_EXPORT AdvancedTransform
00083   : public Transform< TScalarType, NInputDimensions, NOutputDimensions >
00084 {
00085 public:
00087   typedef AdvancedTransform           Self;
00088   typedef Transform< TScalarType,
00089     NInputDimensions,
00090     NOutputDimensions >               Superclass;
00091   typedef SmartPointer< Self >        Pointer;
00092   typedef SmartPointer< const Self >  ConstPointer;
00093 
00095   itkNewMacro( Self );
00096 
00098   itkTypeMacro( AdvancedTransform, Transform );
00099 
00101   itkStaticConstMacro( InputSpaceDimension, unsigned int, NInputDimensions );
00102   itkStaticConstMacro( OutputSpaceDimension, unsigned int, NOutputDimensions );
00103 
00105   typedef typename Superclass::ScalarType           ScalarType;
00106   typedef typename Superclass::ParametersType       ParametersType;
00107   typedef typename Superclass::JacobianType         JacobianType;
00108   typedef typename Superclass::InputVectorType      InputVectorType;
00109   typedef typename Superclass::OutputVectorType     OutputVectorType;
00110   typedef typename Superclass
00111     ::InputCovariantVectorType                      InputCovariantVectorType;
00112   typedef typename Superclass
00113     ::OutputCovariantVectorType                     OutputCovariantVectorType;
00114   typedef typename Superclass::InputVnlVectorType   InputVnlVectorType;
00115   typedef typename Superclass::OutputVnlVectorType  OutputVnlVectorType;
00116   typedef typename Superclass::InputPointType       InputPointType;
00117   typedef typename Superclass::OutputPointType      OutputPointType;
00118 
00123   typedef std::vector< unsigned long >              NonZeroJacobianIndicesType;
00124   typedef Matrix< ScalarType,
00125     OutputSpaceDimension, InputSpaceDimension >     SpatialJacobianType;
00126   typedef std::vector< SpatialJacobianType >        JacobianOfSpatialJacobianType;
00127   // \todo: think about the SpatialHessian type, should be a 3D native type
00128   typedef FixedArray<
00129     Matrix< ScalarType,
00130     InputSpaceDimension, InputSpaceDimension >,
00131     OutputSpaceDimension >                          SpatialHessianType;
00132   typedef std::vector< SpatialHessianType >         JacobianOfSpatialHessianType;
00133   typedef typename SpatialJacobianType::InternalMatrixType  InternalMatrixType;
00134 
00136   virtual unsigned long GetNumberOfNonZeroJacobianIndices( void ) const;
00137 
00139   itkGetConstMacro( HasNonZeroSpatialHessian, bool );
00140   itkGetConstMacro( HasNonZeroJacobianOfSpatialHessian, bool );
00141 
00168   virtual void GetJacobian(
00169     const InputPointType & ipp,
00170     JacobianType & j,
00171     NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
00172 
00177   virtual const JacobianType & GetJacobian( const InputPointType & ) const;
00178 
00205   virtual void GetSpatialJacobian(
00206     const InputPointType & ipp,
00207     SpatialJacobianType & sj ) const;
00208 
00225   virtual void GetSpatialHessian(
00226     const InputPointType & ipp,
00227     SpatialHessianType & sh ) const;
00228 
00235   virtual void GetJacobianOfSpatialJacobian(
00236     const InputPointType & ipp,
00237     JacobianOfSpatialJacobianType & jsj,
00238     NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
00239 
00243   virtual void GetJacobianOfSpatialJacobian(
00244     const InputPointType & ipp,
00245     SpatialJacobianType & sj,
00246     JacobianOfSpatialJacobianType & jsj,
00247     NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
00248 
00255   virtual void GetJacobianOfSpatialHessian(
00256     const InputPointType & ipp,
00257     JacobianOfSpatialHessianType & jsh,
00258     NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
00259 
00263   virtual void GetJacobianOfSpatialHessian(
00264     const InputPointType & ipp,
00265     SpatialHessianType & sh,
00266     JacobianOfSpatialHessianType & jsh,
00267     NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
00268 
00269 protected:
00270   AdvancedTransform();
00271   AdvancedTransform( unsigned int Dimension, unsigned int NumberOfParameters );
00272   virtual ~AdvancedTransform() {};
00273 
00274   bool m_HasNonZeroSpatialHessian;
00275   bool m_HasNonZeroJacobianOfSpatialHessian;
00276 
00277 private:
00278 
00279   AdvancedTransform(const Self&); // purposely not implemented
00280   void operator=(const Self&);    // purposely not implemented
00281 
00282 }; // end class AdvancedTransform
00283 
00284 } // end namespace itk
00285 
00286 // Define instantiation macro for this template.
00287 #define ITK_TEMPLATE_AdvancedTransform(_, EXPORT, x, y) namespace itk { \
00288   _(3(class EXPORT AdvancedTransform< ITK_TEMPLATE_3 x >)) \
00289   namespace Templates { typedef AdvancedTransform< ITK_TEMPLATE_3 x > AdvancedTransform##y; } \
00290   }
00291 
00292 #if ITK_TEMPLATE_EXPLICIT
00293 # include "Templates/itkAdvancedTransform+-.h"
00294 #endif
00295 
00296 #if ITK_TEMPLATE_TXX
00297 # include "itkAdvancedTransform.txx"
00298 #endif
00299 
00300 #endif


Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo