ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4_h
00019 #define __itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4_h
00020 
00021 #include "itkPointSetToPointSetMetricv4.h"
00022 
00023 #include "itkManifoldParzenWindowsPointSetFunction.h"
00024 
00025 namespace itk {
00026 
00061 template<class TPointSet>
00062 class ITK_EXPORT JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4 :
00063     public PointSetToPointSetMetricv4<TPointSet, TPointSet>
00064 {
00065 public:
00067   typedef JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4 Self;
00068   typedef PointSetToPointSetMetricv4<TPointSet, TPointSet>     Superclass;
00069   typedef SmartPointer<Self>                                   Pointer;
00070   typedef SmartPointer<const Self>                             ConstPointer;
00071 
00073   itkNewMacro( Self );
00074 
00076   itkTypeMacro( JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4, PointSetToPointSetMetricv4 );
00077 
00078   typedef TPointSet                                 PointSetType;
00079   typedef typename PointSetType::PointsContainer    PointsContainer;
00080   typedef typename PointsContainer::ConstIterator   PointsContainerConstIterator;
00081 
00082   itkStaticConstMacro( PointDimension, unsigned int, TPointSet::PointDimension );
00083 
00085   typedef typename Superclass::MeasureType              MeasureType;
00086   typedef typename Superclass::DerivativeType           DerivativeType;
00087   typedef typename Superclass::LocalDerivativeType      LocalDerivativeType;
00088   typedef typename Superclass::PointType                PointType;
00089   typedef typename Superclass::CoordRepType             CoordRepType;
00090   typedef typename Superclass::PointIdentifier          PointIdentifier;
00091   typedef typename Superclass::NeighborsIdentifierType  NeighborsIdentifierType;
00092 
00093   typedef MeasureType                                   RealType;
00094 
00098   typedef ManifoldParzenWindowsPointSetFunction
00099     <PointSetType, RealType>                            DensityFunctionType;
00100   typedef typename DensityFunctionType::GaussianType    GaussianType;
00101   typedef typename DensityFunctionType::Pointer         DensityFunctionPointer;
00102 
00105   virtual void Initialize( void ) throw ( ExceptionObject );
00106 
00111   virtual MeasureType GetValue() const;
00112 
00117   virtual void GetDerivative( DerivativeType & ) const;
00118 
00123   virtual void GetValueAndDerivative( MeasureType &, DerivativeType & ) const;
00124 
00134   itkSetClampMacro( Alpha, RealType, 1.0, 2.0 );
00135 
00139   itkGetConstMacro( Alpha, RealType );
00140 
00148   itkSetMacro( UseRegularizationTerm, bool );
00149 
00151   itkGetConstMacro( UseRegularizationTerm, bool );
00152 
00154   itkBooleanMacro( UseRegularizationTerm );
00155 
00161   itkSetMacro( PointSetSigma, RealType );
00162 
00164   itkGetConstMacro( PointSetSigma, RealType );
00165 
00170   itkSetMacro( EvaluationKNeighborhood, unsigned int );
00171 
00176   itkGetConstMacro( EvaluationKNeighborhood, unsigned int );
00177 
00182   itkSetMacro( UseAnisotropicCovariances, bool );
00183 
00188   itkGetConstMacro( UseAnisotropicCovariances, bool );
00189 
00194   itkBooleanMacro( UseAnisotropicCovariances );
00195 
00201   itkSetMacro( CovarianceKNeighborhood, unsigned int );
00202 
00208   itkGetConstMacro( CovarianceKNeighborhood, unsigned int );
00209 
00217   itkSetMacro( KernelSigma, RealType );
00218 
00220   itkGetConstMacro( KernelSigma, RealType );
00221 
00223   virtual MeasureType GetLocalNeighborhoodValue( const PointType & ) const
00224   {
00225     itkExceptionMacro( "This function should not be accessed." );
00226     return 0;
00227   }
00229 
00231   virtual void GetLocalNeighborhoodValueAndDerivative( const PointType &,
00232     MeasureType &, LocalDerivativeType & ) const
00233   {
00234     itkExceptionMacro( "This function should not be accessed." );
00235   }
00236 
00237 protected:
00238   JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4();
00239   ~JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4();
00240 
00241   void PrintSelf( std::ostream& os, Indent indent ) const;
00242 
00243 private:
00244   //purposely not implemented
00245   JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4( const Self& );
00246   void operator=( const Self& );
00247 
00248   DensityFunctionPointer                   m_MovingDensityFunction;
00249   DensityFunctionPointer                   m_FixedDensityFunction;
00250 
00251   bool                                     m_UseRegularizationTerm;
00252   bool                                     m_UseAnisotropicCovariances;
00253 
00254   RealType                                 m_PointSetSigma;
00255   RealType                                 m_KernelSigma;
00256   unsigned int                             m_CovarianceKNeighborhood;
00257   unsigned int                             m_EvaluationKNeighborhood;
00258 
00259   RealType                                 m_Alpha;
00260 };
00261 
00262 
00263 } // end namespace itk
00264 
00265 #ifndef ITK_MANUAL_INSTANTIATION
00266 #include "itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx"
00267 #endif
00268 
00269 #endif
00270