ITK  4.2.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 
128 private:
129  RegionConstrainedSubsampler(const Self&); // purposely not implemented
130  void operator=(const Self&); // purposely not implemented
131 
132 }; // end of class RegionConstrainedSubsampler
133 
134 } // end of namespace Statistics
135 } // end of namespace itk
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkRegionConstrainedSubsampler.hxx"
139 #endif
140 
141 #endif
142