From 9d2467027bdfd08c0db05e830d02661abd070a87 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Thu, 5 Sep 2024 12:17:22 +0200 Subject: [PATCH] Support Open Ephys 1.0 --- src/probeinterface/io.py | 11 +- .../settings.xml | 983 ++++++++++++++++++ tests/test_io/test_openephys.py | 8 + 3 files changed, 998 insertions(+), 4 deletions(-) create mode 100644 tests/data/openephys/OE_1.0_Neuropix-PXI-multi-probe/settings.xml diff --git a/src/probeinterface/io.py b/src/probeinterface/io.py index ea070d1..1175c4b 100644 --- a/src/probeinterface/io.py +++ b/src/probeinterface/io.py @@ -1650,15 +1650,12 @@ def read_openephys( info_chain = root.find("INFO") oe_version = parse(info_chain.find("VERSION").text) neuropix_pxi = None - record_node = None for signal_chain in root.findall("SIGNALCHAIN"): for processor in signal_chain: if "PROCESSOR" == processor.tag: name = processor.attrib["name"] if "Neuropix-PXI" in name: neuropix_pxi = processor - if "Record Node" in name: - record_node = processor if neuropix_pxi is None: if raise_error: @@ -1689,8 +1686,14 @@ def read_openephys( has_streams = False probe_names_used = None + # for Open Ephys version < 1.0 np_probes is in the EDITOR field. + # for Open Ephys version >= 1.0 np_probes is in the CUSTOM_PARAMETERS field. editor = neuropix_pxi.find("EDITOR") - np_probes = editor.findall("NP_PROBE") + if oe_version < parse("0.9.0"): + np_probes = editor.findall("NP_PROBE") + else: + custom_parameters = editor.find("CUSTOM_PARAMETERS") + np_probes = custom_parameters.findall("NP_PROBE") if len(np_probes) == 0: if raise_error: diff --git a/tests/data/openephys/OE_1.0_Neuropix-PXI-multi-probe/settings.xml b/tests/data/openephys/OE_1.0_Neuropix-PXI-multi-probe/settings.xml new file mode 100644 index 0000000..9770a39 --- /dev/null +++ b/tests/data/openephys/OE_1.0_Neuropix-PXI-multi-probe/settings.xml @@ -0,0 +1,983 @@ + + + + + 1.0.0-alpha.1 + 9 + 14 Aug 2024 16:54:06 + Windows 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +