go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkSingleValuedPointSetToPointSetMetric.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSingleValuedPointSetToPointSetMetric.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-01-26 21:45:56 $
00007   Version:   $Revision: 1.2 $
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 __itkSingleValuedPointSetToPointSetMetric_h
00018 #define __itkSingleValuedPointSetToPointSetMetric_h
00019 
00020 #include "itkImageBase.h"
00021 #include "itkAdvancedTransform.h"
00022 #include "itkSingleValuedCostFunction.h"
00023 #include "itkExceptionObject.h"
00024 #include "itkSpatialObject.h"
00025 #include "itkPointSet.h"
00026 
00027 
00028 namespace itk
00029 {
00030 
00045 template <class TFixedPointSet, class TMovingPointSet>
00046 class ITK_EXPORT SingleValuedPointSetToPointSetMetric
00047   : public SingleValuedCostFunction
00048 {
00049 public:
00050 
00052   typedef SingleValuedPointSetToPointSetMetric  Self;
00053   typedef SingleValuedCostFunction              Superclass;
00054   typedef SmartPointer<Self>                    Pointer;
00055   typedef SmartPointer<const Self>              ConstPointer;
00056 
00058   typedef Superclass::ParametersValueType CoordinateRepresentationType;
00059 
00061   itkTypeMacro( SingleValuedPointSetToPointSetMetric, SingleValuedCostFunction );
00062 
00064   typedef TFixedPointSet                             FixedPointSetType;
00065   typedef typename FixedPointSetType::PixelType      FixedPointSetPixelType;
00066   typedef typename FixedPointSetType::ConstPointer   FixedPointSetConstPointer;
00067   typedef TMovingPointSet                            MovingPointSetType;
00068   typedef typename MovingPointSetType::PixelType     MovingPointSetPixelType;
00069   typedef typename MovingPointSetType::ConstPointer  MovingPointSetConstPointer;
00070   typedef typename FixedPointSetType::PointsContainer::ConstIterator    PointIterator;
00071   typedef typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator;
00072 
00074   itkStaticConstMacro( FixedPointSetDimension, unsigned int,
00075     TFixedPointSet::PointDimension );
00076   itkStaticConstMacro( MovingPointSetDimension, unsigned int,
00077     TMovingPointSet::PointDimension );
00078 
00080   typedef AdvancedTransform< CoordinateRepresentationType,
00081     itkGetStaticConstMacro( FixedPointSetDimension ),
00082     itkGetStaticConstMacro( MovingPointSetDimension ) > TransformType;
00083   typedef typename TransformType::Pointer               TransformPointer;
00084   typedef typename TransformType::InputPointType        InputPointType;
00085   typedef typename TransformType::OutputPointType       OutputPointType;
00086   typedef typename TransformType::ParametersType        TransformParametersType;
00087   typedef typename TransformType::JacobianType          TransformJacobianType;
00088 
00089   typedef SpatialObject<
00090       itkGetStaticConstMacro( FixedPointSetDimension )> FixedImageMaskType;
00091   typedef typename FixedImageMaskType::Pointer          FixedImageMaskPointer;
00092   typedef typename FixedImageMaskType::ConstPointer     FixedImageMaskConstPointer;
00093   typedef SpatialObject<
00094     itkGetStaticConstMacro( MovingPointSetDimension )>  MovingImageMaskType;
00095   typedef typename MovingImageMaskType::Pointer         MovingImageMaskPointer;
00096   typedef typename MovingImageMaskType::ConstPointer    MovingImageMaskConstPointer;
00097 
00099   typedef Superclass::MeasureType                       MeasureType;
00100   typedef Superclass::DerivativeType                    DerivativeType;
00101   typedef typename DerivativeType::ValueType            DerivativeValueType;
00102   typedef Superclass::ParametersType                    ParametersType;
00103 
00105   typedef typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
00106 
00108   itkSetConstObjectMacro( FixedPointSet, FixedPointSetType );
00109 
00111   itkGetConstObjectMacro( FixedPointSet, FixedPointSetType );
00112 
00114   itkSetConstObjectMacro( MovingPointSet, MovingPointSetType );
00115 
00117   itkGetConstObjectMacro( MovingPointSet, MovingPointSetType );
00118 
00120   itkSetObjectMacro( Transform, TransformType );
00121 
00123   itkGetConstObjectMacro( Transform, TransformType );
00124 
00126   void SetTransformParameters( const ParametersType & parameters ) const;
00127 
00129   unsigned int GetNumberOfParameters( void ) const
00130   { return this->m_Transform->GetNumberOfParameters(); }
00131 
00135   virtual void Initialize( void ) throw ( ExceptionObject );
00136 
00138   // \todo: currently not used
00139   itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
00140 
00142   itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
00143 
00145   itkSetConstObjectMacro( MovingImageMask, MovingImageMaskType );
00146 
00148   itkGetConstObjectMacro( MovingImageMask, MovingImageMaskType );
00149 
00150 protected:
00151   SingleValuedPointSetToPointSetMetric();
00152   virtual ~SingleValuedPointSetToPointSetMetric() {};
00153 
00155   void PrintSelf( std::ostream & os, Indent indent ) const;
00156 
00158   FixedPointSetConstPointer   m_FixedPointSet;
00159   MovingPointSetConstPointer  m_MovingPointSet;
00160   FixedImageMaskConstPointer  m_FixedImageMask;
00161   MovingImageMaskConstPointer m_MovingImageMask;
00162   mutable TransformPointer    m_Transform;
00163 
00164   mutable unsigned int        m_NumberOfPointsCounted;
00165 
00166 private:
00167   SingleValuedPointSetToPointSetMetric(const Self&); //purposely not implemented
00168   void operator=(const Self&); //purposely not implemented
00169 
00170 }; // end class SingleValuedPointSetToPointSetMetric
00171 
00172 } // end namespace itk
00173 
00174 #ifndef ITK_MANUAL_INSTANTIATION
00175 #include "itkSingleValuedPointSetToPointSetMetric.txx"
00176 #endif
00177 
00178 #endif


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