Skip to content

baseline='constant' subtracts the minimum over all neurons rather than a per-trace constant #1269

Description

@cindykrafft

In extraction/dcnv.py::preprocess:

elif baseline == "constant":
    Flow = gaussian_filter(F, [0., sig_baseline])
    Flow = np.amin(Flow)
    F -= Flow

np.amin runs over the whole (n_neurons, n_frames) array, so the same scalar — the smoothed minimum of the lowest neuron — is subtracted from every trace. Any neuron whose own minimum is above that value keeps a positive floor, which the non-negative, unpenalised OASIS step then turns into a steady stream of small "spikes". The parameter description ("Width of Gaussian filter in frames (applied to find constant or before maximin filter)") reads as a per-trace constant, which would be np.amin(Flow, axis=1, keepdims=True). Present since at least v0.14.4; the default maximin is unaffected.

Is the global scalar intended? If not I am happy to send the one-line per-trace change.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions