ITK  5.1.0
Insight Toolkit
itkSpatialNeighborSubsampler.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 itkSpatialNeighborSubsampler_h
19 #define itkSpatialNeighborSubsampler_h
20 
22 #include "itkImageHelper.h"
23 
24 namespace itk
25 {
26 namespace Statistics
27 {
49 template <typename TSample, typename TRegion>
50 class ITK_TEMPLATE_EXPORT SpatialNeighborSubsampler : public RegionConstrainedSubsampler<TSample, TRegion>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_ASSIGN(SpatialNeighborSubsampler);
54 
58  using Baseclass = typename Superclass::Baseclass;
61 
64 
66  itkNewMacro(Self);
67 
69  using SampleType = typename Superclass::SampleType;
70  using SampleConstPointer = typename Superclass::SampleConstPointer;
71  using MeasurementVectorType = typename Superclass::MeasurementVectorType;
72  using InstanceIdentifier = typename Superclass::InstanceIdentifier;
73 
74  using SubsampleType = typename Superclass::SubsampleType;
75  using SubsamplePointer = typename Superclass::SubsamplePointer;
76  using SubsampleConstIterator = typename Superclass::SubsampleConstIterator;
77  using InstanceIdentifierHolder = typename Superclass::InstanceIdentifierHolder;
78 
81  using IndexType = typename Superclass::IndexType;
83  using SizeType = typename Superclass::SizeType;
84  using RadiusType = typename RegionType::SizeType;
85 
86  static constexpr unsigned int ImageDimension = RegionType::ImageDimension;
89 
91  void
92  SetRadius(const RadiusType & radius);
93  void
94  SetRadius(unsigned int radius);
96 
98  itkGetConstReferenceMacro(Radius, RadiusType);
99 
101  itkGetConstReferenceMacro(RadiusInitialized, bool);
102 
108  void
109  Search(const InstanceIdentifier & query, SubsamplePointer & results) override;
110 
111 protected:
117  typename LightObject::Pointer
118  InternalClone() const override;
119 
121  ~SpatialNeighborSubsampler() override = default;
122 
123  void
124  PrintSelf(std::ostream & os, Indent indent) const override;
125 
128 }; // end of class SpatialNeighborSubsampler
129 
130 } // end of namespace Statistics
131 } // end of namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 # include "itkSpatialNeighborSubsampler.hxx"
135 #endif
136 
137 #endif
itkImageHelper.h
itk::Statistics::RegionConstrainedSubsampler::SampleType
TSample SampleType
Definition: itkRegionConstrainedSubsampler.h:69
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:50
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Statistics::RegionConstrainedSubsampler::SubsampleConstIterator
typename SubsampleType::ConstIterator SubsampleConstIterator
Definition: itkRegionConstrainedSubsampler.h:76
itk::Statistics::RegionConstrainedSubsampler::InstanceIdentifierHolder
typename SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
Definition: itkRegionConstrainedSubsampler.h:77
itk::Statistics::RegionConstrainedSubsampler::IndexValueType
typename IndexType::IndexValueType IndexValueType
Definition: itkRegionConstrainedSubsampler.h:82
itk::Statistics::RegionConstrainedSubsampler::MeasurementVectorType
typename TSample::MeasurementVectorType MeasurementVectorType
Definition: itkRegionConstrainedSubsampler.h:71
itk::Statistics::RegionConstrainedSubsampler::Baseclass
typename Superclass::Baseclass Baseclass
Definition: itkRegionConstrainedSubsampler.h:61
itk::Statistics::SpatialNeighborSubsampler::RadiusType
typename RegionType::SizeType RadiusType
Definition: itkSpatialNeighborSubsampler.h:84
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:59
itk::Statistics::RegionConstrainedSubsampler::RegionType
TRegion RegionType
Definition: itkRegionConstrainedSubsampler.h:80
itk::Statistics::RegionConstrainedSubsampler::IndexType
typename RegionType::IndexType IndexType
Definition: itkRegionConstrainedSubsampler.h:81
itk::Statistics::RegionConstrainedSubsampler::SubsamplePointer
typename SubsampleType::Pointer SubsamplePointer
Definition: itkRegionConstrainedSubsampler.h:75
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::Statistics::Subsample
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:41
itk::Statistics::RegionConstrainedSubsampler::SampleConstPointer
typename SampleType::ConstPointer SampleConstPointer
Definition: itkRegionConstrainedSubsampler.h:70
itk::Statistics::RegionConstrainedSubsampler::SizeType
typename RegionType::SizeType SizeType
Definition: itkRegionConstrainedSubsampler.h:83
itk::Statistics::SpatialNeighborSubsampler::m_RadiusInitialized
bool m_RadiusInitialized
Definition: itkSpatialNeighborSubsampler.h:127
itk::ImageHelper
Fast Index/Offset computation.
Definition: itkImageHelper.h:54
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itkRegionConstrainedSubsampler.h
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itk::Statistics::RegionConstrainedSubsampler
This an abstract subsampler that constrains subsamples to be contained within a given image region.
Definition: itkRegionConstrainedSubsampler.h:53
itk::Statistics::RegionConstrainedSubsampler::InstanceIdentifier
typename TSample::InstanceIdentifier InstanceIdentifier
Definition: itkRegionConstrainedSubsampler.h:72
itk::Statistics::SpatialNeighborSubsampler::m_Radius
RadiusType m_Radius
Definition: itkSpatialNeighborSubsampler.h:126