ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4_h
19 #define __itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4_h
20 
22 
24 
25 namespace itk {
26 
70 template<class TPointSet>
72  public PointSetToPointSetMetricv4<TPointSet, TPointSet>
73 {
74 public:
80 
82  itkSimpleNewMacro( Self );
83 
86 
87  typedef TPointSet PointSetType;
88  typedef typename PointSetType::PointsContainer PointsContainer;
89  typedef typename PointsContainer::ConstIterator PointsContainerConstIterator;
90 
91  itkStaticConstMacro( PointDimension, unsigned int, TPointSet::PointDimension );
92 
94  typedef typename Superclass::MeasureType MeasureType;
95  typedef typename Superclass::DerivativeType DerivativeType;
96  typedef typename Superclass::DerivativeValueType DerivativeValueType;
97  typedef typename Superclass::LocalDerivativeType LocalDerivativeType;
98  typedef typename Superclass::PointType PointType;
99  typedef typename Superclass::PixelType PixelType;
100  typedef typename Superclass::CoordRepType CoordRepType;
101  typedef typename Superclass::PointIdentifier PointIdentifier;
102  typedef typename Superclass::NeighborsIdentifierType NeighborsIdentifierType;
103  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
104 
105  typedef typename Superclass::JacobianType JacobianType;
106  typedef typename Superclass::FixedTransformJacobianType FixedTransformJacobianType;
107  typedef typename Superclass::MovingTransformJacobianType MovingTransformJacobianType;
108 
110 
118 
121  virtual void Initialize( void ) throw ( ExceptionObject );
122 
132  itkSetClampMacro( Alpha, RealType, 1.0, 2.0 );
133 
137  itkGetConstMacro( Alpha, RealType );
138 
144  itkSetMacro( PointSetSigma, RealType );
145 
147  itkGetConstMacro( PointSetSigma, RealType );
148 
153  itkSetMacro( EvaluationKNeighborhood, unsigned int );
154 
159  itkGetConstMacro( EvaluationKNeighborhood, unsigned int );
160 
165  itkSetMacro( UseAnisotropicCovariances, bool );
166 
171  itkGetConstMacro( UseAnisotropicCovariances, bool );
172 
177  itkBooleanMacro( UseAnisotropicCovariances );
178 
184  itkSetMacro( CovarianceKNeighborhood, unsigned int );
185 
191  itkGetConstMacro( CovarianceKNeighborhood, unsigned int );
192 
200  itkSetMacro( KernelSigma, RealType );
201 
203  itkGetConstMacro( KernelSigma, RealType );
204 
205  virtual MeasureType GetLocalNeighborhoodValue( const PointType & point, const PixelType & pixel = 0 ) const;
206 
207  virtual void GetLocalNeighborhoodValueAndDerivative( const PointType &, MeasureType &, LocalDerivativeType &, const PixelType & pixel = 0 ) const;
208 
211  virtual ::itk::LightObject::Pointer Clone( void ) const;
212 
213 protected:
215  ~JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4();
216 
217  virtual void InitializeForIteration( void ) const;
218 
219  void ComputeValueAndDerivative( const PointType & samplePoint, MeasureType &value, LocalDerivativeType &derivativeReturn, bool calcValue, bool calcDerivative ) const;
220 
221  void PrintSelf( std::ostream& os, Indent indent ) const;
222 
223 private:
224  //purposely not implemented
225  JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4( const Self& );
226  void operator=( const Self& );
227 
228  DensityFunctionPointer m_MovingDensityFunction;
229  DensityFunctionPointer m_FixedDensityFunction;
230 
231  bool m_UseAnisotropicCovariances;
232 
233  RealType m_PointSetSigma;
234  RealType m_KernelSigma;
235  unsigned int m_CovarianceKNeighborhood;
236  unsigned int m_EvaluationKNeighborhood;
237 
238  RealType m_Alpha;
239 
241  mutable RealType m_TotalNumberOfPoints;
242  mutable RealType m_Prefactor0;
243  mutable RealType m_Prefactor1;
244 };
245 
246 
247 } // end namespace itk
248 
249 #ifndef ITK_MANUAL_INSTANTIATION
250 #include "itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx"
251 #endif
252 
253 #endif
254