Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkEnhancedScalarImageToRunLengthFeaturesFilter.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 __itkEnhancedScalarImageToRunLengthFeaturesFilter_h
35 #define __itkEnhancedScalarImageToRunLengthFeaturesFilter_h
36 
37 #include "itkDataObjectDecorator.h"
38 
41 
42 namespace itk
43 {
44  namespace Statistics
45  {
110  template< typename TImageType,
111  typename THistogramFrequencyContainer = DenseFrequencyContainer2 >
113  {
114  public:
117  typedef ProcessObject Superclass;
120 
122  itkTypeMacro(EnhancedScalarImageToRunLengthFeaturesFilter, ProcessObject);
123 
125  itkNewMacro(Self);
126 
127  typedef THistogramFrequencyContainer FrequencyContainerType;
128  typedef TImageType ImageType;
130 
131  typedef typename ImageType::PixelType PixelType;
132  typedef typename ImageType::OffsetType OffsetType;
133  typedef VectorContainer< unsigned char, OffsetType > OffsetVector;
136 
138  ImageType, FrequencyContainerType > RunLengthMatrixFilterType;
139 
142 
145 
146  typedef short RunLengthFeatureName;
147  typedef VectorContainer<unsigned char,
148  RunLengthFeatureName> FeatureNameVector;
151  typedef VectorContainer< unsigned char, double > FeatureValueVector;
153 
156 
158  typedef DataObjectDecorator< FeatureValueVector >
160 
162 
164  const;
165 
168  using Superclass::SetInput;
169  void SetInput(const ImageType *);
170 
171  const ImageType * GetInput() const;
172 
174  itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
175  itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
176 
178  itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
179  itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
180 
183  itkSetConstObjectMacro(Offsets, OffsetVector);
184  itkGetConstObjectMacro(Offsets, OffsetVector);
185 
188  void SetNumberOfBinsPerAxis(unsigned int);
189 
192  void SetPixelValueMinMax(PixelType min, PixelType max);
193 
196  void SetDistanceValueMinMax( double min, double max );
197 
200  void SetMaskImage(const ImageType *);
201 
202  const ImageType * GetMaskImage() const;
203 
206  void SetInsidePixelValue(PixelType InsidePixelValue);
207 
208  itkGetConstMacro(FastCalculations, bool);
209  itkSetMacro(FastCalculations, bool);
210  itkBooleanMacro(FastCalculations);
211 
212  protected:
215  virtual void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE;
216 
217  void FastCompute();
218 
219  void FullCompute();
220 
222  virtual void GenerateData() ITK_OVERRIDE;
223 
226  using Superclass::MakeOutput;
227  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
228 
229  private:
230  typename RunLengthMatrixFilterType::Pointer m_RunLengthMatrixGenerator;
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 "itkEnhancedScalarImageToRunLengthFeaturesFilter.hxx"
243 #endif
244 
245 #endif
itk::SmartPointer< Self > Pointer
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
const FeatureValueVectorDataObjectType * GetFeatureStandardDeviationsOutput() const
itk::SmartPointer< const Self > ConstPointer
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
EnhancedHistogramToRunLengthFeaturesFilter< HistogramType > RunLengthFeaturesFilterType
This class computes texture feature coefficients from a grey level run-length matrix.
static T max(T x, T y)
Definition: svm.cpp:70
EnhancedScalarImageToRunLengthMatrixFilter< ImageType, FrequencyContainerType > RunLengthMatrixFilterType
static T min(T x, T y)
Definition: svm.cpp:67
const FeatureValueVectorDataObjectType * GetFeatureMeansOutput() const
This class computes a run length matrix (histogram) from a given image and a mask image if provided...
Histogram< MeasurementType, THistogramFrequencyContainer > HistogramType
unsigned short PixelType