Skip to content

Commit 1cc36c9

Browse files
author
Nikhil Chandra
committed
Added comment explaining changes from previous commit.
1 parent a27a012 commit 1cc36c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

neo/rawio/plexon2rawio/plexon2rawio.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ def _parse_header(self):
231231
if not (schannel_info.m_ChannelEnabled and schannel_info.m_ChannelRecordingEnabled):
232232
continue
233233

234+
# In a PL2 spike channel header, the field "m_NumberOfUnits" denotes the number
235+
# of units to which spikes detected on that channel have been assigned. It does
236+
# not account for unsorted spikes, i.e., spikes that have not been assigned to
237+
# a unit. It is Plexon's convention to assign unsorted spikes to channel_unit_id=0,
238+
# and sorted spikes to unit_id's 1, 2, 3...etc. Therefore, for a given value of
239+
# m_NumberOfUnits, there are m_NumberOfUnits+1 channel_unit_ids to consider - 1
240+
# unsorted channel_unit_id (0) + the m_NumberOfUnits sorted channel_unit_ids.
234241
for channel_unit_id in range(schannel_info.m_NumberOfUnits+1):
235242
unit_name = f"{schannel_info.m_Name.decode()}.{channel_unit_id}"
236243
unit_id = f"unit{schannel_info.m_Channel}.{channel_unit_id}"

0 commit comments

Comments
 (0)