Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkPointSetToImageMetric.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkPointSetToImageMetric.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:37 $ 00007 Version: $Revision: 1.4 $ 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 __itkPointSetToImageMetric_h 00018 #define __itkPointSetToImageMetric_h 00019 00020 #include "itkImageBase.h" 00021 #include "itkTransform.h" 00022 #include "itkInterpolateImageFunction.h" 00023 #include "itkSingleValuedCostFunction.h" 00024 #include "itkExceptionObject.h" 00025 #include "itkGradientRecursiveGaussianImageFilter.h" 00026 00027 namespace itk 00028 { 00029 00046 template <class TFixedPointSet, class TMovingImage> 00047 class ITK_EXPORT PointSetToImageMetric : public SingleValuedCostFunction 00048 { 00049 public: 00051 typedef PointSetToImageMetric Self; 00052 typedef SingleValuedCostFunction Superclass; 00053 typedef SmartPointer<Self> Pointer; 00054 typedef SmartPointer<const Self> ConstPointer; 00055 00057 typedef Superclass::ParametersValueType CoordinateRepresentationType; 00058 00060 itkTypeMacro(PointSetToImageMetric, SingleValuedCostFunction); 00061 00063 typedef TMovingImage MovingImageType; 00064 typedef typename TMovingImage::PixelType MovingImagePixelType; 00065 typedef typename MovingImageType::ConstPointer MovingImageConstPointer; 00066 00068 typedef TFixedPointSet FixedPointSetType; 00069 typedef typename FixedPointSetType::ConstPointer FixedPointSetConstPointer; 00070 00072 itkStaticConstMacro(MovingImageDimension, unsigned int, 00073 TMovingImage::ImageDimension); 00074 itkStaticConstMacro(FixedPointSetDimension, unsigned int, 00075 TFixedPointSet::PointDimension); 00076 00077 typedef typename FixedPointSetType::PointsContainer::ConstIterator PointIterator; 00078 typedef typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator; 00079 00081 typedef Transform<CoordinateRepresentationType, 00082 itkGetStaticConstMacro(MovingImageDimension), 00083 itkGetStaticConstMacro(FixedPointSetDimension)> TransformType; 00084 00085 typedef typename TransformType::Pointer TransformPointer; 00086 typedef typename TransformType::InputPointType InputPointType; 00087 typedef typename TransformType::OutputPointType OutputPointType; 00088 typedef typename TransformType::ParametersType TransformParametersType; 00089 typedef typename TransformType::JacobianType TransformJacobianType; 00090 00092 typedef InterpolateImageFunction< 00093 MovingImageType, 00094 CoordinateRepresentationType > InterpolatorType; 00095 00096 00098 typedef typename NumericTraits<MovingImagePixelType>::RealType RealType; 00099 typedef CovariantVector<RealType, 00100 itkGetStaticConstMacro(MovingImageDimension)> GradientPixelType; 00101 typedef Image<GradientPixelType, 00102 itkGetStaticConstMacro(MovingImageDimension)> GradientImageType; 00103 typedef SmartPointer<GradientImageType> GradientImagePointer; 00104 typedef GradientRecursiveGaussianImageFilter< MovingImageType, 00105 GradientImageType > 00106 GradientImageFilterType; 00107 typedef typename GradientImageFilterType::Pointer GradientImageFilterPointer; 00108 00109 00110 typedef typename InterpolatorType::Pointer InterpolatorPointer; 00111 00113 typedef Superclass::MeasureType MeasureType; 00114 00116 typedef Superclass::DerivativeType DerivativeType; 00117 00119 typedef Superclass::ParametersType ParametersType; 00120 00122 itkSetConstObjectMacro( FixedPointSet, FixedPointSetType ); 00123 00125 itkGetConstObjectMacro( FixedPointSet, FixedPointSetType ); 00126 00128 itkSetConstObjectMacro( MovingImage, MovingImageType ); 00129 00131 itkGetConstObjectMacro( MovingImage, MovingImageType ); 00132 00134 itkSetObjectMacro( Transform, TransformType ); 00135 00137 itkGetObjectMacro( Transform, TransformType ); 00138 00140 itkSetObjectMacro( Interpolator, InterpolatorType ); 00141 00143 itkGetObjectMacro( Interpolator, InterpolatorType ); 00144 00146 itkGetConstMacro( NumberOfPixelsCounted, unsigned long ); 00147 00149 void SetTransformParameters( const ParametersType & parameters ) const; 00150 00152 unsigned int GetNumberOfParameters(void) const 00153 { return m_Transform->GetNumberOfParameters(); } 00154 00157 virtual void Initialize(void) throw ( ExceptionObject ); 00158 00159 protected: 00160 PointSetToImageMetric(); 00161 virtual ~PointSetToImageMetric() {}; 00162 void PrintSelf(std::ostream& os, Indent indent) const; 00163 00164 mutable unsigned long m_NumberOfPixelsCounted; 00165 00166 FixedPointSetConstPointer m_FixedPointSet; 00167 MovingImageConstPointer m_MovingImage; 00168 00169 mutable TransformPointer m_Transform; 00170 InterpolatorPointer m_Interpolator; 00171 00172 bool m_ComputeGradient; 00173 GradientImagePointer m_GradientImage; 00174 00175 private: 00176 PointSetToImageMetric(const Self&); //purposely not implemented 00177 void operator=(const Self&); //purposely not implemented 00178 00179 }; 00180 00181 } // end namespace itk 00182 00183 #ifndef ITK_MANUAL_INSTANTIATION 00184 #include "itkPointSetToImageMetric.txx" 00185 #endif 00186 00187 #endif 00188 00189 00190

Generated at Sat Mar 31 02:27:22 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000