AbbyCui / CalciumImagingAnalysis

1 stars 2 forks source link

Change of normalization #23

Open cawarwick opened 1 month ago

cawarwick commented 1 month ago

Alternate method of normalization: Rather than specifying which baseline periods to use, we could do a more generic solution. Suite2p uses "We first baseline the traces using the rolling max of the rolling min."

e.g. in bins of 60 seconds it finds the rolling minimum values among the 60 second window and then finds the max of the min values. It then smooths the resultant min/maxed value with a gaussian filter and uses those values for the normalization.

I haven't tested what this looks like relative to just taking a rolling percentile, but it's a possibility.

cawarwick commented 1 month ago

e.g is it worth de-trending each recording separately? e.g. this example has z-drift problems which arguably is cause for exclusion, but we could consider this as a signature of a cell to exclude, e.g. we look at the linear regression of the min/max smoothed recording and if it follows a thresholded amount of slope then we exclude the cell because it has an unacceptable amount of drift?

It might be worth considering each recording as a separate 'session' the way that in vivo recordings do muilti-day recordings. e.g. we'd apply criteria to each recording separately, and then when merging the recordings we only include cells which meet a consistent threshold across all 'sessions'?

image