Histogram Python

Hi, i’m trying to write these lines in Python but i dont’t know how to declare the variables (size,upperbound,lowerbound,measurement). Can you help me?

typedef itk::Statistics::Histogram<PixelType, 1> HistogramType;
PixelType minValue = itk::NumericTraits::max();
PixelType maxValue = itk::NumericTraits::NonpositiveMin();
HistogramType::Pointer histogram = HistogramType::New();
HistogramType::SizeType size;
HistogramType::MeasurementVectorType lowerBound;
HistogramType::MeasurementVectorType upperBound;
size[0] = 100;
lowerBound.Fill(minValue);
upperBound.Fill(maxValue);
histogram->Initialize(size,lowerBound,upperBound);
histogram->SetToZero();
HistogramType::MeasurementVectorType measurement;
typedef HistogramType::MeasurementType MeasurementType;
measurement[0] = itk::NumericTraits::Zero;

These two histogram examples have Python code:
HistogramCreationAndBinAccess
AdaptiveHistogramEqualizationImageFilter
Please take a look.

2 Likes