Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
old/mitkExtendedStatisticsImageFilter.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 #ifndef __mitkExtendedStatisticsImageFilter_h
17 #define __mitkExtendedStatisticsImageFilter_h
18 
19 #include "itkStatisticsImageFilter.h"
20 #include "itkScalarImageToHistogramGenerator.h"
21 #include <mbilog.h>
22 #include <mitkLogMacros.h>
23 
24 namespace itk
25 {
44  template< class TInputImage >
45  class ExtendedStatisticsImageFilter : public StatisticsImageFilter< TInputImage >
46  {
47  public:
50  typedef StatisticsImageFilter< TInputImage > Superclass;
53  typedef typename Superclass::RealType RealType;
54  typedef typename Superclass::RealObjectType RealObjectType;
55  typedef typename Superclass::PixelType PixelType;
56 
57  itkFactorylessNewMacro( Self );
58  itkCloneMacro( Self );
59  itkTypeMacro( ExtendedStatisticsImageFilter, StatisticsImageFilter );
60 
61 
62  typedef itk::Statistics::ScalarImageToHistogramGenerator< TInputImage >
64 
68  double GetSkewness() const
69  {
70  return this->GetSkewnessOutput()->Get();
71  }
72 
76  double GetMedian() const
77  {
78  return this->GetMedianOutput()->Get();
79  }
80 
84  double GetKurtosis() const
85  {
86  return this->GetKurtosisOutput()->Get();
87  }
88 
89  /* \brief Return the computed MPP.
90  */
91  double GetMPP() const
92  {
93  return this->GetMPPOutput()->Get();
94  }
95 
99  double GetUniformity() const
100  {
101  return this->GetUniformityOutput()->Get();
102  }
103 
107  double GetEntropy() const
108  {
109  return this->GetEntropyOutput()->Get();
110  }
111 
115  double GetUPP() const
116  {
117  return this->GetUPPOutput()->Get();
118  }
119 
120 
124  const typename HistogramGeneratorType::HistogramType*
126  {
127  return m_HistogramGenerator->GetOutput();
128  }
129 
133  void SetBinSize(int size);
134 
135  protected:
136 
138 
140 
145  void CalculateHistogram();
146 
155 
163  bool m_HistogramCalculated;
164 
165 
166  RealObjectType* GetSkewnessOutput();
167 
168  const RealObjectType* GetSkewnessOutput() const;
169 
170  RealObjectType* GetKurtosisOutput();
171 
172  const RealObjectType* GetKurtosisOutput() const;
173 
174  RealObjectType* GetMPPOutput();
175 
176  const RealObjectType* GetMPPOutput() const;
177 
178  RealObjectType* GetEntropyOutput();
179 
180  const RealObjectType* GetEntropyOutput() const;
181 
182  RealObjectType* GetUniformityOutput();
183 
184  const RealObjectType* GetUniformityOutput() const;
185 
186  RealObjectType* GetUPPOutput();
187 
188  const RealObjectType* GetUPPOutput() const;
189 
190  RealObjectType* GetMedianOutput();
191 
192  const RealObjectType* GetMedianOutput() const;
193 
194  virtual DataObject::Pointer MakeOutput( ProcessObject::DataObjectPointerArraySizeType idx );
195 
196 
197  }; // end of class
198 
199 } // end namespace itk
200 
201 #ifndef ITK_MANUAL_INSTANTIATION
202 #include "mitkExtendedStatisticsImageFilter.hxx"
203 #endif
204 
205 #endif
itk::Statistics::ScalarImageToHistogramGenerator< TInputImage > HistogramGeneratorType
RealObjectType * GetMedianOutput()
const HistogramGeneratorType::HistogramType * GetHistogram()
Return the computed Histogram.
void SetBinSize(int size)
Set the Binsize for the Histogram.
itk::SmartPointer< Self > Pointer
double GetUPP() const
Return the computed UPP.
double GetEntropy() const
Return the computed Entropy.
double GetUniformity() const
Return the computed Uniformity.
RealObjectType * GetEntropyOutput()
RealObjectType * GetSkewnessOutput()
RealObjectType * GetUniformityOutput()
double GetMedian() const
Return the computed Median.
RealObjectType * GetKurtosisOutput()
HistogramGeneratorType::Pointer m_HistogramGenerator
Histogram.
virtual DataObject::Pointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx)
Extension of the itkStatisticsImageFilter that also calculates the Skewness and Kurtosis.
double GetKurtosis() const
Return the computed Kurtosis.
unsigned short PixelType
void ComputeSkewnessKurtosisAndMPP()
Compute Entropy,uniformity,MPP,UPP, Median.
StatisticsImageFilter< TInputImage > Superclass
double GetSkewness() const
Return the computed Skewness.