ITK  5.4.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 TCoordRep = double>
46 class ITK_TEMPLATE_EXPORT ManifoldParzenWindowsPointSetFunction : public PointSetFunction<TPointSet, TOutput, TCoordRep>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(ManifoldParzenWindowsPointSetFunction);
50 
55 
57  itkNewMacro(Self);
58 
60  static constexpr unsigned int PointDimension = TPointSet::PointDimension;
61 
62  using typename Superclass::InputPointSetType;
63  using typename Superclass::InputPointType;
64 
66  using PointSetType = TPointSet;
68  using PointsContainer = typename PointSetType::PointsContainer;
69  using PointIdentifier = typename PointsContainer::ElementIdentifier;
70 
72  using RealType = TOutput;
73  using OutputType = TOutput;
74  using CoordRepType = TCoordRep;
75 
79 
83  using GaussianContainerType = std::vector<GaussianPointer>;
84  using CovarianceMatrixType = typename GaussianType::CovarianceMatrixType;
85 
93  itkSetMacro(CovarianceKNeighborhood, unsigned int);
94 
96  itkGetConstMacro(CovarianceKNeighborhood, unsigned int);
97 
104  itkSetMacro(EvaluationKNeighborhood, unsigned int);
105 
107  itkGetConstMacro(EvaluationKNeighborhood, unsigned int);
108 
113  itkSetMacro(RegularizationSigma, RealType);
114 
116  itkGetConstMacro(RegularizationSigma, RealType);
117 
123  itkSetMacro(KernelSigma, RealType);
124 
126  itkGetConstMacro(KernelSigma, RealType);
127 
132  itkSetMacro(Normalize, bool);
133 
138  itkGetConstMacro(Normalize, bool);
139 
144  itkBooleanMacro(Normalize);
145 
151  itkSetMacro(UseAnisotropicCovariances, bool);
152 
158  itkGetConstMacro(UseAnisotropicCovariances, bool);
159 
165  itkBooleanMacro(UseAnisotropicCovariances);
166 
168  void
169  SetInputPointSet(const InputPointSetType *) override;
170 
172  TOutput
173  Evaluate(const InputPointType &) const override;
174 
176  GaussianConstPointer GetGaussian(PointIdentifier) const;
177 
179  itkGetModifiableObjectMacro(PointsLocator, PointsLocatorType);
180 
181 protected:
183  ~ManifoldParzenWindowsPointSetFunction() override = default;
184  void
185  PrintSelf(std::ostream & os, Indent indent) const override;
186 
187  void
188  GenerateData();
189 
190 private:
191  typename PointsLocatorType::Pointer m_PointsLocator{};
192 
193  unsigned int m_CovarianceKNeighborhood{ 5 };
194  unsigned int m_EvaluationKNeighborhood{ 50 };
195  RealType m_RegularizationSigma{};
196  RealType m_KernelSigma{};
197 
198  GaussianContainerType m_Gaussians{};
199  bool m_Normalize{ true };
200  bool m_UseAnisotropicCovariances{ true };
201 
202  MultiThreaderBase::Pointer m_MultiThreader{};
203 };
204 
205 } // end namespace itk
206 
207 #ifndef ITK_MANUAL_INSTANTIATION
208 # include "itkManifoldParzenWindowsPointSetFunction.hxx"
209 #endif
210 
211 #endif
itk::PointsLocator::NeighborsIdentifierType
typename TreeType::InstanceIdentifierVectorType NeighborsIdentifierType
Definition: itkPointsLocator.h:82
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
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::ManifoldParzenWindowsPointSetFunction::CoordRepType
TCoordRep CoordRepType
Definition: itkManifoldParzenWindowsPointSetFunction.h:74
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:80
itk::ManifoldParzenWindowsPointSetFunction::OutputType
TOutput OutputType
Definition: itkManifoldParzenWindowsPointSetFunction.h:73
itk::ManifoldParzenWindowsPointSetFunction::GaussianContainerType
std::vector< GaussianPointer > GaussianContainerType
Definition: itkManifoldParzenWindowsPointSetFunction.h:83
itkPointsLocator.h
itk::ManifoldParzenWindowsPointSetFunction::RealType
TOutput RealType
Definition: itkManifoldParzenWindowsPointSetFunction.h:72
itk::ManifoldParzenWindowsPointSetFunction::CovarianceMatrixType
typename GaussianType::CovarianceMatrixType CovarianceMatrixType
Definition: itkManifoldParzenWindowsPointSetFunction.h:84
itk::ManifoldParzenWindowsPointSetFunction::PointSetType
TPointSet PointSetType
Definition: itkManifoldParzenWindowsPointSetFunction.h:66
itk::ManifoldParzenWindowsPointSetFunction::GaussianPointer
typename GaussianType::Pointer GaussianPointer
Definition: itkManifoldParzenWindowsPointSetFunction.h:81
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::ManifoldParzenWindowsPointSetFunction::PointIdentifier
typename PointsContainer::ElementIdentifier PointIdentifier
Definition: itkManifoldParzenWindowsPointSetFunction.h:69
itk::ManifoldParzenWindowsPointSetFunction::NeighborsIdentifierType
typename PointsLocatorType::NeighborsIdentifierType NeighborsIdentifierType
Definition: itkManifoldParzenWindowsPointSetFunction.h:78
itk::PointSetFunction
Evaluates a function of an image at specified position.
Definition: itkPointSetFunction.h:56
itk::ManifoldParzenWindowsPointSetFunction::PointType
typename PointSetType::PointType PointType
Definition: itkManifoldParzenWindowsPointSetFunction.h:67
itk::PointSetFunction< TPointSet, TOutput, TCoordRep >::InputPointSetType
TPointSet InputPointSetType
Definition: itkPointSetFunction.h:74
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: itkAnnulusOperator.h:24
itkMultiThreaderBase.h
itk::ManifoldParzenWindowsPointSetFunction::PointsContainer
typename PointSetType::PointsContainer PointsContainer
Definition: itkManifoldParzenWindowsPointSetFunction.h:68
itkVector.h
itk::ManifoldParzenWindowsPointSetFunction::GaussianConstPointer
typename GaussianType::ConstPointer GaussianConstPointer
Definition: itkManifoldParzenWindowsPointSetFunction.h:82
itkPointSet.h
itk::PointSetFunction< TPointSet, TOutput, TCoordRep >::InputPointType
typename InputPointSetType::PointType InputPointType
Definition: itkPointSetFunction.h:77