ITK  4.2.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 < class TSample, class TRegion >
48  class ITK_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 
76  typedef typename Superclass::RegionType RegionType;
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
136