Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 * http://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  {
116  template< typename TImageType,
117  typename THistogramFrequencyContainer = DenseFrequencyContainer2 >
119  {
120  public:
123  typedef ProcessObject Superclass;
126 
128  itkTypeMacro(EnhancedScalarImageToTextureFeaturesFilter, ProcessObject);
129 
131  itkNewMacro(Self);
132 
133  typedef THistogramFrequencyContainer FrequencyContainerType;
134  typedef TImageType ImageType;
135  typedef typename ImageType::Pointer ImagePointer;
136 
137  typedef typename ImageType::PixelType PixelType;
138  typedef typename ImageType::OffsetType OffsetType;
139  typedef VectorContainer< unsigned char, OffsetType > OffsetVector;
140  typedef typename OffsetVector::Pointer OffsetVectorPointer;
141  typedef typename OffsetVector::ConstPointer OffsetVectorConstPointer;
142 
143  typedef ScalarImageToCooccurrenceMatrixFilter<
144  ImageType, FrequencyContainerType > CooccurrenceMatrixFilterType;
145 
146  typedef typename CooccurrenceMatrixFilterType::HistogramType HistogramType;
148 
149  typedef short TextureFeatureName;
150  typedef VectorContainer< unsigned char, TextureFeatureName > FeatureNameVector;
151 
152  typedef typename FeatureNameVector::Pointer FeatureNameVectorPointer;
153  typedef typename FeatureNameVector::ConstPointer FeatureNameVectorConstPointer;
154  typedef VectorContainer< unsigned char, double > FeatureValueVector;
155  typedef typename FeatureValueVector::Pointer FeatureValueVectorPointer;
156 
158  typedef DataObject::Pointer DataObjectPointer;
159 
161  typedef DataObjectDecorator< FeatureValueVector >
163 
165 
167 
170  using Superclass::SetInput;
171  void SetInput(const ImageType *);
172 
173  const ImageType * GetInput() const;
174 
176  itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
177  itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
178 
180  itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
181  itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
182 
185  itkSetConstObjectMacro(Offsets, OffsetVector);
186  itkGetConstObjectMacro(Offsets, OffsetVector);
187 
190  void SetNumberOfBinsPerAxis(unsigned int);
191 
194  void SetPixelValueMinMax(PixelType min, PixelType max);
195 
198  void SetMaskImage(const ImageType *);
199 
200  const ImageType * GetMaskImage() const;
201 
204  void SetInsidePixelValue(PixelType InsidePixelValue);
205 
206  itkGetConstMacro(FastCalculations, bool);
207  itkSetMacro(FastCalculations, bool);
208  itkBooleanMacro(FastCalculations);
209 
210  protected:
213  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
214 
215  void FastCompute();
216 
217  void FullCompute();
218 
220  void GenerateData() ITK_OVERRIDE;
221 
223  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
224  using Superclass::MakeOutput;
225  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
226 
227  private:
228  typename CooccurrenceMatrixFilterType::Pointer m_GLCMGenerator;
229 
230  typename TextureFeaturesFilterType::Pointer m_GLCMCalculator;
231 
232  FeatureValueVectorPointer m_FeatureMeans;
233  FeatureValueVectorPointer m_FeatureStandardDeviations;
234  FeatureNameVectorConstPointer m_RequestedFeatures;
235  OffsetVectorConstPointer m_Offsets;
236  bool m_FastCalculations;
237  };
238  } // end of namespace Statistics
239 } // end of namespace itk
240 
241 #ifndef ITK_MANUAL_INSTANTIATION
242 #include "itkEnhancedScalarImageToTextureFeaturesFilter.hxx"
243 #endif
244 
245 #endif
const FeatureValueVectorDataObjectType * GetFeatureMeansOutput() const
void SetPixelValueMinMax(PixelType min, PixelType max)
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
This class computes texture feature coefficients from a grey level co-occurrence matrix.
const FeatureValueVectorDataObjectType * GetFeatureStandardDeviationsOutput() const
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
ScalarImageToCooccurrenceMatrixFilter< ImageType, FrequencyContainerType > CooccurrenceMatrixFilterType
EnhancedHistogramToTextureFeaturesFilter< HistogramType > TextureFeaturesFilterType
static T max(T x, T y)
Definition: svm.cpp:56
static T min(T x, T y)
Definition: svm.cpp:53
unsigned short PixelType