ITK  4.2.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  itkNewMacro( 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::CoordRepType CoordRepType;
100  typedef typename Superclass::PointIdentifier PointIdentifier;
101  typedef typename Superclass::NeighborsIdentifierType NeighborsIdentifierType;
102  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
103 
104  typedef typename Superclass::JacobianType JacobianType;
105  typedef typename Superclass::FixedTransformJacobianType FixedTransformJacobianType;
106  typedef typename Superclass::MovingTransformJacobianType MovingTransformJacobianType;
107 
109 
117 
120  virtual void Initialize( void ) throw ( ExceptionObject );
121 
131  itkSetClampMacro( Alpha, RealType, 1.0, 2.0 );
132 
136  itkGetConstMacro( Alpha, RealType );
137 
143  itkSetMacro( PointSetSigma, RealType );
144 
146  itkGetConstMacro( PointSetSigma, RealType );
147 
152  itkSetMacro( EvaluationKNeighborhood, unsigned int );
153 
158  itkGetConstMacro( EvaluationKNeighborhood, unsigned int );
159 
164  itkSetMacro( UseAnisotropicCovariances, bool );
165 
170  itkGetConstMacro( UseAnisotropicCovariances, bool );
171 
176  itkBooleanMacro( UseAnisotropicCovariances );
177 
183  itkSetMacro( CovarianceKNeighborhood, unsigned int );
184 
190  itkGetConstMacro( CovarianceKNeighborhood, unsigned int );
191 
199  itkSetMacro( KernelSigma, RealType );
200 
202  itkGetConstMacro( KernelSigma, RealType );
203 
204  virtual MeasureType GetLocalNeighborhoodValue( const PointType & point) const;
205 
206  virtual void GetLocalNeighborhoodValueAndDerivative( const PointType &, MeasureType &, LocalDerivativeType & ) const;
207 
208 protected:
210  ~JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4();
211 
212  virtual void InitializeForIteration( void ) const;
213 
214  void ComputeValueAndDerivative( const PointType & samplePoint, MeasureType &value, LocalDerivativeType &derivativeReturn, bool calcValue, bool calcDerivative ) const;
215 
216  void PrintSelf( std::ostream& os, Indent indent ) const;
217 
218 private:
219  //purposely not implemented
220  JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4( const Self& );
221  void operator=( const Self& );
222 
223  DensityFunctionPointer m_MovingDensityFunction;
224  DensityFunctionPointer m_FixedDensityFunction;
225 
226  bool m_UseAnisotropicCovariances;
227 
228  RealType m_PointSetSigma;
229  RealType m_KernelSigma;
230  unsigned int m_CovarianceKNeighborhood;
231  unsigned int m_EvaluationKNeighborhood;
232 
233  RealType m_Alpha;
234 
236  mutable RealType m_TotalNumberOfPoints;
237  mutable RealType m_Prefactor0;
238  mutable RealType m_Prefactor1;
239 };
240 
241 
242 } // end namespace itk
243 
244 #ifndef ITK_MANUAL_INSTANTIATION
245 #include "itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx"
246 #endif
247 
248 #endif
249