ITK  4.13.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:
54  typedef typename Superclass::Baseclass Baseclass;
57 
60 
62  itkNewMacro(Self);
63 
65  typedef typename Superclass::SampleType SampleType;
66  typedef typename Superclass::SampleConstPointer SampleConstPointer;
67  typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
68  typedef typename Superclass::InstanceIdentifier InstanceIdentifier;
69 
70  typedef typename Superclass::SubsampleType SubsampleType;
71  typedef typename Superclass::SubsamplePointer SubsamplePointer;
72  typedef typename Superclass::SubsampleConstIterator SubsampleConstIterator;
73  typedef typename Superclass::InstanceIdentifierHolder InstanceIdentifierHolder;
74 
77  typedef typename Superclass::IndexType IndexType;
79  typedef typename Superclass::SizeType SizeType;
80  typedef typename RegionType::SizeType RadiusType;
81 
82  itkStaticConstMacro(ImageDimension, unsigned int, RegionType::ImageDimension);
84  typedef ImageHelper<itkGetStaticConstMacro(ImageDimension),
85  itkGetStaticConstMacro(ImageDimension)> ImageHelperType;
86 
88  void SetRadius(const RadiusType& radius);
89  void SetRadius(unsigned int radius);
91 
93  itkGetConstReferenceMacro(Radius, RadiusType);
94 
96  itkGetConstReferenceMacro(RadiusInitialized, bool);
97 
103  virtual void Search(const InstanceIdentifier& query,
104  SubsamplePointer& results) ITK_OVERRIDE;
105 
106 protected:
112  virtual typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
113 
115  virtual ~SpatialNeighborSubsampler() ITK_OVERRIDE {};
116 
117  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
118 
121 
122 private:
123  ITK_DISALLOW_COPY_AND_ASSIGN(SpatialNeighborSubsampler);
124 
125 }; // end of class SpatialNeighborSubsampler
126 
127 } // end of namespace Statistics
128 } // end of namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkSpatialNeighborSubsampler.hxx"
132 #endif
133 
134 #endif
Light weight base class for most itk classes.
signed long IndexValueType
Definition: itkIntTypes.h:150
RegionConstrainedSubsampler< TSample, TRegion > Superclass
SpatialNeighborSubsampler< TSample, TRegion > Self
Superclass::SubsampleConstIterator SubsampleConstIterator
This an abstract subsampler that constrains subsamples to be contained within a given image region...
A subsampler that selects all points within the specified radius of the query point.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Fast Index/Offset computation.
Superclass::MeasurementVectorType MeasurementVectorType
ImageHelper< itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> ImageHelperType
Superclass::InstanceIdentifierHolder InstanceIdentifierHolder