ITK  4.8.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<typename TImageType, typename 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  virtual void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
238 
241 
244  virtual DataObjectPointer MakeOutput( DataObjectPointerArraySizeType idx ) ITK_OVERRIDE;
245 
247  virtual void GenerateData() ITK_OVERRIDE;
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
Light weight base class for most itk classes.
void SetPixelValueMinMax(PixelType min, PixelType max)
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
virtual void PrintSelf(std::ostream &os, Indent indent) const override
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
This class computes a run length matrix (histogram) from a given image and a mask image if provided...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Superclass::MeasurementVectorType MeasurementVectorType
Definition: itkHistogram.h:101
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
Histogram< MeasurementType, THistogramFrequencyContainer > HistogramType
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
void SetDistanceValueMinMax(RealType min, RealType max)