Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
itkEnhancedScalarImageToTextureFeaturesFilter.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 itkEnhancedScalarImageToTextureFeaturesFilter_h
31 #define itkEnhancedScalarImageToTextureFeaturesFilter_h
32 
33 #include <itkDataObjectDecorator.h>
34 
36 #include <itkScalarImageToCooccurrenceMatrixFilter.h>
37 
38 namespace itk
39 {
40  namespace Statistics
41  {
115  template< typename TImageType,
116  typename THistogramFrequencyContainer = DenseFrequencyContainer2 >
118  {
119  public:
122  typedef ProcessObject Superclass;
125 
127  itkTypeMacro(EnhancedScalarImageToTextureFeaturesFilter, ProcessObject);
128 
130  itkNewMacro(Self);
131 
132  typedef THistogramFrequencyContainer FrequencyContainerType;
133  typedef TImageType ImageType;
134  typedef typename ImageType::Pointer ImagePointer;
135 
136  typedef typename ImageType::PixelType PixelType;
137  typedef typename ImageType::OffsetType OffsetType;
138  typedef VectorContainer< unsigned char, OffsetType > OffsetVector;
139  typedef typename OffsetVector::Pointer OffsetVectorPointer;
140  typedef typename OffsetVector::ConstPointer OffsetVectorConstPointer;
141 
142  typedef ScalarImageToCooccurrenceMatrixFilter<
144 
145  typedef typename CooccurrenceMatrixFilterType::HistogramType HistogramType;
147 
148  typedef short TextureFeatureName;
149  typedef VectorContainer< unsigned char, TextureFeatureName > FeatureNameVector;
150 
151  typedef typename FeatureNameVector::Pointer FeatureNameVectorPointer;
152  typedef typename FeatureNameVector::ConstPointer FeatureNameVectorConstPointer;
153  typedef VectorContainer< unsigned char, double > FeatureValueVector;
154  typedef typename FeatureValueVector::Pointer FeatureValueVectorPointer;
155 
157  typedef DataObject::Pointer DataObjectPointer;
158 
160  typedef DataObjectDecorator< FeatureValueVector >
162 
164 
166 
169  using Superclass::SetInput;
170  void SetInput(const ImageType *);
171 
172  const ImageType * GetInput() const;
173 
175  itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
176  itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
177 
179  itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
180  itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
181 
184  itkSetConstObjectMacro(Offsets, OffsetVector);
185  itkGetConstObjectMacro(Offsets, OffsetVector);
186 
189  void SetNumberOfBinsPerAxis(unsigned int);
190 
194 
197  void SetMaskImage(const ImageType *);
198 
199  const ImageType * GetMaskImage() const;
200 
203  void SetInsidePixelValue(PixelType InsidePixelValue);
204 
205  itkGetConstMacro(FastCalculations, bool);
206  itkSetMacro(FastCalculations, bool);
207  itkBooleanMacro(FastCalculations);
208 
209  protected:
212  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
213 
214  void FastCompute();
215 
216  void FullCompute();
217 
219  void GenerateData() ITK_OVERRIDE;
220 
223  using Superclass::MakeOutput;
225 
226  private:
227  typename CooccurrenceMatrixFilterType::Pointer m_GLCMGenerator;
228 
229  typename TextureFeaturesFilterType::Pointer m_GLCMCalculator;
230 
231  FeatureValueVectorPointer m_FeatureMeans;
232  FeatureValueVectorPointer m_FeatureStandardDeviations;
233  FeatureNameVectorConstPointer m_RequestedFeatures;
234  OffsetVectorConstPointer m_Offsets;
235  bool m_FastCalculations;
236  };
237  } // end of namespace Statistics
238 } // end of namespace itk
239 
240 #ifndef ITK_MANUAL_INSTANTIATION
241 #include <itkEnhancedScalarImageToTextureFeaturesFilter.tpp>
242 #endif
243 
244 #endif
This class computes texture feature coefficients from a grey level co-occurrence matrix.
void SetPixelValueMinMax(PixelType min, PixelType max)
ScalarImageToCooccurrenceMatrixFilter< ImageType, FrequencyContainerType > CooccurrenceMatrixFilterType
EnhancedHistogramToTextureFeaturesFilter< HistogramType > TextureFeaturesFilterType
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
const FeatureValueVectorDataObjectType * GetFeatureMeansOutput() const
const FeatureValueVectorDataObjectType * GetFeatureStandardDeviationsOutput() const