ITK  5.2.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  * 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 itkRegionConstrainedSubsampler_h
19 #define itkRegionConstrainedSubsampler_h
20 
21 #include "itkSubsamplerBase.h"
22 #include "itkImageRegion.h"
23 
24 namespace itk
25 {
26 namespace Statistics
27 {
53 template <typename TSample, typename TRegion>
54 class ITK_TEMPLATE_EXPORT RegionConstrainedSubsampler : public SubsamplerBase<TSample>
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(RegionConstrainedSubsampler);
58 
62  using Baseclass = typename Superclass::Baseclass;
65 
68 
70  using SampleType = TSample;
71  using SampleConstPointer = typename SampleType::ConstPointer;
72  using MeasurementVectorType = typename TSample::MeasurementVectorType;
73  using InstanceIdentifier = typename TSample::InstanceIdentifier;
74 
79 
81  using RegionType = TRegion;
82  using IndexType = typename RegionType::IndexType;
84  using SizeType = typename RegionType::SizeType;
85 
88  void
89  SetSampleRegion(const RegionType & region);
90 
92  itkGetConstReferenceMacro(SampleRegion, RegionType);
93 
95  itkGetConstReferenceMacro(SampleRegionInitialized, bool);
96 
99  void
100  SetRegionConstraint(const RegionType & region);
101 
103  itkGetConstReferenceMacro(RegionConstraint, RegionType);
104 
106  itkGetConstReferenceMacro(RegionConstraintInitialized, bool);
107 
113  void
114  Search(const InstanceIdentifier & query, SubsamplePointer & results) override = 0;
115 
116 protected:
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 
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
itk::Statistics::RegionConstrainedSubsampler::m_SampleRegion
RegionType m_SampleRegion
Definition: itkRegionConstrainedSubsampler.h:133
itk::Statistics::RegionConstrainedSubsampler::m_RegionConstraintInitialized
bool m_RegionConstraintInitialized
Definition: itkRegionConstrainedSubsampler.h:132
itk::Statistics::RegionConstrainedSubsampler::SampleType
TSample SampleType
Definition: itkRegionConstrainedSubsampler.h:70
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Statistics::RegionConstrainedSubsampler::SubsampleConstIterator
typename SubsampleType::ConstIterator SubsampleConstIterator
Definition: itkRegionConstrainedSubsampler.h:77
itk::Statistics::Subsample::InstanceIdentifierHolder
std::vector< InstanceIdentifier > InstanceIdentifierHolder
Definition: itkSubsample.h:76
itk::Statistics::RegionConstrainedSubsampler::InstanceIdentifierHolder
typename SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
Definition: itkRegionConstrainedSubsampler.h:78
itk::Statistics::RegionConstrainedSubsampler::IndexValueType
typename IndexType::IndexValueType IndexValueType
Definition: itkRegionConstrainedSubsampler.h:83
itkImageRegion.h
itk::Statistics::RegionConstrainedSubsampler::MeasurementVectorType
typename TSample::MeasurementVectorType MeasurementVectorType
Definition: itkRegionConstrainedSubsampler.h:72
itk::Statistics::RegionConstrainedSubsampler::Baseclass
typename Superclass::Baseclass Baseclass
Definition: itkRegionConstrainedSubsampler.h:62
itkSubsamplerBase.h
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::Statistics::RegionConstrainedSubsampler::RegionType
TRegion RegionType
Definition: itkRegionConstrainedSubsampler.h:81
itk::Statistics::RegionConstrainedSubsampler::IndexType
typename RegionType::IndexType IndexType
Definition: itkRegionConstrainedSubsampler.h:82
itk::Statistics::SubsamplerBase
This is the base subsampler class which defines the subsampler API.
Definition: itkSubsamplerBase.h:49
itk::Statistics::RegionConstrainedSubsampler::SubsamplePointer
typename SubsampleType::Pointer SubsamplePointer
Definition: itkRegionConstrainedSubsampler.h:76
itk::Statistics::Subsample
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:42
itk::Statistics::RegionConstrainedSubsampler::SampleConstPointer
typename SampleType::ConstPointer SampleConstPointer
Definition: itkRegionConstrainedSubsampler.h:71
itk::Statistics::RegionConstrainedSubsampler::m_RegionConstraint
RegionType m_RegionConstraint
Definition: itkRegionConstrainedSubsampler.h:131
itk::Statistics::RegionConstrainedSubsampler::SizeType
typename RegionType::SizeType SizeType
Definition: itkRegionConstrainedSubsampler.h:84
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itk::Statistics::Subsample::ConstIterator
Definition: itkSubsample.h:153
itk::Statistics::RegionConstrainedSubsampler
This an abstract subsampler that constrains subsamples to be contained within a given image region.
Definition: itkRegionConstrainedSubsampler.h:54
itk::Statistics::RegionConstrainedSubsampler::InstanceIdentifier
typename TSample::InstanceIdentifier InstanceIdentifier
Definition: itkRegionConstrainedSubsampler.h:73
itk::Statistics::RegionConstrainedSubsampler::m_SampleRegionInitialized
bool m_SampleRegionInitialized
Definition: itkRegionConstrainedSubsampler.h:134