ITK  6.0.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
25namespace itk
26{
27namespace Statistics
28{
48template <typename TSample>
49class ITK_TEMPLATE_EXPORT SubsamplerBase : public Object
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(SubsamplerBase);
53
57 using Baseclass = Self;
60
62 itkOverrideGetNameOfClassMacro(SubsamplerBase);
63
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
121protected:
127 typename LightObject::Pointer
128 InternalClone() const override;
129
131 ~SubsamplerBase() override = default;
132
133 void
134 PrintSelf(std::ostream & os, Indent indent) const override;
135
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
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
A collection of measurements for statistical analysis.
Definition: itkSample.h:63
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:43
std::vector< InstanceIdentifier > InstanceIdentifierHolder
Definition: itkSubsample.h:76
This is the base subsampler class which defines the subsampler API.
typename TSample::InstanceIdentifier InstanceIdentifier
void PrintSelf(std::ostream &os, Indent indent) const override
typename SampleType::ConstPointer SampleConstPointer
typename SubsampleType::ConstIterator SubsampleConstIterator
virtual void Search(const InstanceIdentifier &query, SubsamplePointer &results)=0
typename SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
typename SubsampleType::Pointer SubsamplePointer
typename TSample::MeasurementVectorType MeasurementVectorType
~SubsamplerBase() override=default
LightObject::Pointer InternalClone() const override
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
AddImageFilter Self
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....