Skip to content

Request: Add way to only load a subset of channels and range of data #12

Open

Description

@akesner1

Sorry for the post if I am missing something. I am wondering if this functionality could be added so we don't have to load an entire recording.

Activity

  1. jsiegle commented on Apr 18, 2022

    @jsiegle
    Member

    For the Binary and HDF5 formats (NWB and KWIK), the data is memory mapped and only loaded upon request. So this is already implemented for those formats.

    For the Open Ephys format, the data is all loaded at once, so this is a feature we'll want to add. We don't have a timeline for this yet, but we'll leave this issue open because it's important to do.

  2. JonathanAMichaels commented on Jun 26, 2022

    @JonathanAMichaels

    I've also just realized that Open Ephys format files are loaded all at once. This is a huge issue, as all my recordings (not Neuropixels, but still large) are in that format and therefore cannot be loaded on most machines.

  3. jsiegle commented on Jun 27, 2022

    @jsiegle
    Member

    @medengineer we should add this feature ASAP.

    Regarding the implementation, I think we should follow the conventions used by SpikeInterface:

    For a Recording object, querying the .continuous property will still return all of the data as it does currently, but we will add a get_traces() method which can take start_frame, end_frame, and channels arguments, e.g.:

    traces = recording.get_traces(start_frame=0, end_frame=30000, channels=np.arange(10))
    

    would load the first 30k samples for the first 10 channels into memory.

  4. JonathanAMichaels commented on Jun 27, 2022

    @JonathanAMichaels

    Thanks @jsiegle. I'm not proud of it, but I've worked around this in the meantime by loading the data in matlab (while keeping things int16 as much as possible), then dumping to a binary.

  5. jsiegle commented on Oct 31, 2022

    @jsiegle
    Member

    This feature is implemented for the Open Ephys format in the latest version (now available to install via PyPI). See the open_ephys.analysis README file for details.

    The Open Ephys format loader is only compatible with data saved by v0.6.x of the GUI...let us know if you need to load data saved by an earlier version, and we can port the code to the archive branch.

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