You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
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.
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
Activity
Rodgers-PAC-Lab commentedon Feb 27, 2025
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 ofsession.recordnodes[0].recordings[0].continuous[0].samplesdoes 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?
jsiegle commentedon Feb 27, 2025
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.
Rodgers-PAC-Lab commentedon Feb 28, 2025
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