ITK  5.4.0
Insight Toolkit
itkSpatialNeighborSubsampler.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 itkSpatialNeighborSubsampler_h
19 #define itkSpatialNeighborSubsampler_h
20 
22 #include "itkImageHelper.h"
23 
24 namespace itk
25 {
26 namespace Statistics
27 {
50 template <typename TSample, typename TRegion>
51 class ITK_TEMPLATE_EXPORT SpatialNeighborSubsampler : public RegionConstrainedSubsampler<TSample, TRegion>
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_MOVE(SpatialNeighborSubsampler);
55 
59  using Baseclass = typename Superclass::Baseclass;
62 
64  itkOverrideGetNameOfClassMacro(SpatialNeighborSubsampler);
65 
67  itkNewMacro(Self);
68 
70  using typename Superclass::SampleType;
71  using typename Superclass::SampleConstPointer;
72  using typename Superclass::MeasurementVectorType;
73  using typename Superclass::InstanceIdentifier;
74 
75  using typename Superclass::SubsampleType;
76  using typename Superclass::SubsamplePointer;
77  using typename Superclass::SubsampleConstIterator;
78  using typename Superclass::InstanceIdentifierHolder;
79 
81  using typename Superclass::RegionType;
82  using typename Superclass::IndexType;
83  using typename Superclass::IndexValueType;
84  using typename Superclass::SizeType;
85  using RadiusType = typename RegionType::SizeType;
86 
87  static constexpr unsigned int ImageDimension = RegionType::ImageDimension;
90 
92  void
93  SetRadius(const RadiusType & radius);
94  void
95  SetRadius(unsigned int radius);
99  itkGetConstReferenceMacro(Radius, RadiusType);
100 
102  itkGetConstReferenceMacro(RadiusInitialized, bool);
103 
109  void
110  Search(const InstanceIdentifier & query, SubsamplePointer & results) override;
111 
112 protected:
118  typename LightObject::Pointer
119  InternalClone() const override;
120 
122  ~SpatialNeighborSubsampler() override = default;
123 
124  void
125  PrintSelf(std::ostream & os, Indent indent) const override;
126 
127  RadiusType m_Radius{};
128  bool m_RadiusInitialized{};
129 }; // end of class SpatialNeighborSubsampler
130 
131 } // end of namespace Statistics
132 } // end of namespace itk
133 
134 #ifndef ITK_MANUAL_INSTANTIATION
135 # include "itkSpatialNeighborSubsampler.hxx"
136 #endif
137 
138 #endif
itkImageHelper.h
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::Statistics::SpatialNeighborSubsampler
A subsampler that selects all points within the specified radius of the query point.
Definition: itkSpatialNeighborSubsampler.h:51
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Statistics::RegionConstrainedSubsampler::Baseclass
typename Superclass::Baseclass Baseclass
Definition: itkRegionConstrainedSubsampler.h:62
itk::IndexValueType
long IndexValueType
Definition: itkIntTypes.h:90
itk::Statistics::SpatialNeighborSubsampler::RadiusType
typename RegionType::SizeType RadiusType
Definition: itkSpatialNeighborSubsampler.h:85
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::Statistics::RegionConstrainedSubsampler::SubsamplePointer
typename SubsampleType::Pointer SubsamplePointer
Definition: itkRegionConstrainedSubsampler.h:76
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageHelper
Fast Index/Offset computation.
Definition: itkImageHelper.h:53
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkRegionConstrainedSubsampler.h
itk::Statistics::RegionConstrainedSubsampler
This an abstract subsampler that constrains subsamples to be contained within a given image region.
Definition: itkRegionConstrainedSubsampler.h:54
itk::Statistics::RegionConstrainedSubsampler::InstanceIdentifier
typename TSample::InstanceIdentifier InstanceIdentifier
Definition: itkRegionConstrainedSubsampler.h:73