Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.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 __itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter_h
31 #define __itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter_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>
118  {
119  public:
122  typedef ProcessObject Superclass;
125 
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 
182  void AddOffsets( const std::vector<OffsetType> offset );
183 
188 
190  itkSetMacro( NumberOfBinsPerAxis, unsigned int );
191 
193  itkGetConstMacro( NumberOfBinsPerAxis, unsigned int );
194 
199  void SetPixelValueMinMax( PixelType min, PixelType max );
200 
202  itkGetConstMacro( Min, PixelType );
203 
205  itkGetConstMacro( Max, PixelType );
206 
211  void SetDistanceValueMinMax( RealType min, RealType max );
212 
216  itkGetConstMacro( MinDistance, RealType );
217 
221  itkGetConstMacro( MaxDistance, RealType );
222 
224  using Superclass::SetInput;
225  void SetInput( const ImageType *image );
226 
228  const ImageType * GetInput() const;
229 
231  void SetMaskImage( const ImageType *image );
232 
234  const ImageType * GetMaskImage() const;
235 
237  const HistogramType * GetOutput() const;
238 
240  double* GetSiMatrix() const;
241 
246  itkSetMacro( InsidePixelValue, PixelType );
247  itkGetConstMacro( InsidePixelValue, PixelType );
248 
249  protected:
252  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
253 
255  typedef DataObject::Pointer DataObjectPointer;
256 
257  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
258  using Superclass::MakeOutput;
260 
262  void GenerateData() ITK_OVERRIDE;
263 
271  void NormalizeOffsetDirection(OffsetType &offset);
272 
273  private:
274 
275  unsigned int m_NumberOfBinsPerAxis;
276  PixelType m_Min;
277  PixelType m_Max;
278  RealType m_MinDistance;
279  RealType m_MaxDistance;
280  PixelType m_InsidePixelValue;
281 
282  MeasurementVectorType m_LowerBound;
283  MeasurementVectorType m_UpperBound;
284  OffsetVectorPointer m_Offsets;
285 
286  double * m_siMatrix;
287  };
288  } // end of namespace Statistics
289 } // end of namespace itk
290 
291 #ifndef ITK_MANUAL_INSTANTIATION
292 #include "itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.hxx"
293 #endif
294 
295 #endif
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::itkStaticConstMacro
itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::SetDistanceValueMinMax
void SetDistanceValueMinMax(RealType min, RealType max)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::RegionType
ImageType::RegionType RegionType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:137
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::RadiusType
ImageType::SizeType RadiusType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:138
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::SetMaskImage
void SetMaskImage(const ImageType *image)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::SetPixelValueMinMax
void SetPixelValueMinMax(PixelType min, PixelType max)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::GetInput
const ImageType * GetInput() const
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter
This class computes a run length matrix (histogram) from a given image and a mask image if provided....
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:117
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::SetOffset
void SetOffset(const OffsetType offset)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::MeasurementType
NumericTraits< PixelType >::RealType MeasurementType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:144
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::ImageConstPointer
ImageType::ConstPointer ImageConstPointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:134
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::OffsetVectorPointer
OffsetVector::Pointer OffsetVectorPointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:141
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::HistogramType
Histogram< MeasurementType, THistogramFrequencyContainer > HistogramType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:148
itk::SmartPointer< Self >
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter
EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter()
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::HistogramConstPointer
HistogramType::ConstPointer HistogramConstPointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:150
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::RealType
NumericTraits< PixelType >::RealType RealType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:145
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::PointType
ImageType::PointType PointType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:142
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::AddOffsets
void AddOffsets(const std::vector< OffsetType > offset)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::IndexType
ImageType::IndexType IndexType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:136
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::OffsetVector
VectorContainer< unsigned char, OffsetType > OffsetVector
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:140
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::DataObjectPointerArraySizeType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:257
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::~EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter
~EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter() override
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:251
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::itkGetModifiableObjectMacro
itkGetModifiableObjectMacro(Offsets, OffsetVector)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::ImageType
TImageType ImageType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:130
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::HistogramPointer
HistogramType::Pointer HistogramPointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:149
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::GetMaskImage
const ImageType * GetMaskImage() const
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::GetOutput
const HistogramType * GetOutput() const
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::NormalizeOffsetDirection
void NormalizeOffsetDirection(OffsetType &offset)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::SetInput
void SetInput(const ImageType *image)
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::OffsetType
ImageType::OffsetType OffsetType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:139
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::MeasurementVectorType
HistogramType::MeasurementVectorType MeasurementVectorType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:151
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::GetSiMatrix
double * GetSiMatrix() const
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::DataObjectPointer
DataObject::Pointer DataObjectPointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:255
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::Pointer
SmartPointer< Self > Pointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:123
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::ImagePointer
ImageType::Pointer ImagePointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:133
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::MakeOutput
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::Superclass
ProcessObject Superclass
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:122
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:124
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::PixelType
ImageType::PixelType PixelType
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:135
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::GenerateData
void GenerateData() ITK_OVERRIDE
itk::Statistics::EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter::Self
EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter Self
Definition: itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h:121