From 8055ce554d49233eeee9d3c02d4b6956ed4ec896 Mon Sep 17 00:00:00 2001 From: Nikhil Chandra Date: Mon, 2 Sep 2024 16:41:01 -0500 Subject: [PATCH 1/2] Changed references m_ChannelEnabled to m_ChannelRecordingEnabled to correctly handle PL2 (Plexon2) files with enabled but unrecorded channels. --- neo/rawio/plexon2rawio/plexon2rawio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neo/rawio/plexon2rawio/plexon2rawio.py b/neo/rawio/plexon2rawio/plexon2rawio.py index 31873b8d6..df1f03f42 100644 --- a/neo/rawio/plexon2rawio/plexon2rawio.py +++ b/neo/rawio/plexon2rawio/plexon2rawio.py @@ -157,7 +157,7 @@ def _parse_header(self): for c in range(self.pl2reader.pl2_file_info.m_TotalNumberOfAnalogChannels): achannel_info = self.pl2reader.pl2_get_analog_channel_info(c) # only consider active channels - if not achannel_info.m_ChannelEnabled: + if not achannel_info.m_ChannelRecordingEnabled: continue # assign to matching stream or create new stream based on signal characteristics @@ -199,7 +199,7 @@ def _parse_header(self): schannel_info = self.pl2reader.pl2_get_spike_channel_info(c) # only consider active channels - if not schannel_info.m_ChannelEnabled: + if not schannel_info.m_ChannelRecordingEnabled: continue for channel_unit_id in range(schannel_info.m_NumberOfUnits): @@ -223,7 +223,7 @@ def _parse_header(self): echannel_info = self.pl2reader.pl2_get_digital_channel_info(i) # only consider active channels - if not echannel_info.m_ChannelEnabled: + if not echannel_info.m_ChannelRecordingEnabled: continue # event channels are characterized by (name, id, type), with type in ['event', 'epoch'] From bd9a6492361f3b678e8ee7760afabc830805b1a0 Mon Sep 17 00:00:00 2001 From: Nikhil Chandra Date: Tue, 3 Sep 2024 15:12:31 -0500 Subject: [PATCH 2/2] Updated conditional checks to look at both m_ChannelEnabled and m_ChannelRecordingEnabled (either one or the other does not work) for PL2 (Plexon2) files. --- neo/rawio/plexon2rawio/plexon2rawio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neo/rawio/plexon2rawio/plexon2rawio.py b/neo/rawio/plexon2rawio/plexon2rawio.py index df1f03f42..b6b8d4e5c 100644 --- a/neo/rawio/plexon2rawio/plexon2rawio.py +++ b/neo/rawio/plexon2rawio/plexon2rawio.py @@ -157,7 +157,7 @@ def _parse_header(self): for c in range(self.pl2reader.pl2_file_info.m_TotalNumberOfAnalogChannels): achannel_info = self.pl2reader.pl2_get_analog_channel_info(c) # only consider active channels - if not achannel_info.m_ChannelRecordingEnabled: + if not (achannel_info.m_ChannelEnabled and achannel_info.m_ChannelRecordingEnabled): continue # assign to matching stream or create new stream based on signal characteristics @@ -199,7 +199,7 @@ def _parse_header(self): schannel_info = self.pl2reader.pl2_get_spike_channel_info(c) # only consider active channels - if not schannel_info.m_ChannelRecordingEnabled: + if not (schannel_info.m_ChannelEnabled and schannel_info.m_ChannelRecordingEnabled): continue for channel_unit_id in range(schannel_info.m_NumberOfUnits): @@ -223,7 +223,7 @@ def _parse_header(self): echannel_info = self.pl2reader.pl2_get_digital_channel_info(i) # only consider active channels - if not echannel_info.m_ChannelRecordingEnabled: + if not (echannel_info.m_ChannelEnabled and echannel_info.m_ChannelRecordingEnabled): continue # event channels are characterized by (name, id, type), with type in ['event', 'epoch']