ITK  4.6.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 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;
69 
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);
105 
106 protected:
112  virtual typename LightObject::Pointer InternalClone() const;
113 
116 
117  virtual void PrintSelf(std::ostream& os, Indent indent) const;
118 
121 
122 private:
123  SpatialNeighborSubsampler(const Self&); // purposely not implemented
124  void operator=(const Self&); // purposely not implemented
125 
126 }; // end of class SpatialNeighborSubsampler
127 
128 } // end of namespace Statistics
129 } // end of namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 #include "itkSpatialNeighborSubsampler.hxx"
133 #endif
134 
135 #endif
Light weight base class for most itk classes.
SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
RegionConstrainedSubsampler< TSample, TRegion > Superclass
SpatialNeighborSubsampler< TSample, TRegion > Self
Superclass::SubsampleConstIterator SubsampleConstIterator
void SetRadius(const RadiusType &radius)
This an abstract subsampler that constrains subsamples to be contained within a given image region...
virtual void Search(const InstanceIdentifier &query, SubsamplePointer &results)
virtual void PrintSelf(std::ostream &os, Indent indent) const
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
virtual LightObject::Pointer InternalClone() const
ImageHelper< itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> ImageHelperType
Superclass::InstanceIdentifierHolder InstanceIdentifierHolder