18 #ifndef itkHistogramToEntropyImageFilter_h
19 #define itkHistogramToEntropyImageFilter_h
54 template<
typename TInput,
typename TOutput =
double >
76 return static_cast< OutputPixelType >( ( -1 ) * p * std::log(p) / std::log(2.0) );
82 return static_cast< OutputPixelType >( ( -1 ) * p * std::log(p) / std::log(2.0) );
101 template<
typename THistogram,
typename TImage=Image<
double, 3> >
104 Function::HistogramEntropyFunction< SizeValueType, typename TImage::PixelType > >
TImage::PixelType OutputPixelType
Light weight base class for most itk classes.
void SetTotalFrequency(const SizeValueType n)
unsigned long SizeValueType
~HistogramEntropyFunction()=default
SizeValueType GetTotalFrequency() const
HistogramToEntropyImageFilter()=default
~HistogramToEntropyImageFilter() override=default
This class takes a histogram as an input and returns an image of type specified by the functor...
The class takes a histogram as an input and gives the entropy image as the output. A pixel, at position I, in the output image is given by.
SizeValueType m_TotalFrequency
OutputPixelType operator()(const TInput &A) const
HistogramEntropyFunction()