Medical Imaging Interaction Toolkit  2026.06.00
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  {
114  template<typename TImageType, typename THistogramFrequencyContainer =
115  DenseFrequencyContainer2>
117  {
118  public:
121  typedef ProcessObject Superclass;
124 
127 
129  itkNewMacro( Self );
130 
131  typedef TImageType ImageType;
132  typedef typename ImageType::Pointer ImagePointer;
133  typedef typename ImageType::ConstPointer ImageConstPointer;
134  typedef typename ImageType::PixelType PixelType;
135  typedef typename ImageType::IndexType IndexType;
136  typedef typename ImageType::RegionType RegionType;
137  typedef typename ImageType::SizeType RadiusType;
138  typedef typename ImageType::OffsetType OffsetType;
139  typedef VectorContainer<unsigned char, OffsetType> OffsetVector;
140  typedef typename OffsetVector::Pointer OffsetVectorPointer;
141  typedef typename ImageType::PointType PointType;
142 
143  typedef typename NumericTraits<PixelType>::RealType MeasurementType;
144  typedef typename NumericTraits<PixelType>::RealType RealType;
145 
146  typedef Histogram<MeasurementType, THistogramFrequencyContainer>
148  typedef typename HistogramType::Pointer HistogramPointer;
149  typedef typename HistogramType::ConstPointer HistogramConstPointer;
150  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
151 
153  itkStaticConstMacro( ImageDimension, unsigned int,
154  TImageType::ImageDimension );
155 
157  itkStaticConstMacro( DefaultBinsPerAxis, unsigned int, 256 );
158 
168  itkSetObjectMacro( Offsets, OffsetVector );
169 
179  void SetOffset( const OffsetType offset );
180 
181  void AddOffsets( const std::vector<OffsetType> offset );
182 
187 
189  itkSetMacro( NumberOfBinsPerAxis, unsigned int );
190 
192  itkGetConstMacro( NumberOfBinsPerAxis, unsigned int );
193 
199 
201  itkGetConstMacro( Min, PixelType );
202 
204  itkGetConstMacro( Max, PixelType );
205 
211 
215  itkGetConstMacro( MinDistance, RealType );
216 
220  itkGetConstMacro( MaxDistance, RealType );
221 
223  using Superclass::SetInput;
224  void SetInput( const ImageType *image );
225 
227  const ImageType * GetInput() const;
228 
230  void SetMaskImage( const ImageType *image );
231 
233  const ImageType * GetMaskImage() const;
234 
236  const HistogramType * GetOutput() const;
237 
239  double* GetSiMatrix() const;
240 
245  itkSetMacro( InsidePixelValue, PixelType );
246  itkGetConstMacro( InsidePixelValue, PixelType );
247 
248  protected:
251  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
252 
254  typedef DataObject::Pointer DataObjectPointer;
255 
256  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
257  using Superclass::MakeOutput;
259 
261  void GenerateData() ITK_OVERRIDE;
262 
271 
272  private:
273 
274  unsigned int m_NumberOfBinsPerAxis;
275  PixelType m_Min;
276  PixelType m_Max;
277  RealType m_MinDistance;
278  RealType m_MaxDistance;
279  PixelType m_InsidePixelValue;
280 
281  MeasurementVectorType m_LowerBound;
282  MeasurementVectorType m_UpperBound;
283  OffsetVectorPointer m_Offsets;
284 
285  double * m_siMatrix;
286  };
287  } // end of namespace Statistics
288 } // end of namespace itk
289 
290 #ifndef ITK_MANUAL_INSTANTIATION
291 #include <itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.tpp>
292 #endif
293 
294 #endif
This class computes a run length matrix (histogram) from a given image and a mask image if provided....
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE
itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension)
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE