As we started discussing in #31, I think there's an issue with how intensities are being calculated. At a minimum, it needs some documentation, but I also think there's an unintentional repeat of the thresholding operation.
It looks like intensities are rescaled to a log scale where 0=0 and 1.0 = INT_MAX. That makes sense ... working in dB for this type of data makes sense. (But we're not actually working in "dB" ... )
Then, we only keep intensities between the threshold and 1.0 (on that scale), and stretch that to be 0->1, which I guess makes sense if you want to map the intensities above the threshold to a colormap.
However, later in the code these rescaled intensities are compared to the threshold again, which seems wrong.
So, I'm not sure what the input intensity_threshold parameter is supposed to mean. (I would have guessed "only display points whose intensity is at least this fraction of maximum possible intensity", but it's not used that way in the code)
As we started discussing in #31, I think there's an issue with how intensities are being calculated. At a minimum, it needs some documentation, but I also think there's an unintentional repeat of the thresholding operation.