Skip to content

Commit 1eb3726

Browse files
authored
Merge pull request #294 from alejoe91/open-ephys-1.0
Support Open Ephys 1.0
2 parents 645c633 + 9d24670 commit 1eb3726

3 files changed

Lines changed: 998 additions & 4 deletions

File tree

src/probeinterface/io.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,15 +1650,12 @@ def read_openephys(
16501650
info_chain = root.find("INFO")
16511651
oe_version = parse(info_chain.find("VERSION").text)
16521652
neuropix_pxi = None
1653-
record_node = None
16541653
for signal_chain in root.findall("SIGNALCHAIN"):
16551654
for processor in signal_chain:
16561655
if "PROCESSOR" == processor.tag:
16571656
name = processor.attrib["name"]
16581657
if "Neuropix-PXI" in name:
16591658
neuropix_pxi = processor
1660-
if "Record Node" in name:
1661-
record_node = processor
16621659

16631660
if neuropix_pxi is None:
16641661
if raise_error:
@@ -1689,8 +1686,14 @@ def read_openephys(
16891686
has_streams = False
16901687
probe_names_used = None
16911688

1689+
# for Open Ephys version < 1.0 np_probes is in the EDITOR field.
1690+
# for Open Ephys version >= 1.0 np_probes is in the CUSTOM_PARAMETERS field.
16921691
editor = neuropix_pxi.find("EDITOR")
1693-
np_probes = editor.findall("NP_PROBE")
1692+
if oe_version < parse("0.9.0"):
1693+
np_probes = editor.findall("NP_PROBE")
1694+
else:
1695+
custom_parameters = editor.find("CUSTOM_PARAMETERS")
1696+
np_probes = custom_parameters.findall("NP_PROBE")
16941697

16951698
if len(np_probes) == 0:
16961699
if raise_error:

0 commit comments

Comments
 (0)