ITK  4.6.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 SubsamplerBase : public Object
47 {
48 public:
51  typedef Object Superclass;
52  typedef Self Baseclass;
55 
57  itkTypeMacro(SubsamplerBase, Object);
58 
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  {
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() {};
125 
126  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
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
Light weight base class for most itk classes.
virtual LightObject::Pointer InternalClone() const ITK_OVERRIDE
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
virtual void Modified() const
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
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
virtual void Search(const InstanceIdentifier &query, SubsamplePointer &results)=0
void operator=(const Self &)
Base class for most ITK classes.
Definition: itkObject.h:57
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