ITK  5.0.0
Insight Segmentation and Registration 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 namespace Statistics {
47 template < typename TSample, typename TRegion >
48  class ITK_TEMPLATE_EXPORT SpatialNeighborSubsampler : public RegionConstrainedSubsampler<TSample, TRegion>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_ASSIGN(SpatialNeighborSubsampler);
52 
56  using Baseclass = typename Superclass::Baseclass;
59 
62 
64  itkNewMacro(Self);
65 
67  using SampleType = typename Superclass::SampleType;
68  using SampleConstPointer = typename Superclass::SampleConstPointer;
69  using MeasurementVectorType = typename Superclass::MeasurementVectorType;
70  using InstanceIdentifier = typename Superclass::InstanceIdentifier;
71 
72  using SubsampleType = typename Superclass::SubsampleType;
73  using SubsamplePointer = typename Superclass::SubsamplePointer;
74  using SubsampleConstIterator = typename Superclass::SubsampleConstIterator;
75  using InstanceIdentifierHolder = typename Superclass::InstanceIdentifierHolder;
76 
79  using IndexType = typename Superclass::IndexType;
81  using SizeType = typename Superclass::SizeType;
82  using RadiusType = typename RegionType::SizeType;
83 
84  static constexpr unsigned int ImageDimension = RegionType::ImageDimension;
86  using ImageHelperType = ImageHelper<Self::ImageDimension,
87  Self::ImageDimension>;
88 
90  void SetRadius(const RadiusType& radius);
91  void SetRadius(unsigned int radius);
93 
95  itkGetConstReferenceMacro(Radius, RadiusType);
96 
98  itkGetConstReferenceMacro(RadiusInitialized, bool);
99 
105  void Search(const InstanceIdentifier& query,
106  SubsamplePointer& results) override;
107 
108 protected:
114  typename LightObject::Pointer InternalClone() const override;
115 
117  ~SpatialNeighborSubsampler() override = default;
118 
119  void PrintSelf(std::ostream& os, Indent indent) const override;
120 
123 }; // end of class SpatialNeighborSubsampler
124 
125 } // end of namespace Statistics
126 } // end of namespace itk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 #include "itkSpatialNeighborSubsampler.hxx"
130 #endif
131 
132 #endif
typename TSample::InstanceIdentifier InstanceIdentifier
Light weight base class for most itk classes.
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:41
typename TSample::MeasurementVectorType MeasurementVectorType
This an abstract subsampler that constrains subsamples to be contained within a given image region...
signed long IndexValueType
Definition: itkIntTypes.h:90
A subsampler that selects all points within the specified radius of the query point.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
Fast Index/Offset computation.
typename SubsampleType::ConstIterator SubsampleConstIterator