ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkSubsamplerBase.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 __itkSubsamplerBase_h
19 #define __itkSubsamplerBase_h
20 
21 #include "itkObject.h"
22 #include "itkSample.h"
23 #include "itkSubsample.h"
24 
25 namespace itk {
26 namespace Statistics {
45 template < class TSample >
46 class ITK_EXPORT SubsamplerBase : public Object
47 {
48 public:
51  typedef Object Superclass;
52  typedef Self Baseclass;
55 
57  itkTypeMacro(SubsamplerBase, Object);
58 
60  itkCloneMacro(Self);
61 
63  typedef TSample SampleType;
64  typedef typename SampleType::ConstPointer SampleConstPointer;
65  typedef typename TSample::MeasurementVectorType MeasurementVectorType;
66  typedef typename TSample::InstanceIdentifier InstanceIdentifier;
67 
72  typedef unsigned int SeedType;
73 
75  itkSetConstObjectMacro(Sample, SampleType);
76  itkGetConstObjectMacro(Sample, SampleType);
78 
82  itkSetMacro(CanSelectQuery, bool);
83  itkGetConstReferenceMacro(CanSelectQuery, bool);
84  itkBooleanMacro(CanSelectQuery);
86 
90  itkSetMacro(Seed, SeedType);
91  itkGetConstReferenceMacro(Seed, SeedType);
93 
94 
97  virtual void RequestMaximumNumberOfResults()
98  {
99  if (!this->m_RequestMaximumNumberOfResults)
100  {
101  this->m_RequestMaximumNumberOfResults = true;
102  this->Modified();
103  }
104  }
106 
112  virtual void Search(const InstanceIdentifier& query,
113  SubsamplePointer& results) = 0;
114 
115 protected:
121  virtual typename LightObject::Pointer InternalClone() const;
122 
123  SubsamplerBase();
124  virtual ~SubsamplerBase() {};
125 
126  virtual void PrintSelf(std::ostream& os, Indent indent) const;
127 
132 
133 private:
134  SubsamplerBase(const Self&); // purposely not implemented
135  void operator=(const Self&); // purposely not implemented
136 
137 }; // end of class SubsamplerBase
138 
139 } // end of namespace Statistics
140 } // end of namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 #include "itkSubsamplerBase.hxx"
144 #endif
145 
146 #endif
147