Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
itkEnhancedScalarImageToRunLengthMatrixFilter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 /*=========================================================================
14 *
15 * Copyright Insight Software Consortium
16 *
17 * Licensed under the Apache License, Version 2.0 (the "License");
18 * you may not use this file except in compliance with the License.
19 * You may obtain a copy of the License at
20 *
21 * https://www.apache.org/licenses/LICENSE-2.0.txt
22 *
23 * Unless required by applicable law or agreed to in writing, software
24 * distributed under the License is distributed on an "AS IS" BASIS,
25 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26 * See the License for the specific language governing permissions and
27 * limitations under the License.
28 *
29 *=========================================================================*/
30 #ifndef __itkEnhancedScalarImageToRunLengthMatrixFilter_h
31 #define __itkEnhancedScalarImageToRunLengthMatrixFilter_h
32 
33 #include "itkImage.h"
34 #include "itkHistogram.h"
35 #include "itkNumericTraits.h"
36 #include "itkVectorContainer.h"
37 
38 namespace itk
39 {
40  namespace Statistics
41  {
115  template<typename TImageType, typename THistogramFrequencyContainer =
116  DenseFrequencyContainer2>
117  class EnhancedScalarImageToRunLengthMatrixFilter : public ProcessObject
118  {
119  public:
122  typedef ProcessObject Superclass;
125 
127  itkTypeMacro( EnhancedScalarImageToRunLengthMatrixFilter, ProcessObject );
128 
130  itkNewMacro( Self );
131 
132  typedef TImageType ImageType;
133  typedef typename ImageType::Pointer ImagePointer;
134  typedef typename ImageType::ConstPointer ImageConstPointer;
135  typedef typename ImageType::PixelType PixelType;
136  typedef typename ImageType::IndexType IndexType;
137  typedef typename ImageType::RegionType RegionType;
138  typedef typename ImageType::SizeType RadiusType;
139  typedef typename ImageType::OffsetType OffsetType;
140  typedef VectorContainer<unsigned char, OffsetType> OffsetVector;
141  typedef typename OffsetVector::Pointer OffsetVectorPointer;
142  typedef typename ImageType::PointType PointType;
143 
144  typedef typename NumericTraits<PixelType>::RealType MeasurementType;
145  typedef typename NumericTraits<PixelType>::RealType RealType;
146 
147  typedef Histogram<MeasurementType, THistogramFrequencyContainer>
149  typedef typename HistogramType::Pointer HistogramPointer;
150  typedef typename HistogramType::ConstPointer HistogramConstPointer;
151  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
152 
154  itkStaticConstMacro( ImageDimension, unsigned int,
155  TImageType::ImageDimension );
156 
158  itkStaticConstMacro( DefaultBinsPerAxis, unsigned int, 256 );
159 
169  itkSetObjectMacro( Offsets, OffsetVector );
170 
180  void SetOffset( const OffsetType offset );
181 
186 
188  itkSetMacro( NumberOfBinsPerAxis, unsigned int );
189 
191  itkGetConstMacro( NumberOfBinsPerAxis, unsigned int );
192 
197  void SetPixelValueMinMax( PixelType min, PixelType max );
198 
200  itkGetConstMacro( Min, PixelType );
201 
203  itkGetConstMacro( Max, PixelType );
204 
209  void SetDistanceValueMinMax( RealType min, RealType max );
210 
214  itkGetConstMacro( MinDistance, RealType );
215 
219  itkGetConstMacro( MaxDistance, RealType );
220 
222  using Superclass::SetInput;
223  void SetInput( const ImageType *image );
224 
226  const ImageType * GetInput() const;
227 
229  void SetMaskImage( const ImageType *image );
230 
232  const ImageType * GetMaskImage() const;
233 
235  const HistogramType * GetOutput() const;
236 
241  itkSetMacro( InsidePixelValue, PixelType );
242  itkGetConstMacro( InsidePixelValue, PixelType );
243 
244  protected:
247  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
248 
250  typedef DataObject::Pointer DataObjectPointer;
251 
252  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
253  using Superclass::MakeOutput;
255 
257  void GenerateData() ITK_OVERRIDE;
258 
266  void NormalizeOffsetDirection(OffsetType &offset);
267 
268  private:
269 
270  unsigned int m_NumberOfBinsPerAxis;
271  PixelType m_Min;
272  PixelType m_Max;
273  RealType m_MinDistance;
274  RealType m_MaxDistance;
275  PixelType m_InsidePixelValue;
276 
277  MeasurementVectorType m_LowerBound;
278  MeasurementVectorType m_UpperBound;
279  OffsetVectorPointer m_Offsets;
280  };
281  } // end of namespace Statistics
282 } // end of namespace itk
283 
284 #ifndef ITK_MANUAL_INSTANTIATION
285 #include "itkEnhancedScalarImageToRunLengthMatrixFilter.hxx"
286 #endif
287 
288 #endif
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::SetOffset
void SetOffset(const OffsetType offset)
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::OffsetVectorPointer
OffsetVector::Pointer OffsetVectorPointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:141
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::RadiusType
ImageType::SizeType RadiusType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:138
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::GenerateData
void GenerateData() ITK_OVERRIDE
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::~EnhancedScalarImageToRunLengthMatrixFilter
~EnhancedScalarImageToRunLengthMatrixFilter() override
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:246
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::SetDistanceValueMinMax
void SetDistanceValueMinMax(RealType min, RealType max)
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::HistogramType
Histogram< MeasurementType, THistogramFrequencyContainer > HistogramType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:148
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::Self
EnhancedScalarImageToRunLengthMatrixFilter Self
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:121
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:124
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::HistogramConstPointer
HistogramType::ConstPointer HistogramConstPointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:150
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::SetInput
void SetInput(const ImageType *image)
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::MeasurementType
NumericTraits< PixelType >::RealType MeasurementType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:144
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::PointType
ImageType::PointType PointType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:142
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::OffsetType
ImageType::OffsetType OffsetType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:139
itk::SmartPointer< Self >
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::EnhancedScalarImageToRunLengthMatrixFilter
EnhancedScalarImageToRunLengthMatrixFilter()
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::itkGetModifiableObjectMacro
itkGetModifiableObjectMacro(Offsets, OffsetVector)
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::IndexType
ImageType::IndexType IndexType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:136
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::ImageConstPointer
ImageType::ConstPointer ImageConstPointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:134
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::GetInput
const ImageType * GetInput() const
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::MakeOutput
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::PixelType
ImageType::PixelType PixelType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:135
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::SetPixelValueMinMax
void SetPixelValueMinMax(PixelType min, PixelType max)
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::GetMaskImage
const ImageType * GetMaskImage() const
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::OffsetVector
VectorContainer< unsigned char, OffsetType > OffsetVector
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:140
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::RealType
NumericTraits< PixelType >::RealType RealType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:145
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::SetMaskImage
void SetMaskImage(const ImageType *image)
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::itkStaticConstMacro
itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension)
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::ImagePointer
ImageType::Pointer ImagePointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:133
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::NormalizeOffsetDirection
void NormalizeOffsetDirection(OffsetType &offset)
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::DataObjectPointer
DataObject::Pointer DataObjectPointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:250
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::MeasurementVectorType
HistogramType::MeasurementVectorType MeasurementVectorType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:151
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::Pointer
SmartPointer< Self > Pointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:123
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::GetOutput
const HistogramType * GetOutput() const
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::DataObjectPointerArraySizeType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:252
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::HistogramPointer
HistogramType::Pointer HistogramPointer
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:149
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::Superclass
ProcessObject Superclass
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:122
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::RegionType
ImageType::RegionType RegionType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:137
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter::ImageType
TImageType ImageType
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:130
itk::Statistics::EnhancedScalarImageToRunLengthMatrixFilter
This class computes a run length matrix (histogram) from a given image and a mask image if provided....
Definition: itkEnhancedScalarImageToRunLengthMatrixFilter.h:117