17 from __future__
import print_function
21 numberOfComponents = 2
23 histogram = itk.Histogram.New(MeasurementVectorSize=numberOfComponents)
26 size = itk.Array.UL(numberOfComponents)
31 histogram.Initialize(size, lowerBound, upperBound)
43 frequencies = [(0, 0), (1, 2), (2, 3), (3, 2), (4, 1), (5, 1), (6, 5), (7, 4), (8, 0)]
45 for instance_identifier, frequency
in frequencies:
46 histogram.SetFrequency(instance_identifier, frequency)
54 "Frequency of the bin at index",
57 histogram.GetFrequency(index),
58 "and the bin's instance identifier is",
59 histogram.GetInstanceIdentifier(index),