Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
itkEnhancedScalarImageToSizeZoneFeaturesFilter.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 __itkEnhancedScalarImageToSizeZoneFeaturesFilter_h
31 #define __itkEnhancedScalarImageToSizeZoneFeaturesFilter_h
32 
33 #include "itkDataObjectDecorator.h"
34 
37 
38 namespace itk
39 {
40  namespace Statistics
41  {
106  template< typename TImageType,
107  typename THistogramFrequencyContainer = DenseFrequencyContainer2 >
109  {
110  public:
113  typedef ProcessObject Superclass;
116 
118  itkTypeMacro(EnhancedScalarImageToSizeZoneFeaturesFilter, ProcessObject);
119 
121  itkNewMacro(Self);
122 
123  typedef THistogramFrequencyContainer FrequencyContainerType;
124  typedef TImageType ImageType;
125  typedef typename ImageType::Pointer ImagePointer;
126 
127  typedef typename ImageType::PixelType PixelType;
128  typedef typename ImageType::OffsetType OffsetType;
129  typedef VectorContainer< unsigned char, OffsetType > OffsetVector;
130  typedef typename OffsetVector::Pointer OffsetVectorPointer;
131  typedef typename OffsetVector::ConstPointer OffsetVectorConstPointer;
132 
134  ImageType, FrequencyContainerType > SizeZoneMatrixFilterType;
135 
138 
141 
142  typedef short SizeZoneFeatureName;
143  typedef VectorContainer<unsigned char,
144  SizeZoneFeatureName> FeatureNameVector;
145  typedef typename FeatureNameVector::Pointer FeatureNameVectorPointer;
146  typedef typename FeatureNameVector::ConstPointer FeatureNameVectorConstPointer;
147  typedef VectorContainer< unsigned char, double > FeatureValueVector;
148  typedef typename FeatureValueVector::Pointer FeatureValueVectorPointer;
149 
151  typedef DataObject::Pointer DataObjectPointer;
152 
154  typedef DataObjectDecorator< FeatureValueVector >
156 
158 
160  const;
161 
164  using Superclass::SetInput;
165  void SetInput(const ImageType *);
166 
167  const ImageType * GetInput() const;
168 
170  itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
171  itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
172 
174  itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
175  itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
176 
179  itkSetConstObjectMacro(Offsets, OffsetVector);
180  itkGetConstObjectMacro(Offsets, OffsetVector);
181 
184  void SetNumberOfBinsPerAxis(unsigned int);
185 
188  void SetPixelValueMinMax(PixelType min, PixelType max);
189 
192  void SetDistanceValueMinMax( double min, double max );
193 
196  void SetMaskImage(const ImageType *);
197 
198  const ImageType * GetMaskImage() const;
199 
202  void SetInsidePixelValue(PixelType InsidePixelValue);
203 
204  itkGetConstMacro(FastCalculations, bool);
205  itkSetMacro(FastCalculations, bool);
206  itkBooleanMacro(FastCalculations);
207 
208  protected:
211  virtual void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE;
212 
213  void FastCompute();
214 
215  void FullCompute();
216 
218  virtual void GenerateData() ITK_OVERRIDE;
219 
221  typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
222  using Superclass::MakeOutput;
223  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
224 
225  private:
226  typename SizeZoneMatrixFilterType::Pointer m_SizeZoneMatrixGenerator;
227 
228  FeatureValueVectorPointer m_FeatureMeans;
229  FeatureValueVectorPointer m_FeatureStandardDeviations;
230  FeatureNameVectorConstPointer m_RequestedFeatures;
231  OffsetVectorConstPointer m_Offsets;
232  bool m_FastCalculations;
233  };
234  } // end of namespace Statistics
235 } // end of namespace itk
236 
237 #ifndef ITK_MANUAL_INSTANTIATION
238 #include "itkEnhancedScalarImageToSizeZoneFeaturesFilter.hxx"
239 #endif
240 
241 #endif
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE
void SetPixelValueMinMax(PixelType min, PixelType max)
This class computes a run length matrix (histogram) from a given image and a mask image if provided...
EnhancedScalarImageToSizeZoneMatrixFilter< ImageType, FrequencyContainerType > SizeZoneMatrixFilterType
static T max(T x, T y)
Definition: svm.cpp:56
const FeatureValueVectorDataObjectType * GetFeatureMeansOutput() const
static T min(T x, T y)
Definition: svm.cpp:53
const FeatureValueVectorDataObjectType * GetFeatureStandardDeviationsOutput() const
This class computes texture feature coefficients from a grey level Zone-length matrix.
EnhancedHistogramToSizeZoneFeaturesFilter< HistogramType > SizeZoneFeaturesFilterType
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Histogram< MeasurementType, THistogramFrequencyContainer > HistogramType