ITK  4.13.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 < typename TSample >
46 class ITK_TEMPLATE_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 
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 ITK_OVERRIDE;
122 
123  SubsamplerBase();
124  virtual ~SubsamplerBase() ITK_OVERRIDE {};
125 
126  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
127 
132 
133 private:
134  ITK_DISALLOW_COPY_AND_ASSIGN(SubsamplerBase);
135 
136 }; // end of class SubsamplerBase
137 
138 } // end of namespace Statistics
139 } // end of namespace itk
140 
141 #ifndef ITK_MANUAL_INSTANTIATION
142 #include "itkSubsamplerBase.hxx"
143 #endif
144 
145 #endif
Light weight base class for most itk classes.
SubsampleType::ConstIterator SubsampleConstIterator
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:41
SampleType::ConstPointer SampleConstPointer
SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
TSample::MeasurementVectorType MeasurementVectorType
Subsample< TSample > SubsampleType
SubsampleType::Pointer SubsamplePointer
A collection of measurements for statistical analysis.
Definition: itkSample.h:61
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TSample::InstanceIdentifier InstanceIdentifier
Base class for most ITK classes.
Definition: itkObject.h:59
SmartPointer< const Self > ConstPointer
virtual void RequestMaximumNumberOfResults()
This is the base subsampler class which defines the subsampler API.
std::vector< InstanceIdentifier > InstanceIdentifierHolder
Definition: itkSubsample.h:74