meanap.pipeline.io¶
I/O helpers for MEA-NAP pipeline files.
Handles HDF5/v7.3 .mat files produced by the Axion MEA system and by
the MATLAB MEA-NAP pipeline. scipy.io.loadmat cannot read v7.3 files,
so we use h5py throughout.
Functions
|
Load a raw MEA recording .mat file (HDF5/v7.3 format). |
|
Read spike times from a MEA-NAP |
|
Load spike times saved by |
|
Save spike detection results to a |
- meanap.pipeline.io.load_raw_recording(path)[source]¶
Load a raw MEA recording .mat file (HDF5/v7.3 format).
- Returns:
dat ((n_samples, n_channels) float32 array — raw voltage traces)
channels ((n_channels,) int array — channel IDs)
fs (float — sampling frequency in Hz)
- Parameters:
path (str | Path)
- Return type:
tuple[ndarray, ndarray, float]
- meanap.pipeline.io.load_spike_times_mat(path)[source]¶
Read spike times from a MEA-NAP
_spikes.mat(HDF5/v7.3) file.- Returns:
spike_times –
channel_indexis 0-based.methodis e.g.'bior1p5','thr4','thr5'.- Return type:
dict[channel_index, dict[method, times_in_seconds]]
- Parameters:
path (str | Path)
- meanap.pipeline.io.load_spike_times_npz(path)[source]¶
Load spike times saved by
save_spike_times_npz.- Parameters:
path (str | Path)
- Return type:
dict[int, dict[str, ndarray]]
- meanap.pipeline.io.save_spike_times_npz(path, spike_times, channels, fs, params=None)[source]¶
Save spike detection results to a
.npzfile.Saved arrays¶
channels— channel IDsfs— sampling frequencyspike_times_{ch}_{method}— spike times in seconds for each channel/methodAlso saves a text file
{stem}_params.txtalongside ifparamsgiven.- Parameters:
path (str | Path)
spike_times (dict[int, dict[str, ndarray]])
channels (ndarray)
fs (float)
params (dict[str, Any] | None)
- Return type:
None