ITK  4.13.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<typename TPointSet, class TInternalComputationValueType = double>
72  public PointSetToPointSetMetricv4<TPointSet, TPointSet, TInternalComputationValueType>
73 {
74 public:
77  typedef PointSetToPointSetMetricv4<TPointSet, TPointSet,
78  TInternalComputationValueType> Superclass;
81 
83  itkSimpleNewMacro( Self );
84 
87 
88  typedef TPointSet PointSetType;
89  typedef typename PointSetType::PointsContainer PointsContainer;
90  typedef typename PointsContainer::ConstIterator PointsContainerConstIterator;
91 
92  itkStaticConstMacro( PointDimension, unsigned int, TPointSet::PointDimension );
93 
95  typedef typename Superclass::MeasureType MeasureType;
96  typedef typename Superclass::DerivativeType DerivativeType;
97  typedef typename Superclass::DerivativeValueType DerivativeValueType;
98  typedef typename Superclass::LocalDerivativeType LocalDerivativeType;
99  typedef typename Superclass::PointType PointType;
100  typedef typename Superclass::PixelType PixelType;
101  typedef typename Superclass::CoordRepType CoordRepType;
102  typedef typename Superclass::PointIdentifier PointIdentifier;
103  typedef typename Superclass::NeighborsIdentifierType NeighborsIdentifierType;
104  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
105 
106  typedef typename Superclass::JacobianType JacobianType;
107  typedef typename Superclass::FixedTransformJacobianType FixedTransformJacobianType;
108  typedef typename Superclass::MovingTransformJacobianType MovingTransformJacobianType;
109 
111 
119 
122  virtual void Initialize( void ) ITK_OVERRIDE;
123 
133  itkSetClampMacro( Alpha, RealType, 1.0, 2.0 );
134 
138  itkGetConstMacro( Alpha, RealType );
139 
145  itkSetMacro( PointSetSigma, RealType );
146 
148  itkGetConstMacro( PointSetSigma, RealType );
149 
154  itkSetMacro( EvaluationKNeighborhood, unsigned int );
155 
160  itkGetConstMacro( EvaluationKNeighborhood, unsigned int );
161 
166  itkSetMacro( UseAnisotropicCovariances, bool );
167 
172  itkGetConstMacro( UseAnisotropicCovariances, bool );
173 
178  itkBooleanMacro( UseAnisotropicCovariances );
179 
185  itkSetMacro( CovarianceKNeighborhood, unsigned int );
186 
192  itkGetConstMacro( CovarianceKNeighborhood, unsigned int );
193 
201  itkSetMacro( KernelSigma, RealType );
202 
204  itkGetConstMacro( KernelSigma, RealType );
205 
206  virtual MeasureType GetLocalNeighborhoodValue( const PointType & point,
207  const PixelType & pixel = 0 ) const ITK_OVERRIDE;
208 
209  virtual void GetLocalNeighborhoodValueAndDerivative( const PointType &, MeasureType &,
210  LocalDerivativeType &, const PixelType & pixel = 0 ) const ITK_OVERRIDE;
211 
214  virtual typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
215 
216 protected:
218  ~JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4() ITK_OVERRIDE;
219 
220  void ComputeValueAndDerivative( const PointType & samplePoint, MeasureType & value,
221  LocalDerivativeType &derivativeReturn, bool calcValue, bool calcDerivative ) const;
222 
223  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
224 
225 private:
226  ITK_DISALLOW_COPY_AND_ASSIGN(JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4);
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
ManifoldParzenWindowsPointSetFunction< PointSetType, RealType > DensityFunctionType
Light weight base class for most itk classes.
Computes similarity between two point sets.
Point set function based on n-dimensional parzen windowing.
GaussianMembershipFunction models class membership through a multivariate Gaussian function...
PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Implementation of the Jensen Havrda Charvat Tsallis Point Set metric.