Skip to content

add channel re-mapping to analysis module? #36

Open

Description

@chucklescience

A user was asking if we could provide a python function in this library to rearrange data channels based on a channel map file (from the Channel Map plugin). This would be for a use case in which the channel map was placed after the Record Node in the signal chain.

Activity

  1. Rodgers-PAC-Lab commented on Feb 27, 2025

    @Rodgers-PAC-Lab

    Could I ask for clarification on this? If the "Channel Map" is placed before the "Record Node", does this change the ordering of channels in the binary file, or their channel_names in the metadata, or both?

    For instance, for my system, 'CH16' (1-based index) aka Intan Channel 15 (0-based index) is the first channel. I made a channel map file. In the LFP Viewer, the top channel is labeled 'CH16'. In session.recordnodes[0].recordings[0].continuous[0].metadata['channel_name'], the first entry is 'CH16'. However, the first column of session.recordnodes[0].recordings[0].continuous[0].samples does not appear to be CH16, it looks to me like it's CH1 (Intan channel 0), as if the ordering of data in the binary file is unaffected by the channel map plugin.

    When I say the first column of the data doesn't appear to be CH16, I'm just going based on my memory of what the channels looked like, and the ordering of data. I could be wrong about that. Can you please clarify what determines the order of channels in the saved data file?

  2. jsiegle commented on Feb 27, 2025

    @jsiegle
    Member

    If it's placed to the left of the Record Node, the Channel Map plugin will change the order of the channel names and the order of the channels in the binary file.

    You can verify this with the following signal chain: File Reader > Bandpass Filter > Channel Map > Record Node. If you apply the filter only to CH1, then use the Channel Map to place CH1 at the end (after CH16), the filtered channel will appear last when you load the data.

  3. Rodgers-PAC-Lab commented on Feb 28, 2025

    @Rodgers-PAC-Lab

    Thanks Josh. I was confusing myself somehow. I can see now that the Channel Map is reordering channels in the datafile, as expected. So the metadata channel_names will always properly label the columns of data, regardless of where any Channel Maps were placed in the signal chain.
    -Chris

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