ITK  6.0.0
Insight Toolkit
itkRegionConstrainedSubsampler.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 itkRegionConstrainedSubsampler_h
19#define itkRegionConstrainedSubsampler_h
20
21#include "itkSubsamplerBase.h"
22#include "itkImageRegion.h"
23
24namespace itk
25{
26namespace Statistics
27{
53template <typename TSample, typename TRegion>
54class ITK_TEMPLATE_EXPORT RegionConstrainedSubsampler : public SubsamplerBase<TSample>
55{
56public:
57 ITK_DISALLOW_COPY_AND_MOVE(RegionConstrainedSubsampler);
58
62 using Baseclass = typename Superclass::Baseclass;
65
67 itkOverrideGetNameOfClassMacro(RegionConstrainedSubsampler);
68
70 using SampleType = TSample;
72 using MeasurementVectorType = typename TSample::MeasurementVectorType;
73 using InstanceIdentifier = typename TSample::InstanceIdentifier;
74
79
81 using RegionType = TRegion;
85
88 void
89 SetSampleRegion(const RegionType & region);
90
92 itkGetConstReferenceMacro(SampleRegion, RegionType);
93
95 itkGetConstReferenceMacro(SampleRegionInitialized, bool);
96
99 void
101
103 itkGetConstReferenceMacro(RegionConstraint, RegionType);
104
106 itkGetConstReferenceMacro(RegionConstraintInitialized, bool);
107
113 void
114 Search(const InstanceIdentifier & query, SubsamplePointer & results) override = 0;
115
116protected:
122 typename LightObject::Pointer
123 InternalClone() const override;
124
126 ~RegionConstrainedSubsampler() override = default;
127
128 void
129 PrintSelf(std::ostream & os, Indent indent) const override;
130
131 RegionType m_RegionConstraint{};
132 bool m_RegionConstraintInitialized{};
133 RegionType m_SampleRegion{};
134 bool m_SampleRegionInitialized{};
135}; // end of class RegionConstrainedSubsampler
136
137} // end of namespace Statistics
138} // end of namespace itk
139
140#ifndef ITK_MANUAL_INSTANTIATION
141# include "itkRegionConstrainedSubsampler.hxx"
142#endif
143
144#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
This an abstract subsampler that constrains subsamples to be contained within a given image region.
void SetSampleRegion(const RegionType &region)
LightObject::Pointer InternalClone() const override
void SetRegionConstraint(const RegionType &region)
typename TSample::MeasurementVectorType MeasurementVectorType
typename TSample::InstanceIdentifier InstanceIdentifier
void Search(const InstanceIdentifier &query, SubsamplePointer &results) override=0
typename SubsampleType::ConstIterator SubsampleConstIterator
void PrintSelf(std::ostream &os, Indent indent) const override
typename SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
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.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
long IndexValueType
Definition: itkIntTypes.h:93