Skip to content

Reading in Spikeglx whole-probe survey #1700

@aidapiccato

Description

@aidapiccato

Is your feature request related to a problem? Please describe.
Spikeglx makes it possible to conduct a whole-probe activity survey. Currently, the only way to really look at these is through the SpikeGLX viewer, which means it's not possible to look at multiple at once. Doing so would be useful for comparing trajectories across sessions.

Describe the solution you'd like
An extractor for whole-probe activity survey that would allow preprocessing and functions like peak extraction.

Describe alternatives you've considered
Jennifer Colonell has tools in Python for reading these in, and I've been able to create an n_channels x n_timesteps matrix of raw data. Essentially, the survey data is stored as a (385, n_timesteps_per_bank * n_banks) array, with an additional dimension in the case of multiple shanks (not the case for my recordings, so I am not handling that in the code below). Here is her code base, and here is a snippet of my code that uses these functions and reads in the survey data into a list of arrays.

meta = read_spikeglx.readMeta(bin_path)
banks_times = read_spikeglx.svyBankTimes(meta)
raw_data = read_spikeglx.makeMemMapRaw(bin_path, meta)

samp_rate = read_spikeglx.SampRate(meta)
n_channels_per_bank = raw_data.shape[0]
chan_list = list(range(n_channels_per_bank))
n_banks = banks_times.shape[0]
n_channels_total = n_channels_per_bank * n_banks
bank_data = []
for bank in range(n_banks):
    bank_times = banks_times[bank, :]
    start_time = bank_times[2]
    end_time = bank_times[3]
    start_idx = int(start_time * samp_rate)
    end_idx = int(end_time * samp_rate)
    raw_bank_data = raw_data[:, start_idx:end_idx+1]
    corrected_bank_data = read_spikeglx.GainCorrectIM(raw_bank_data, chan_list, meta)
    bank_data.append(corrected_bank_data)

Note that I added a Python svyBankTimes that is adapted from her MATLAB code.

While this makes it possible to view raw traces, it would be great to have this in an extractor!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions