ITK  4.4.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 < class TSample, class TRegion >
51 class ITK_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) = 0;
108 
109 protected:
115  virtual typename LightObject::Pointer InternalClone() const;
116 
119 
120  virtual void PrintSelf(std::ostream& os, Indent indent) const;
121 
126 
127 private:
128  RegionConstrainedSubsampler(const Self&); // purposely not implemented
129  void operator=(const Self&); // purposely not implemented
130 
131 }; // end of class RegionConstrainedSubsampler
132 
133 } // end of namespace Statistics
134 } // end of namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkRegionConstrainedSubsampler.hxx"
138 #endif
139 
140 #endif
141