Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 /*=========================================================================
18 *
19 * Copyright Insight Software Consortium
20 *
21 * Licensed under the Apache License, Version 2.0 (the "License");
22 * you may not use this file except in compliance with the License.
23 * You may obtain a copy of the License at
24 *
25 * http://www.apache.org/licenses/LICENSE-2.0.txt
26 *
27 * Unless required by applicable law or agreed to in writing, software
28 * distributed under the License is distributed on an "AS IS" BASIS,
29 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 * See the License for the specific language governing permissions and
31 * limitations under the License.
32 *
33 *=========================================================================*/
34 #ifndef __itkEnhancedScalarImageToTextureFeaturesFilter_h
35 #define __itkEnhancedScalarImageToTextureFeaturesFilter_h
36 
37 #include "itkDataObjectDecorator.h"
38 
40 #include "itkScalarImageToCooccurrenceMatrixFilter.h"
41 
42 namespace itk
43 {
44  namespace Statistics
45  {
120  template< typename TImageType,
121  typename THistogramFrequencyContainer = DenseFrequencyContainer2 >
123  {
124  public:
127  typedef ProcessObject Superclass;
130 
132  itkTypeMacro(EnhancedScalarImageToTextureFeaturesFilter, ProcessObject);
133 
135  itkNewMacro(Self);
136 
137  typedef THistogramFrequencyContainer FrequencyContainerType;
138  typedef TImageType ImageType;
140 
141  typedef typename ImageType::PixelType PixelType;
142  typedef typename ImageType::OffsetType OffsetType;
143  typedef VectorContainer< unsigned char, OffsetType > OffsetVector;
146 
147  typedef ScalarImageToCooccurrenceMatrixFilter<
148  ImageType, FrequencyContainerType > CooccurrenceMatrixFilterType;
149 
150  typedef typename CooccurrenceMatrixFilterType::HistogramType HistogramType;
152 
153  typedef short TextureFeatureName;
154  typedef VectorContainer< unsigned char, TextureFeatureName > FeatureNameVector;
155 
158  typedef VectorContainer< unsigned char, double > FeatureValueVector;
160 
163 
165  typedef DataObjectDecorator< FeatureValueVector >
167 
169 
171 
174  using Superclass::SetInput;
175  void SetInput(const ImageType *);
176 
177  const ImageType * GetInput() const;
178 
180  itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
181  itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
182 
184  itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
185  itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
186 
189  itkSetConstObjectMacro(Offsets, OffsetVector);
190  itkGetConstObjectMacro(Offsets, OffsetVector);
191 
194  void SetNumberOfBinsPerAxis(unsigned int);
195 
198  void SetPixelValueMinMax(PixelType min, PixelType max);
199 
202  void SetMaskImage(const ImageType *);
203 
204  const ImageType * GetMaskImage() const;
205 
208  void SetInsidePixelValue(PixelType InsidePixelValue);
209 
210  itkGetConstMacro(FastCalculations, bool);
211  itkSetMacro(FastCalculations, bool);
212  itkBooleanMacro(FastCalculations);
213 
214  protected:
217  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
218 
219  void FastCompute();
220 
221  void FullCompute();
222 
224  virtual void GenerateData() ITK_OVERRIDE;
225 
228  using Superclass::MakeOutput;
229  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
230 
231  private:
232  typename CooccurrenceMatrixFilterType::Pointer m_GLCMGenerator;
233 
234  typename TextureFeaturesFilterType::Pointer m_GLCMCalculator;
235 
236  FeatureValueVectorPointer m_FeatureMeans;
237  FeatureValueVectorPointer m_FeatureStandardDeviations;
238  FeatureNameVectorConstPointer m_RequestedFeatures;
239  OffsetVectorConstPointer m_Offsets;
240  bool m_FastCalculations;
241  };
242  } // end of namespace Statistics
243 } // end of namespace itk
244 
245 #ifndef ITK_MANUAL_INSTANTIATION
246 #include "itkEnhancedScalarImageToTextureFeaturesFilter.hxx"
247 #endif
248 
249 #endif
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itk::SmartPointer< Self > Pointer
const FeatureValueVectorDataObjectType * GetFeatureMeansOutput() const
void SetPixelValueMinMax(PixelType min, PixelType max)
itk::SmartPointer< const Self > ConstPointer
This class computes texture feature coefficients from a grey level co-occurrence matrix.
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
ScalarImageToCooccurrenceMatrixFilter< ImageType, FrequencyContainerType > CooccurrenceMatrixFilterType
EnhancedHistogramToTextureFeaturesFilter< HistogramType > TextureFeaturesFilterType
static T max(T x, T y)
Definition: svm.cpp:70
static T min(T x, T y)
Definition: svm.cpp:67
const FeatureValueVectorDataObjectType * GetFeatureStandardDeviationsOutput() const
unsigned short PixelType