ITK  5.4.0
Insight Toolkit
itkSubsamplerBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 {
27 namespace Statistics
28 {
48 template <typename TSample>
49 class ITK_TEMPLATE_EXPORT SubsamplerBase : public Object
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_MOVE(SubsamplerBase);
53 
56  using Superclass = Object;
57  using Baseclass = Self;
60 
62  itkOverrideGetNameOfClassMacro(SubsamplerBase);
63 
65  itkCloneMacro(Self);
66 
68  using SampleType = TSample;
70  using MeasurementVectorType = typename TSample::MeasurementVectorType;
71  using InstanceIdentifier = typename TSample::InstanceIdentifier;
72 
77  using SeedType = unsigned int;
78 
80  itkSetConstObjectMacro(Sample, SampleType);
81  itkGetConstObjectMacro(Sample, SampleType);
87  itkSetMacro(CanSelectQuery, bool);
88  itkGetConstReferenceMacro(CanSelectQuery, bool);
89  itkBooleanMacro(CanSelectQuery);
95  itkSetMacro(Seed, SeedType);
96  itkGetConstReferenceMacro(Seed, SeedType);
102  virtual void
104  {
105  if (!this->m_RequestMaximumNumberOfResults)
106  {
107  this->m_RequestMaximumNumberOfResults = true;
108  this->Modified();
109  }
110  }
118  virtual void
119  Search(const InstanceIdentifier & query, SubsamplePointer & results) = 0;
120 
121 protected:
127  typename LightObject::Pointer
128  InternalClone() const override;
129 
130  SubsamplerBase();
131  ~SubsamplerBase() override = default;
132 
133  void
134  PrintSelf(std::ostream & os, Indent indent) const override;
135 
136  SampleConstPointer m_Sample{};
137  bool m_RequestMaximumNumberOfResults{};
138  bool m_CanSelectQuery{};
139  SeedType m_Seed{};
140 }; // end of class SubsamplerBase
141 
142 } // end of namespace Statistics
143 } // end of namespace itk
144 
145 #ifndef ITK_MANUAL_INSTANTIATION
146 # include "itkSubsamplerBase.hxx"
147 #endif
148 
149 #endif
itk::Statistics::SubsamplerBase::SampleConstPointer
typename SampleType::ConstPointer SampleConstPointer
Definition: itkSubsamplerBase.h:69
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::Statistics::SubsamplerBase::InstanceIdentifierHolder
typename SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
Definition: itkSubsamplerBase.h:76
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Statistics::SubsamplerBase::InstanceIdentifier
typename TSample::InstanceIdentifier InstanceIdentifier
Definition: itkSubsamplerBase.h:71
itkSubsample.h
itk::Statistics::SubsamplerBase::RequestMaximumNumberOfResults
virtual void RequestMaximumNumberOfResults()
Definition: itkSubsamplerBase.h:103
Self
AddImageFilter Self
Definition: itkAddImageFilter.h:89
itk::Statistics::SubsamplerBase::MeasurementVectorType
typename TSample::MeasurementVectorType MeasurementVectorType
Definition: itkSubsamplerBase.h:70
itk::Statistics::SubsamplerBase::SubsamplePointer
typename SubsampleType::Pointer SubsamplePointer
Definition: itkSubsamplerBase.h:74
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Statistics::Subsample::InstanceIdentifierHolder
std::vector< InstanceIdentifier > InstanceIdentifierHolder
Definition: itkSubsample.h:76
itk::Statistics::SubsamplerBase::SampleType
TSample SampleType
Definition: itkSubsamplerBase.h:68
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::Statistics::SubsamplerBase
This is the base subsampler class which defines the subsampler API.
Definition: itkSubsamplerBase.h:49
itk::Statistics::Subsample
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:42
itkObject.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkSample.h
itk::Statistics::Sample
A collection of measurements for statistical analysis.
Definition: itkSample.h:62
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::Statistics::Subsample::ConstIterator
Definition: itkSubsample.h:153
itk::Statistics::SubsamplerBase::SubsampleConstIterator
typename SubsampleType::ConstIterator SubsampleConstIterator
Definition: itkSubsamplerBase.h:75
itk::Statistics::SubsamplerBase::SeedType
unsigned int SeedType
Definition: itkSubsamplerBase.h:77