Saturation handling in QuickPALM Analyze Particles with 16-bit virtual stacks

analyze-particles
imagej
virtualstack

#1

I was trying to understand how the Analyze Particles from the QuickPALM plugin works, so rebuilt it with some extra logging (here is what I changed).
I noticed something strange about the saturation handling. It calls ImageProcessor.getMax() to get the saturation value and masks out any pixels with that value. When opening a 16-bit raw (non-virtual) stack this returns 65535 as expected. When I open the exact same file as a virtual stack, getMax now starts returning the highest valued pixel in the first slice (in my case 2128), meaning that some pixels will be erroneously masked out if there is no actual saturation.
Is this a bug, or am I missing something?