18 #ifndef itkHistogramToEntropyImageFilter_h
19 #define itkHistogramToEntropyImageFilter_h
55 template <
typename TInput,
typename TOutput =
double>
74 const double p = static_cast<OutputPixelType>(A) / static_cast<OutputPixelType>(
m_TotalFrequency);
75 return static_cast<OutputPixelType>((-1) * p * std::log(p) / std::log(2.0));
79 const double p = static_cast<OutputPixelType>(A + 1) / static_cast<OutputPixelType>(
m_TotalFrequency);
80 return static_cast<OutputPixelType>((-1) * p * std::log(p) / std::log(2.0));
101 template <
typename THistogram,
typename TImage = Image<
double, 3>>
105 Function::HistogramEntropyFunction<SizeValueType, typename TImage::PixelType>>