MouseLand / suite2p

cell detection in calcium imaging recordings
http://www.suite2p.org
GNU General Public License v3.0
334 stars 239 forks source link

big changes in intensity range after bilinear interpolation in non-rigid registration #784

Open pwang724 opened 2 years ago

pwang724 commented 2 years ago

After non-rigid registration I noticed that the pixel intensity ranges are dramatically different compared to the raw image. I took the raw fluorescence by multiplying the binary roi mask (unweighted) with either the raw tifs or with registered tifs outputted by suite2p after non-rigid registration (reg_tif = True). I found that the fluorescence measurements significantly differed between the two. My expectation is that intensity values should be more or less halved, as per tiff_to_binary.py, but they are instead higher. For example,

This is the fluorescence from raw images:

image

This is the fluorescence from non-rigid registered tifs:

image

Moreover, a significant amount of pixel intensities are negative.

Is this some odd behavior from bilinear interpolation? Is this reproducible in your hands?

carsen-stringer commented 2 years ago

could this be when the tiff is saved it is a different format? have you checked the fluorescence values from stat?