# AttributeError: module 'itk' has no attribute 'AdaptiveHistogramEqualizationImageFilter'

**URL:** https://discourse.itk.org/t/attributeerror-module-itk-has-no-attribute-adaptivehistogramequalizationimagefilter/4295
**Category:** Uncategorized
**Created:** [July 27, 2021, 9:46pm UTC](https://discourse.itk.org/t/attributeerror-module-itk-has-no-attribute-adaptivehistogramequalizationimagefilter/4295 "2021-07-27T21:46:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)
#### Post date: [July 27, 2021, 9:46pm UTC](https://discourse.itk.org/t/attributeerror-module-itk-has-no-attribute-adaptivehistogramequalizationimagefilter/4295/1 "2021-07-27T21:46:41Z")

</div>

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?

```auto
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

---

<div class="post-metadata">

### Author: ![Lee\_Newberg](https://discourse.itk.org/user_avatar/discourse.itk.org/lee_newberg/32/1461_2.png) [@Lee\_Newberg](https://discourse.itk.org/u/Lee_Newberg)
#### Post date: [July 28, 2021, 2:19pm UTC](https://discourse.itk.org/t/attributeerror-module-itk-has-no-attribute-adaptivehistogramequalizationimagefilter/4295/2 "2021-07-28T14:19:50Z")

</div>

The use of that filter from Python was disabled for reasons that I don’t fully understand. I will try to figure out what’s up with that.

---

<div class="post-metadata">

### Author: ![Lee\_Newberg](https://discourse.itk.org/user_avatar/discourse.itk.org/lee_newberg/32/1461_2.png) [@Lee\_Newberg](https://discourse.itk.org/u/Lee_Newberg)
#### Post date: [July 29, 2021, 6:44pm UTC](https://discourse.itk.org/t/attributeerror-module-itk-has-no-attribute-adaptivehistogramequalizationimagefilter/4295/3 "2021-07-29T18:44:57Z")

</div>

The Python was disabled due to some incompatibilities with third-party code. Preliminary testing on my part shows that those incompatibilities are no longer an issue. I am going to put it through the full test suite and if all is still looking good, we can re-enable the Python versions.

---

<div class="post-metadata">

### Author: ![Lee\_Newberg](https://discourse.itk.org/user_avatar/discourse.itk.org/lee_newberg/32/1461_2.png) [@Lee\_Newberg](https://discourse.itk.org/u/Lee_Newberg)
#### Post date: [July 30, 2021, 6:47pm UTC](https://discourse.itk.org/t/attributeerror-module-itk-has-no-attribute-adaptivehistogramequalizationimagefilter/4295/4 "2021-07-30T18:47:52Z")

</div>

A fix for this is looking feasible. Please see [ITK Pull Request 2667](https://github.com/InsightSoftwareConsortium/ITK/pull/2667) to track the progress.
