ITK  4.2.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::DerivativeValueType      DerivativeValueType;
00088   typedef typename Superclass::LocalDerivativeType      LocalDerivativeType;
00089   typedef typename Superclass::PointType                PointType;
00090   typedef typename Superclass::CoordRepType             CoordRepType;
00091   typedef typename Superclass::PointIdentifier          PointIdentifier;
00092   typedef typename Superclass::NeighborsIdentifierType  NeighborsIdentifierType;
00093   typedef typename Superclass::NumberOfParametersType   NumberOfParametersType;
00094 
00095   typedef typename Superclass::JacobianType                   JacobianType;
00096   typedef typename Superclass::FixedTransformJacobianType     FixedTransformJacobianType;
00097   typedef typename Superclass::MovingTransformJacobianType    MovingTransformJacobianType;
00098 
00099   typedef MeasureType                                   RealType;
00100 
00104   typedef ManifoldParzenWindowsPointSetFunction
00105     <PointSetType, RealType>                            DensityFunctionType;
00106   typedef typename DensityFunctionType::GaussianType    GaussianType;
00107   typedef typename DensityFunctionType::Pointer         DensityFunctionPointer;
00108 
00111   virtual void Initialize( void ) throw ( ExceptionObject );
00112 
00117   virtual MeasureType GetValue() const;
00118 
00123   virtual void GetDerivative( DerivativeType & ) const;
00124 
00129   virtual void GetValueAndDerivative( MeasureType &, DerivativeType & ) const;
00130 
00140   itkSetClampMacro( Alpha, RealType, 1.0, 2.0 );
00141 
00145   itkGetConstMacro( Alpha, RealType );
00146 
00154   itkSetMacro( UseRegularizationTerm, bool );
00155 
00157   itkGetConstMacro( UseRegularizationTerm, bool );
00158 
00160   itkBooleanMacro( UseRegularizationTerm );
00161 
00167   itkSetMacro( PointSetSigma, RealType );
00168 
00170   itkGetConstMacro( PointSetSigma, RealType );
00171 
00176   itkSetMacro( EvaluationKNeighborhood, unsigned int );
00177 
00182   itkGetConstMacro( EvaluationKNeighborhood, unsigned int );
00183 
00188   itkSetMacro( UseAnisotropicCovariances, bool );
00189 
00194   itkGetConstMacro( UseAnisotropicCovariances, bool );
00195 
00200   itkBooleanMacro( UseAnisotropicCovariances );
00201 
00207   itkSetMacro( CovarianceKNeighborhood, unsigned int );
00208 
00214   itkGetConstMacro( CovarianceKNeighborhood, unsigned int );
00215 
00223   itkSetMacro( KernelSigma, RealType );
00224 
00226   itkGetConstMacro( KernelSigma, RealType );
00227 
00229   virtual MeasureType GetLocalNeighborhoodValue( const PointType & ) const
00230   {
00231     itkExceptionMacro( "This function should not be accessed." );
00232     return 0;
00233   }
00235 
00237   virtual void GetLocalNeighborhoodValueAndDerivative( const PointType &,
00238     MeasureType &, LocalDerivativeType & ) const
00239   {
00240     itkExceptionMacro( "This function should not be accessed." );
00241   }
00242 
00243 protected:
00244   JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4();
00245   ~JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4();
00246 
00247   void PrintSelf( std::ostream& os, Indent indent ) const;
00248 
00249 private:
00250   //purposely not implemented
00251   JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4( const Self& );
00252   void operator=( const Self& );
00253 
00254   DensityFunctionPointer                   m_MovingDensityFunction;
00255   DensityFunctionPointer                   m_FixedDensityFunction;
00256 
00257   bool                                     m_UseRegularizationTerm;
00258   bool                                     m_UseAnisotropicCovariances;
00259 
00260   RealType                                 m_PointSetSigma;
00261   RealType                                 m_KernelSigma;
00262   unsigned int                             m_CovarianceKNeighborhood;
00263   unsigned int                             m_EvaluationKNeighborhood;
00264 
00265   RealType                                 m_Alpha;
00266 };
00267 
00268 
00269 } // end namespace itk
00270 
00271 #ifndef ITK_MANUAL_INSTANTIATION
00272 #include "itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx"
00273 #endif
00274 
00275 #endif
00276