ITK  4.2.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 {
102 template< class THistogram >
104 {
105 public:
111 
114 
116  itkNewMacro(Self);
117 
118  typedef THistogram HistogramType;
119  typedef typename HistogramType::Pointer HistogramPointer;
120  typedef typename HistogramType::ConstPointer HistogramConstPointer;
121  typedef typename HistogramType::MeasurementType MeasurementType;
122  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
123  typedef typename HistogramType::IndexType IndexType;
124  typedef typename HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType;
125  typedef typename HistogramType::RelativeFrequencyType RelativeFrequencyType;
126 
127  typedef typename HistogramType::TotalAbsoluteFrequencyType
129 
130  typedef typename HistogramType::TotalRelativeFrequencyType
132 
134  typedef std::vector< RelativeFrequencyType > RelativeFrequencyContainerType;
135 
137  using Superclass::SetInput;
138  void SetInput(const HistogramType *histogram);
139 
140  const HistogramType * GetInput() const;
141 
144 
147 
149  MeasurementType GetEnergy() const;
150 
151  const MeasurementObjectType * GetEnergyOutput() const;
152 
154  MeasurementType GetEntropy() const;
155 
156  const MeasurementObjectType * GetEntropyOutput() const;
157 
159  MeasurementType GetCorrelation() const;
160 
161  const MeasurementObjectType * GetCorrelationOutput() const;
162 
164  MeasurementType GetInverseDifferenceMoment() const;
165 
166  const MeasurementObjectType * GetInverseDifferenceMomentOutput() const;
167 
169  MeasurementType GetInertia() const;
170 
171  const MeasurementObjectType * GetInertiaOutput() const;
172 
174  MeasurementType GetClusterShade() const;
175 
176  const MeasurementObjectType * GetClusterShadeOutput() const;
177 
179  MeasurementType GetClusterProminence() const;
180 
181  const MeasurementObjectType * GetClusterProminenceOutput() const;
182 
184  MeasurementType GetHaralickCorrelation() const;
185 
186  const MeasurementObjectType * GetHaralickCorrelationOutput() const;
187 
189  typedef enum {
198  InvalidFeatureName
199  } TextureFeatureName;
200 
202  MeasurementType GetFeature(TextureFeatureName name);
203 
204 protected:
207  void PrintSelf(std::ostream & os, Indent indent) const;
208 
211  using Superclass::MakeOutput;
213 
214  void GenerateData();
215 
216 private:
217  HistogramToTextureFeaturesFilter(const Self &); //purposely not implemented
218  void operator=(const Self &); //purposely not implemented
219 
220  void ComputeMeansAndVariances(double & pixelMean, double & marginalMean,
221  double & marginalDevSquared, double & pixelVariance);
222 
224 };
225 } // end of namespace Statistics
226 } // end of namespace itk
227 
228 #ifndef ITK_MANUAL_INSTANTIATION
229 #include "itkHistogramToTextureFeaturesFilter.hxx"
230 #endif
231 
232 #endif
233