ITK  6.0.0
Insight Toolkit
itkManifoldParzenWindowsPointSetFunction.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 itkManifoldParzenWindowsPointSetFunction_h
19 #define itkManifoldParzenWindowsPointSetFunction_h
20 
21 #include "itkPointSetFunction.h"
22 
24 #include "itkMatrix.h"
25 #include "itkPointSet.h"
26 #include "itkPointsLocator.h"
27 #include "itkVector.h"
28 #include "itkMultiThreaderBase.h"
29 
30 #include <vector>
31 
32 namespace itk
33 {
34 
45 template <typename TPointSet, typename TOutput = double, typename TCoordinate = double>
46 class ITK_TEMPLATE_EXPORT ManifoldParzenWindowsPointSetFunction
47  : public PointSetFunction<TPointSet, TOutput, TCoordinate>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(ManifoldParzenWindowsPointSetFunction);
51 
56 
58  itkNewMacro(Self);
59 
61  static constexpr unsigned int PointDimension = TPointSet::PointDimension;
62 
63  using typename Superclass::InputPointSetType;
64  using typename Superclass::InputPointType;
65 
67  using PointSetType = TPointSet;
69  using PointsContainer = typename PointSetType::PointsContainer;
70  using PointIdentifier = typename PointsContainer::ElementIdentifier;
71 
73  using RealType = TOutput;
74  using OutputType = TOutput;
75  using CoordinateType = TCoordinate;
76 #ifndef ITK_FUTURE_LEGACY_REMOVE
77  using CoordRepType ITK_FUTURE_DEPRECATED(
78  "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
79 #endif
80 
84 
88  using GaussianContainerType = std::vector<GaussianPointer>;
89  using CovarianceMatrixType = typename GaussianType::CovarianceMatrixType;
90 
98  itkSetMacro(CovarianceKNeighborhood, unsigned int);
99 
101  itkGetConstMacro(CovarianceKNeighborhood, unsigned int);
102 
109  itkSetMacro(EvaluationKNeighborhood, unsigned int);
110 
112  itkGetConstMacro(EvaluationKNeighborhood, unsigned int);
113 
118  itkSetMacro(RegularizationSigma, RealType);
119 
121  itkGetConstMacro(RegularizationSigma, RealType);
122 
128  itkSetMacro(KernelSigma, RealType);
129 
131  itkGetConstMacro(KernelSigma, RealType);
132 
137  itkSetMacro(Normalize, bool);
138 
143  itkGetConstMacro(Normalize, bool);
144 
149  itkBooleanMacro(Normalize);
150 
156  itkSetMacro(UseAnisotropicCovariances, bool);
157 
163  itkGetConstMacro(UseAnisotropicCovariances, bool);
164 
170  itkBooleanMacro(UseAnisotropicCovariances);
171 
173  void
174  SetInputPointSet(const InputPointSetType *) override;
175 
177  TOutput
178  Evaluate(const InputPointType &) const override;
179 
181  GaussianConstPointer GetGaussian(PointIdentifier) const;
182 
184  itkGetModifiableObjectMacro(PointsLocator, PointsLocatorType);
185 
186 protected:
188  ~ManifoldParzenWindowsPointSetFunction() override = default;
189  void
190  PrintSelf(std::ostream & os, Indent indent) const override;
191 
192  void
193  GenerateData();
194 
195 private:
196  typename PointsLocatorType::Pointer m_PointsLocator{};
197 
198  unsigned int m_CovarianceKNeighborhood{ 5 };
199  unsigned int m_EvaluationKNeighborhood{ 50 };
200  RealType m_RegularizationSigma{};
201  RealType m_KernelSigma{};
202 
203  GaussianContainerType m_Gaussians{};
204  bool m_Normalize{ true };
205  bool m_UseAnisotropicCovariances{ true };
206 
207  MultiThreaderBase::Pointer m_MultiThreader{};
208 };
209 
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 # include "itkManifoldParzenWindowsPointSetFunction.hxx"
214 #endif
215 
216 #endif
itk::PointsLocator::NeighborsIdentifierType
typename TreeType::InstanceIdentifierVectorType NeighborsIdentifierType
Definition: itkPointsLocator.h:82
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ManifoldParzenWindowsPointSetFunction::RealType
TOutput RealType
Definition: itkManifoldParzenWindowsPointSetFunction.h:73
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ManifoldParzenWindowsPointSetFunction::GaussianConstPointer
typename GaussianType::ConstPointer GaussianConstPointer
Definition: itkManifoldParzenWindowsPointSetFunction.h:87
itkMatrix.h
itkGaussianMembershipFunction.h
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
itkPointSetFunction.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::PointsLocator
Accelerate geometric searches for points.
Definition: itkPointsLocator.h:42
itk::ManifoldParzenWindowsPointSetFunction::GaussianType
typename Statistics::GaussianMembershipFunction< PointType > GaussianType
Definition: itkManifoldParzenWindowsPointSetFunction.h:85
itkPointsLocator.h
itk::ManifoldParzenWindowsPointSetFunction::PointSetType
TPointSet PointSetType
Definition: itkManifoldParzenWindowsPointSetFunction.h:67
itk::ManifoldParzenWindowsPointSetFunction::PointIdentifier
typename PointsContainer::ElementIdentifier PointIdentifier
Definition: itkManifoldParzenWindowsPointSetFunction.h:70
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::PointSetFunction
Evaluates a function of an image at specified position.
Definition: itkPointSetFunction.h:56
itk::ManifoldParzenWindowsPointSetFunction::CovarianceMatrixType
typename GaussianType::CovarianceMatrixType CovarianceMatrixType
Definition: itkManifoldParzenWindowsPointSetFunction.h:89
itk::ManifoldParzenWindowsPointSetFunction::OutputType
TOutput OutputType
Definition: itkManifoldParzenWindowsPointSetFunction.h:74
itk::ManifoldParzenWindowsPointSetFunction::PointType
typename PointSetType::PointType PointType
Definition: itkManifoldParzenWindowsPointSetFunction.h:68
itk::PointSetFunction< TPointSet, TOutput, TCoordinate >::InputPointType
typename InputPointSetType::PointType InputPointType
Definition: itkPointSetFunction.h:77
itk::Statistics::GaussianMembershipFunction
GaussianMembershipFunction models class membership through a multivariate Gaussian function.
Definition: itkGaussianMembershipFunction.h:56
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itkMultiThreaderBase.h
itk::ManifoldParzenWindowsPointSetFunction::GaussianPointer
typename GaussianType::Pointer GaussianPointer
Definition: itkManifoldParzenWindowsPointSetFunction.h:86
itkVector.h
itk::ManifoldParzenWindowsPointSetFunction::NeighborsIdentifierType
typename PointsLocatorType::NeighborsIdentifierType NeighborsIdentifierType
Definition: itkManifoldParzenWindowsPointSetFunction.h:83
itk::ManifoldParzenWindowsPointSetFunction::PointsContainer
typename PointSetType::PointsContainer PointsContainer
Definition: itkManifoldParzenWindowsPointSetFunction.h:69
itk::ManifoldParzenWindowsPointSetFunction::GaussianContainerType
std::vector< GaussianPointer > GaussianContainerType
Definition: itkManifoldParzenWindowsPointSetFunction.h:88
itkPointSet.h
itk::PointSetFunction< TPointSet, TOutput, TCoordinate >::InputPointSetType
TPointSet InputPointSetType
Definition: itkPointSetFunction.h:74
itk::ManifoldParzenWindowsPointSetFunction::CoordinateType
TCoordinate CoordinateType
Definition: itkManifoldParzenWindowsPointSetFunction.h:75