neuralib.imaging.spikes.oasis.oasis_matrix
- neuralib.imaging.spikes.oasis.oasis_matrix(dff, v, w, t, ll, s, tau, fs)[source]
Performs spike deconvolution for a single neuron’s calcium imaging trace using a greedy method
Iterates through each time point in the observed fluorescence signal
dffand enforces a non-negative and non-increasing constraint on the estimated signal. When a violation of this constraint is detected, the function merges the current segment with the previous one, updating the estimated signal accordingly. Finally, it computes the inferred spikes by calculating the difference between successive segments in the deconvolved signal.- Parameters:
dff (ndarray) – The observed calcium fluorescence trace. Array[float, [N, F]|F]
v (ndarray) – A 1D array that will store the estimated deconvolved signal.
w (ndarray) – A 1D array that tracks the weights for merging steps
t (ndarray) – A 1D array that stores the indices of time steps
ll (ndarray) – A 1D array that tracks the weights for merging steps.
s (ndarray) – A 1D array that will store the inferred spikes
tau (float) – The time constant of the calcium indicator
fs (float) – The sampling frequency of the calcium imaging data