ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkScalarImageToRunLengthMatrixFilter.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 __itkScalarImageToRunLengthMatrixFilter_h
19 #define __itkScalarImageToRunLengthMatrixFilter_h
20 
21 #include "itkImage.h"
22 #include "itkHistogram.h"
23 #include "itkNumericTraits.h"
24 #include "itkVectorContainer.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
30 
104 template<class TImageType, class THistogramFrequencyContainer =
105  DenseFrequencyContainer2>
107 {
108 public:
114 
117 
119  itkNewMacro( Self );
120 
121  typedef TImageType ImageType;
122  typedef typename ImageType::Pointer ImagePointer;
123  typedef typename ImageType::ConstPointer ImageConstPointer;
124  typedef typename ImageType::PixelType PixelType;
125  typedef typename ImageType::IndexType IndexType;
126  typedef typename ImageType::RegionType RegionType;
127  typedef typename ImageType::SizeType RadiusType;
128  typedef typename ImageType::OffsetType OffsetType;
131  typedef typename ImageType::PointType PointType;
132 
135 
141 
143  itkStaticConstMacro( ImageDimension, unsigned int,
144  TImageType::ImageDimension );
145 
147  itkStaticConstMacro( DefaultBinsPerAxis, unsigned int, 256 );
148 
158  itkSetObjectMacro( Offsets, OffsetVector );
159 
169  void SetOffset( const OffsetType offset );
170 
174  itkGetModifiableObjectMacro(Offsets, OffsetVector );
175 
177  itkSetMacro( NumberOfBinsPerAxis, unsigned int );
178 
180  itkGetConstMacro( NumberOfBinsPerAxis, unsigned int );
181 
186  void SetPixelValueMinMax( PixelType min, PixelType max );
187 
189  itkGetConstMacro( Min, PixelType );
190 
192  itkGetConstMacro( Max, PixelType );
193 
198  void SetDistanceValueMinMax( RealType min, RealType max );
199 
203  itkGetConstMacro( MinDistance, RealType );
204 
208  itkGetConstMacro( MaxDistance, RealType );
209 
211  using Superclass::SetInput;
212  void SetInput( const ImageType *image );
213 
215  const ImageType * GetInput() const;
216 
218  void SetMaskImage( const ImageType *image );
219 
221  const ImageType * GetMaskImage() const;
222 
224  const HistogramType * GetOutput() const;
225 
230  itkSetMacro( InsidePixelValue, PixelType );
231  itkGetConstMacro( InsidePixelValue, PixelType );
233 
234 protected:
237  void PrintSelf( std::ostream& os, Indent indent ) const;
238 
241 
245 
247  virtual void GenerateData();
248 
256  void NormalizeOffsetDirection(OffsetType &offset);
257 
258 private:
259 
260  unsigned int m_NumberOfBinsPerAxis;
266 
270 
271 };
272 } // end of namespace Statistics
273 } // end of namespace itk
274 
275 #ifndef ITK_MANUAL_INSTANTIATION
276 #include "itkScalarImageToRunLengthMatrixFilter.hxx"
277 #endif
278 
279 #endif
280