neuralib.suite2p.signals.get_neuron_signal

neuralib.suite2p.signals.get_neuron_signal(s2p, n=None, *, signal_type='df_f', normalize=True, dff=True, correct_neuropil=True, method='maximin')[source]

Select neuronal signals for analysis. For single cell (F,) OR multiple cells (N, F)

Parameters:
  • s2p (Suite2PResult) – suite 2p result

  • n (int | ndarray | list[int] | None) – neuron index (int) or index arraylike (Array[int, N]). If None, then use all neurons

  • signal_type (Literal['df_f', 'spks']) – signal type. SIGNAL_TYPE {‘df_f’, ‘spks’}

  • normalize (bool) – 01 normalization for each neuron

  • dff (bool) – normalize to the baseline fluorescence changed (dF/F)

  • correct_neuropil (bool) – do the neuropil correction

  • method (Literal['maximin', 'constant', 'constant_prctile']) – baseline calculation method {‘maximin’, ‘constant’, ‘constant_prctile’}

Returns:

tuple with (signal, baseline signal). Array[float, F|[N,F]]

Return type:

tuple[ndarray, ndarray]