ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRegionConstrainedSubsampler.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 itkRegionConstrainedSubsampler_h
19 #define itkRegionConstrainedSubsampler_h
20 
21 #include "itkSubsamplerBase.h"
22 #include "itkImageRegion.h"
23 
24 namespace itk {
25 namespace Statistics {
50 template < typename TSample, typename TRegion >
51 class ITK_TEMPLATE_EXPORT RegionConstrainedSubsampler : public SubsamplerBase<TSample>
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_ASSIGN(RegionConstrainedSubsampler);
55 
59  using Baseclass = typename Superclass::Baseclass;
62 
65 
67  using SampleType = TSample;
68  using SampleConstPointer = typename SampleType::ConstPointer;
69  using MeasurementVectorType = typename TSample::MeasurementVectorType;
70  using InstanceIdentifier = typename TSample::InstanceIdentifier;
71 
76 
78  using RegionType = TRegion;
79  using IndexType = typename RegionType::IndexType;
81  using SizeType = typename RegionType::SizeType;
82 
85  void SetSampleRegion(const RegionType& region);
86 
88  itkGetConstReferenceMacro( SampleRegion, RegionType );
89 
91  itkGetConstReferenceMacro(SampleRegionInitialized, bool);
92 
95  void SetRegionConstraint(const RegionType& region);
96 
98  itkGetConstReferenceMacro( RegionConstraint, RegionType );
99 
101  itkGetConstReferenceMacro(RegionConstraintInitialized, bool);
102 
108  void Search(const InstanceIdentifier& query,
109  SubsamplePointer& results) override = 0;
110 
111 protected:
117  typename LightObject::Pointer InternalClone() const override;
118 
120  ~RegionConstrainedSubsampler() override = default;
121 
122  void PrintSelf(std::ostream& os, Indent indent) const override;
123 
128 }; // end of class RegionConstrainedSubsampler
129 
130 } // end of namespace Statistics
131 } // end of namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkRegionConstrainedSubsampler.hxx"
135 #endif
136 
137 #endif
typename TSample::InstanceIdentifier InstanceIdentifier
Light weight base class for most itk classes.
std::vector< InstanceIdentifier > InstanceIdentifierHolder
Definition: itkSubsample.h:76
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:41
typename TSample::MeasurementVectorType MeasurementVectorType
This an abstract subsampler that constrains subsamples to be contained within a given image region...
signed long IndexValueType
Definition: itkIntTypes.h:90
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
typename SubsampleType::ConstIterator SubsampleConstIterator
This is the base subsampler class which defines the subsampler API.