spike_analysis
❭ core
❭ SpikeDetectionCreastTrough
SpikeDetectionCreastTrough¶
-
class spike_analysis.core.SpikeDetectionCreastTrough(reader_object, lim_creast=
'minimum'
, lim_trough='minimum'
, max_creast_trough_interval=2.0
, tdelta=1.0
, stimulus_period=1
, stimulus_period_offset=0
, upper_creast_threshold=np.inf
, cellid='__no_cellid_assigned__'
, spike_time_mode='latest'
)¶ Detects spikes by creast and trough amplitude.
- Parameters:¶
reader_object (
LabViewReader
) – Reader object with get_voltage_traces and get_stim_times method, e.g. ReaderSmrlim_creast (float|str) – threshold above which a creast of a spike is detected as such. Needs to be float,
"minimum"
, or"zero"
. If “minimum” or “zero” is chosen, the threashold will be set based on the histogram of all creasts. If “minimum” is chosen,lim_creast
will be set to the first minimum in the histogram above or equal to . If “zero” is chosen,lim_creast
will be set to the first empty bin.lim_trough (float|str) – want to use a negative value. lim creast and lim_trough need to be both floats, both “zero” or both “minimum”.
max_creast_trough_interval (float) – Maximum interval between creast and trough such that a spike is recognized.
tdelta (float) – minimum interval between spikes
stimulus_period (int) – number of stimuli applied per trial. E.g., for paired pulse stimuli, it should be 2.
stimulus_period_offse (int) – Number of stimulus that initiates first trial.
cellid (str) – name to be used in spike times dataframe
- Attributes:¶
- lim_creast¶
lim_creast used for spike detection (if “minimum” or “zero” was defined, this will be the numeric value used)
- Type:¶
float|str
- lim_trough¶
lim_trough used for spike detection (if “minimum” or “zero” was defined, this will be the numeric value used)
- Type:¶
float|str
- spike_times¶
all extracted spike times, fullfilling creast and trough criterion, filtered such thatthe minimal ISI is above tdelta.
- Type:¶
list
- Methods:¶
Runs the spike detection analysis.
_set_creast_trough
(lim_creast, lim_trough)Sets the creast and trough limits based on the given values.
Extracts spike times from voltage traces.
Get the creast and trough amplitudes based on the histogram of the creasts and troughs.
get_default_events
(show_stim_times, show_trough_candidates)Returns a list of events to be displayed with the
show_events()
method.show_events
(events, savepdf, showfig, ylim)Shows voltage trace, thresholds and events.
Get a dictionary containing the attributes of the SpikeDetectionCreastTrough object.
save
(path)Saves the SpikeDetectionCreastTrough object to a JSON file.
load
(path, init_reader)static Loads a SpikeDetectionCreastTrough object from a JSON file.
skip-doc: