ITK  5.4.0
Insight Toolkit
itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 {
27 
71 template <typename TPointSet, class TInternalComputationValueType = double>
73  : public PointSetToPointSetMetricv4<TPointSet, TPointSet, TInternalComputationValueType>
74 {
75 public:
76  ITK_DISALLOW_COPY_AND_MOVE(JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4);
77 
83 
85  itkSimpleNewMacro(Self);
86 
88  itkOverrideGetNameOfClassMacro(JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4);
89 
90  using PointSetType = TPointSet;
91  using PointsContainer = typename PointSetType::PointsContainer;
92  using PointsContainerConstIterator = typename PointsContainer::ConstIterator;
93 
94  static constexpr unsigned int PointDimension = TPointSet::PointDimension;
95 
97  using typename Superclass::MeasureType;
98  using typename Superclass::DerivativeType;
99  using typename Superclass::DerivativeValueType;
100  using typename Superclass::LocalDerivativeType;
101  using typename Superclass::PointType;
102  using typename Superclass::PixelType;
103  using typename Superclass::CoordRepType;
104  using typename Superclass::PointIdentifier;
105  using typename Superclass::NeighborsIdentifierType;
106  using typename Superclass::NumberOfParametersType;
107 
108  using typename Superclass::JacobianType;
109  using typename Superclass::FixedTransformJacobianType;
110  using typename Superclass::MovingTransformJacobianType;
111 
113 
120 
122  void
123  Initialize() override;
124 
134  itkSetClampMacro(Alpha, RealType, 1.0, 2.0);
135 
139  itkGetConstMacro(Alpha, RealType);
140 
146  itkSetMacro(PointSetSigma, RealType);
147 
149  itkGetConstMacro(PointSetSigma, RealType);
150 
155  itkSetMacro(EvaluationKNeighborhood, unsigned int);
156 
161  itkGetConstMacro(EvaluationKNeighborhood, unsigned int);
162 
167  itkSetMacro(UseAnisotropicCovariances, bool);
168 
173  itkGetConstMacro(UseAnisotropicCovariances, bool);
174 
179  itkBooleanMacro(UseAnisotropicCovariances);
180 
186  itkSetMacro(CovarianceKNeighborhood, unsigned int);
187 
193  itkGetConstMacro(CovarianceKNeighborhood, unsigned int);
194 
202  itkSetMacro(KernelSigma, RealType);
203 
205  itkGetConstMacro(KernelSigma, RealType);
206 
208  GetLocalNeighborhoodValue(const PointType & point, const PixelType & pixel = 0) const override;
209 
211  void
212  GetLocalNeighborhoodValueAndDerivative(const PointType &,
213  MeasureType &,
215  const PixelType & pixel = 0) const override;
216 
219  typename LightObject::Pointer
220  InternalClone() const override;
221 
222 protected:
225 
226  void
227  ComputeValueAndDerivative(const PointType & samplePoint,
228  MeasureType & value,
229  LocalDerivativeType & derivativeReturn,
230  bool calcValue,
231  bool calcDerivative) const;
232 
233  void
234  PrintSelf(std::ostream & os, Indent indent) const override;
235 
236  bool
237  RequiresFixedPointsLocator() const override
238  {
239  return false;
240  }
241 
242  bool
244  {
245  return false;
246  }
247 
248 private:
249  DensityFunctionPointer m_MovingDensityFunction{};
250 
251  bool m_UseAnisotropicCovariances{ false };
252 
253  RealType m_PointSetSigma{};
254  RealType m_KernelSigma{};
255  unsigned int m_CovarianceKNeighborhood{};
256  unsigned int m_EvaluationKNeighborhood{};
257 
258  RealType m_Alpha{};
259 
261  mutable RealType m_TotalNumberOfPoints{};
262  mutable RealType m_Prefactor0{};
263  mutable RealType m_Prefactor1{};
264 };
265 
266 
267 } // end namespace itk
268 
269 #ifndef ITK_MANUAL_INSTANTIATION
270 # include "itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx"
271 #endif
272 
273 #endif
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::PointsContainerConstIterator
typename PointsContainer::ConstIterator PointsContainerConstIterator
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:92
itk::PointSetToPointSetMetricWithIndexv4< TPointSet, TPointSet, TInternalComputationValueType >::PixelType
FixedPixelType PixelType
Definition: itkPointSetToPointSetMetricWithIndexv4.h:153
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::PointsContainer
typename PointSetType::PointsContainer PointsContainer
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:91
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::DensityFunctionPointer
typename DensityFunctionType::Pointer DensityFunctionPointer
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:119
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::ManifoldParzenWindowsPointSetFunction
Point set function based on n-dimensional parzen windowing.
Definition: itkManifoldParzenWindowsPointSetFunction.h:46
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ManifoldParzenWindowsPointSetFunction::GaussianType
typename Statistics::GaussianMembershipFunction< PointType > GaussianType
Definition: itkManifoldParzenWindowsPointSetFunction.h:80
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::RealType
MeasureType RealType
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:112
itk::SingleValuedCostFunctionv4Template::MeasureType
TInternalComputationValueType MeasureType
Definition: itkSingleValuedCostFunctionv4.h:67
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::RequiresMovingPointsLocator
bool RequiresMovingPointsLocator() const override
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:243
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::PointSetType
TPointSet PointSetType
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:90
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4
Implementation of the Jensen Havrda Charvat Tsallis Point Set metric.
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:72
itkPointSetToPointSetMetricv4.h
itk::FixedArray
Simulate a standard C array with copy semantics.
Definition: itkFixedArray.h:53
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::GaussianType
typename DensityFunctionType::GaussianType GaussianType
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:118
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkManifoldParzenWindowsPointSetFunction.h
itk::PointSetToPointSetMetricWithIndexv4< TPointSet, TPointSet, TInternalComputationValueType >::PointType
FixedPointType PointType
Definition: itkPointSetToPointSetMetricWithIndexv4.h:152
itk::PointSetToPointSetMetricv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricv4.h:68
itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::RequiresFixedPointsLocator
bool RequiresFixedPointsLocator() const override
Definition: itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.h:237