I am trying to perform a threshold operation on images with varying intensities. I’ve included three example histograms from these images, and in each case I want the threshold to be at the indicated point, which is always on the down slope of the peak in intensities. This peak represents the intensity of a specific area of all the images, is it possible to set the threshold based on the intensity of a part of the image? Alternatively, is it possible to scale the intensity of the entire image? I’m very comfortable in matlab, and not so much in python, would it be required to write a custom module, or is there a combination of built in functionality which will work for me?