pyxem / kikuchipy

Toolbox for analysis of electron backscatter diffraction (EBSD) patterns
https://kikuchipy.org
GNU General Public License v3.0
81 stars 30 forks source link

Optimize adaptive histogram equalization #534

Closed hakonanes closed 1 year ago

hakonanes commented 2 years ago

The implementation of adaptive histogram equalization (calling scikit-image's equalize_adapthist()) should be optimized.

Potential optimizations include:

The implementation is spread across two files:

https://github.com/pyxem/kikuchipy/blob/c5df967f13e8058e05d8b5e5dd97594a889cf3ca/kikuchipy/signals/ebsd.py#L800-L888

which calls

https://github.com/pyxem/kikuchipy/blob/c5df967f13e8058e05d8b5e5dd97594a889cf3ca/kikuchipy/pattern/chunk.py#L364-L411

hakonanes commented 2 years ago

This method is also applicable to the EBSD master pattern. Applying it to the master pattern before dictionary generation with EBSDMasterPattern.get_patterns() seems to produce comparable relative intensities within patterns to the case where equalization is done to each individual pattern after dictionary generation (without equalization applied to the master pattern).

hakonanes commented 1 year ago

I don't adaptive histogram equalization myself, and have not encountered someone who finds this method in kikuchipy useful. If you're that person, feel free to say so and I'll re-open this issue!