Skip to content

Commit bdcfa46

Browse files
author
Thinh Nguyen
authored
handle older open ephys format for single probe
1 parent f0b3d4a commit bdcfa46

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

element_array_ephys/readers/openephys.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,13 @@ def load_probe_data(self):
7979
if processor['@pluginName'] in ('Neuropix-PXI', 'Neuropix-3a'):
8080
if (processor['@pluginName'] == 'Neuropix-3a'
8181
or 'NP_PROBE' not in processor['EDITOR']):
82-
for probe_index in range(len(processor['EDITOR']['PROBE'])):
83-
probe = Probe(processor, probe_index)
82+
if isinstance(processor['EDITOR']['PROBE'], dict):
83+
probe = Probe(processor, 0)
8484
probes[probe.probe_SN] = probe
85+
else:
86+
for probe_index in range(len(processor['EDITOR']['PROBE'])):
87+
probe = Probe(processor, probe_index)
88+
probes[probe.probe_SN] = probe
8589
else:
8690
for probe_index in range(len(processor['EDITOR']['NP_PROBE'])):
8791
probe = Probe(processor, probe_index)
@@ -137,7 +141,7 @@ def __init__(self, processor, probe_index=0):
137141
self.processor_id = int(processor['@NodeId'])
138142

139143
if processor['@pluginName'] == 'Neuropix-3a' or 'NP_PROBE' not in processor['EDITOR']:
140-
self.probe_info = processor['EDITOR']['PROBE'][probe_index]
144+
self.probe_info = processor['EDITOR']['PROBE'] if isinstance(processor['EDITOR']['PROBE'], dict) else processor['EDITOR']['PROBE'][probe_index]
141145
self.probe_SN = self.probe_info['@probe_serial_number']
142146
self.probe_model = {
143147
"Neuropix-PXI": "neuropixels 1.0 - 3B",

element_array_ephys/readers/spikeglx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
class SpikeGLX:
1717

18+
required_files = ('*.ap.meta', '*.ap.bin')
19+
1820
def __init__(self, root_dir):
1921
'''
2022
create neuropixels reader from 'root name' - e.g. the recording:

0 commit comments

Comments
 (0)