ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkHistogramToTextureFeaturesFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkHistogramToTextureFeaturesFilter_h
19 #define itkHistogramToTextureFeaturesFilter_h
20 
21 #include "itkHistogram.h"
22 #include "itkMacro.h"
23 #include "itkProcessObject.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
101 template< typename THistogram >
102 class ITK_TEMPLATE_EXPORT HistogramToTextureFeaturesFilter:public ProcessObject
103 {
104 public:
110 
113 
115  itkNewMacro(Self);
116 
117  typedef THistogram HistogramType;
118  typedef typename HistogramType::Pointer HistogramPointer;
119  typedef typename HistogramType::ConstPointer HistogramConstPointer;
120  typedef typename HistogramType::MeasurementType MeasurementType;
121  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
123  typedef typename HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType;
124  typedef typename HistogramType::RelativeFrequencyType RelativeFrequencyType;
125 
126  typedef typename HistogramType::TotalAbsoluteFrequencyType
128 
129  typedef typename HistogramType::TotalRelativeFrequencyType
131 
133  typedef std::vector< RelativeFrequencyType > RelativeFrequencyContainerType;
134 
136  using Superclass::SetInput;
137  void SetInput(const HistogramType *histogram);
138 
139  const HistogramType * GetInput() const;
140 
143 
146 
148  MeasurementType GetEnergy() const;
149 
150  const MeasurementObjectType * GetEnergyOutput() const;
151 
153  MeasurementType GetEntropy() const;
154 
155  const MeasurementObjectType * GetEntropyOutput() const;
156 
158  MeasurementType GetCorrelation() const;
159 
160  const MeasurementObjectType * GetCorrelationOutput() const;
161 
163  MeasurementType GetInverseDifferenceMoment() const;
164 
165  const MeasurementObjectType * GetInverseDifferenceMomentOutput() const;
166 
168  MeasurementType GetInertia() const;
169 
170  const MeasurementObjectType * GetInertiaOutput() const;
171 
173  MeasurementType GetClusterShade() const;
174 
175  const MeasurementObjectType * GetClusterShadeOutput() const;
176 
178  MeasurementType GetClusterProminence() const;
179 
180  const MeasurementObjectType * GetClusterProminenceOutput() const;
181 
183  MeasurementType GetHaralickCorrelation() const;
184 
185  const MeasurementObjectType * GetHaralickCorrelationOutput() const;
186 
188  typedef enum {
197  InvalidFeatureName
198  } TextureFeatureName;
199 
201  MeasurementType GetFeature(TextureFeatureName name);
202 
203 protected:
206  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
207 
210  using Superclass::MakeOutput;
211  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
212 
213  virtual void GenerateData() ITK_OVERRIDE;
214 
215 private:
216  ITK_DISALLOW_COPY_AND_ASSIGN(HistogramToTextureFeaturesFilter);
217 
218  void ComputeMeansAndVariances(double & pixelMean, double & marginalMean,
219  double & marginalDevSquared, double & pixelVariance);
220 
221  RelativeFrequencyContainerType m_RelativeFrequencyContainer;
222 };
223 } // end of namespace Statistics
224 } // end of namespace itk
225 
226 #ifndef ITK_MANUAL_INSTANTIATION
227 #include "itkHistogramToTextureFeaturesFilter.hxx"
228 #endif
229 
230 #endif
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Light weight base class for most itk classes.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
This class computes texture feature coefficients from a grey level co-occurrence matrix.
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
HistogramType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType
HistogramType::TotalRelativeFrequencyType TotalRelativeFrequencyType
SimpleDataObjectDecorator< MeasurementType > MeasurementObjectType
Control indentation during Print() invocation.
Definition: itkIndent.h:49