MouseLand / suite2p

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

Registration metrics do not exclude bad frames #1144

Open samupicard opened 2 months ago

samupicard commented 2 months ago

As far as I understand, the registration metrics do not exclude any of the 'bad frames' at the moment: the PCA is performed on an equally subsampled set of frames from the registered movie. This leads to really high metrics on sessions where there were artefacts e.g. the signal dropping suddenly (I've attached a screenshot from the GUI as an example). This approach makes sense for the automatically computed bad frames as you would otherwise underestimate potential registration errors, but surely it would be good to at least take into account the user-defined bad_frames.npy array for these metrics?

It seems that this would be relatively easy fix in this part of the main pipeline code... https://github.com/MouseLand/suite2p/blob/c88e1ba3aa2013fe379e64c7e45ae73a417eb4a7/suite2p/run_s2p.py#L148-L163

samupicard commented 2 months ago

reg_metrics_suite2p