I have install through pip ITK 5.2 into an anaconda virtual environment running python 3.8. I am trying to use the AdaptiveHistogramEqualizationImageFilter in my python code and I am getting the following error:
AttributeError: module ‘itk’ has no attribute ‘AdaptiveHistogramEqualizationImageFilter’. I can successfully use other filters from ITK but just not this one?
from typing import List, Tuple
import numpy as np
import itk
def adjust_image_contrast(img_arrays:List[np.ndarray], shift_scale: float,
shift: int) -> List[np.ndarray]:
processed_arrays = []
for img_array in img_arrays:
img = itk.GetImageFromArray(img_array)
img_type = type(img)
# Use an IntensityWindowingImageFilter to "brighten up the data"
# This would be optional for anyone running the overall workflow
# filter1 = itk.ShiftScaleImageFilter[img_type, img_type].New()
# filter1.SetScale(shift_scale)
# filter1.SetShift(shift)
filter1 = itk.AdaptiveHistogramEqualizationImageFilter.New()
filter1.setAlpha(0.3)
filter1.setBeta(0.3)
filter1.setRadius(10)
filter1.SetInput(img)
filter1.Update()
processed_arrays.append(itk.GetArrayFromImage(filter1.GetOutput()))
return processed_arrays
Anyone have the I’m sure very simple fix?
Thanks
Mike Jackson