Normalize SPECT images into percentile or creating segments by percentile of the SPECT count valuse

I was wondering if there is a function to renormalize the image intensity into percentiles, or there is a filter to create segments based on whatever percentile of the image intensity values. I am working on SPECT images which contain count values.