ITK  4.13.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:
57  typedef typename Superclass::Baseclass Baseclass;
60 
63 
65  typedef TSample SampleType;
66  typedef typename SampleType::ConstPointer SampleConstPointer;
67  typedef typename TSample::MeasurementVectorType MeasurementVectorType;
68  typedef typename TSample::InstanceIdentifier InstanceIdentifier;
69 
74 
76  typedef TRegion RegionType;
77  typedef typename RegionType::IndexType IndexType;
79  typedef typename RegionType::SizeType SizeType;
80 
83  void SetSampleRegion(const RegionType& region);
84 
86  itkGetConstReferenceMacro( SampleRegion, RegionType );
87 
89  itkGetConstReferenceMacro(SampleRegionInitialized, bool);
90 
93  void SetRegionConstraint(const RegionType& region);
94 
96  itkGetConstReferenceMacro( RegionConstraint, RegionType );
97 
99  itkGetConstReferenceMacro(RegionConstraintInitialized, bool);
100 
106  virtual void Search(const InstanceIdentifier& query,
107  SubsamplePointer& results) ITK_OVERRIDE = 0;
108 
109 protected:
115  virtual typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
116 
118  virtual ~RegionConstrainedSubsampler() ITK_OVERRIDE {};
119 
120  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
121 
126 
127 private:
128  ITK_DISALLOW_COPY_AND_ASSIGN(RegionConstrainedSubsampler);
129 
130 }; // end of class RegionConstrainedSubsampler
131 
132 } // end of namespace Statistics
133 } // end of namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkRegionConstrainedSubsampler.hxx"
137 #endif
138 
139 #endif
SubsampleType::InstanceIdentifierHolder InstanceIdentifierHolder
RegionConstrainedSubsampler< TSample, TRegion > Self
signed long IndexValueType
Definition: itkIntTypes.h:150
This class stores a subset of instance identifiers from another sample object. You can create a subsa...
Definition: itkSubsample.h:41
This an abstract subsampler that constrains subsamples to be contained within a given image region...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
This is the base subsampler class which defines the subsampler API.
std::vector< InstanceIdentifier > InstanceIdentifierHolder
Definition: itkSubsample.h:74