This function equalizes the gray values throughout an entire image stack. It scales the intensities of all slices to a common mean intensity value and standard deviation. The goal is a harmonization of the gray value distribution within a z-stack. With this process, brighter image slices will get darker and darker slices will get brighter.