Skip to content

Commit 11a12ba

Browse files
author
Thinh Nguyen
committed
update openephys loader - handle new open ephys format
1 parent 85c7c8b commit 11a12ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

element_array_ephys/readers/openephys.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def load_probe_data(self):
110110
assert continuous_info['sample_rate'] == analog_signal.sample_rate == 2500
111111
continuous_type = 'lfp'
112112
else:
113-
match = re.search('\.?-?(AP|LFP)$', continuous_info['folder_name'].strip('/'))
113+
match = re.search('-(AP|LFP)$', continuous_info['folder_name'].strip('/'))
114114
continuous_type = match.groups()[0].lower()
115115

116116
if continuous_type == 'ap':
@@ -143,7 +143,11 @@ def load_probe_data(self):
143143
class Probe:
144144

145145
def __init__(self, processor, probe_index=0):
146-
self.processor_id = int(processor['@NodeId'])
146+
processor_node_id = processor.get("@nodeId", processor.get("@NodeId"))
147+
if processor_node_id is None:
148+
raise KeyError('Neither "@nodeId" nor "@NodeId" key found')
149+
150+
self.processor_id = int(processor_node_id)
147151

148152
if processor['@pluginName'] == 'Neuropix-3a' or 'NP_PROBE' not in processor['EDITOR']:
149153
self.probe_info = processor['EDITOR']['PROBE'] if isinstance(processor['EDITOR']['PROBE'], dict) else processor['EDITOR']['PROBE'][probe_index]

0 commit comments

Comments
 (0)