go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkWeightedCombinationTransform.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 #ifndef __itkWeightedCombinationTransform_h
00016 #define __itkWeightedCombinationTransform_h
00017 
00018 #include "itkAdvancedTransform.h"
00019 
00020 namespace itk
00021 {
00022 
00038 template <class TScalarType,
00039   unsigned int NInputDimensions = 3,
00040   unsigned int NOutputDimensions = 3>
00041 class WeightedCombinationTransform
00042   : public AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >
00043 {
00044 public:
00046   typedef WeightedCombinationTransform           Self;
00047   typedef AdvancedTransform< TScalarType,
00048     NInputDimensions,
00049     NOutputDimensions >               Superclass;
00050   typedef SmartPointer< Self >        Pointer;
00051   typedef SmartPointer< const Self >  ConstPointer;
00052 
00054   itkNewMacro( Self );
00055 
00057   itkTypeMacro( WeightedCombinationTransform, AdvancedTransform );
00058 
00060   itkStaticConstMacro( InputSpaceDimension, unsigned int, NInputDimensions );
00061   itkStaticConstMacro( OutputSpaceDimension, unsigned int, NOutputDimensions );
00062 
00064   typedef typename Superclass::ScalarType           ScalarType;
00065   typedef typename Superclass::ParametersType       ParametersType;
00066   typedef typename Superclass::JacobianType         JacobianType;
00067   typedef typename Superclass::InputVectorType      InputVectorType;
00068   typedef typename Superclass::OutputVectorType     OutputVectorType;
00069   typedef typename Superclass
00070     ::InputCovariantVectorType                      InputCovariantVectorType;
00071   typedef typename Superclass
00072     ::OutputCovariantVectorType                     OutputCovariantVectorType;
00073   typedef typename Superclass::InputVnlVectorType   InputVnlVectorType;
00074   typedef typename Superclass::OutputVnlVectorType  OutputVnlVectorType;
00075   typedef typename Superclass::InputPointType       InputPointType;
00076   typedef typename Superclass::OutputPointType      OutputPointType;
00077   typedef typename
00078     Superclass::NonZeroJacobianIndicesType          NonZeroJacobianIndicesType;
00079   typedef typename Superclass::SpatialJacobianType  SpatialJacobianType;
00080   typedef typename
00081     Superclass::JacobianOfSpatialJacobianType       JacobianOfSpatialJacobianType;
00082   typedef typename Superclass::SpatialHessianType   SpatialHessianType;
00083 
00085   typedef Transform< TScalarType,
00086     NInputDimensions,
00087     NOutputDimensions >                             TransformType;
00089   typedef typename TransformType::Pointer           TransformPointer;
00090   typedef std::vector< TransformPointer >           TransformContainerType;
00091 
00093   virtual OutputPointType TransformPoint(const InputPointType & ipp ) const;
00094 
00100   virtual void GetJacobian(
00101     const InputPointType & ipp,
00102     JacobianType & jac,
00103     NonZeroJacobianIndicesType & nzji ) const;
00104 
00106   virtual const JacobianType & GetJacobian( const InputPointType & ipp) const;
00107 
00111   virtual void SetParameters( const ParametersType & param );
00112 
00114   itkGetConstReferenceMacro( Parameters, ParametersType );
00115 
00117   virtual unsigned int GetNumberOfParameters(void) const
00118   { 
00119     return this->m_TransformContainer.size();
00120   };
00121 
00124   itkSetMacro( NormalizeWeights, bool );
00125   itkGetConstMacro( NormalizeWeights, bool );
00126 
00128   virtual void SetTransformContainer( const TransformContainerType & transformContainer )
00129   {
00130     this->m_TransformContainer = transformContainer;
00131     this->Modified();
00132   };
00133 
00143   const TransformContainerType & GetTransformContainer(void) const
00144   {
00145     return this->m_TransformContainer;
00146   }
00147 
00148 protected:
00149   WeightedCombinationTransform();
00150   virtual ~WeightedCombinationTransform() {};
00151 
00152   TransformContainerType   m_TransformContainer;
00153   double  m_SumOfWeights;
00154 
00155 private:
00156 
00157   WeightedCombinationTransform(const Self&); // purposely not implemented
00158   void operator=(const Self&);    // purposely not implemented
00159 
00160   bool  m_NormalizeWeights;
00161 
00162 }; // end class WeightedCombinationTransform
00163 
00164 } // end namespace itk
00165 
00166 // \todo: copied the below from itk. does this just work like this?:
00167 
00168 // Define instantiation macro for this template.
00169 #define ITK_TEMPLATE_WeightedCombination(_, EXPORT, x, y) namespace itk { \
00170   _(3(class EXPORT WeightedCombinationTransform< ITK_TEMPLATE_3 x >)) \
00171   namespace Templates { typedef WeigthedCombinationTransform< ITK_TEMPLATE_3 x > WeightedCombinationTransform##y; } \
00172   }
00173 
00174 #if ITK_TEMPLATE_EXPLICIT
00175 # include "Templates/itkWeightedCombinationTransform+-.h"
00176 #endif
00177 
00178 #if ITK_TEMPLATE_TXX
00179 # include "itkWeightedCombinationTransform.txx"
00180 #endif
00181 
00182 #endif


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