From 5ebbe87ea5f384578645cacdb783c421fc682dbb Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 29 Apr 2025 10:54:54 +0200 Subject: [PATCH 1/3] Patch to support Quad-Base naming in read_openephys --- src/probeinterface/neuropixels_tools.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/probeinterface/neuropixels_tools.py b/src/probeinterface/neuropixels_tools.py index 75df3106..90de3c06 100644 --- a/src/probeinterface/neuropixels_tools.py +++ b/src/probeinterface/neuropixels_tools.py @@ -1000,13 +1000,19 @@ def read_openephys( if len(stream_fields) > 0: has_streams = True streams = [] - # find probe names (exclude ADC streams) + probe_names_used = [] for stream_field in stream_fields: stream = stream_field.attrib["name"] + # exclude ADC streams if "ADC" not in stream: streams.append(stream) - # find probe names (exclude ADC streams) - probe_names_used = np.unique([stream.split("-")[0] for stream in streams]) + # find probe name (exclude AP-LFP from stream name) + if "AP" in stream or "LFP" in stream: + probe_name_ = stream.split("-")[0] + else: + probe_name_ = stream + if probe_name_ not in probe_names_used: + probe_names_used.append(probe_name_) else: has_streams = False probe_names_used = None From 13c08fe73c78f53a5cc60516d5a6f0ab69dd733e Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 29 Apr 2025 11:06:02 +0200 Subject: [PATCH 2/3] improve logic --- src/probeinterface/neuropixels_tools.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/probeinterface/neuropixels_tools.py b/src/probeinterface/neuropixels_tools.py index 90de3c06..7ed188bb 100644 --- a/src/probeinterface/neuropixels_tools.py +++ b/src/probeinterface/neuropixels_tools.py @@ -1004,15 +1004,13 @@ def read_openephys( for stream_field in stream_fields: stream = stream_field.attrib["name"] # exclude ADC streams - if "ADC" not in stream: - streams.append(stream) - # find probe name (exclude AP-LFP from stream name) - if "AP" in stream or "LFP" in stream: - probe_name_ = stream.split("-")[0] - else: - probe_name_ = stream - if probe_name_ not in probe_names_used: - probe_names_used.append(probe_name_) + if "ADC" in stream: + continue + streams.append(stream) + # find probe name (exclude "-AP"/"-LFP" from stream name) + stream = stream.replace("-AP", "").replace("-LFP", "") + if stream not in probe_names_used: + probe_names_used.append(stream) else: has_streams = False probe_names_used = None From daba8465c2c7d750b174ec6f99ed1825cdcfb44c Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 29 Apr 2025 11:12:51 +0200 Subject: [PATCH 3/3] Update QuadBase file and tests --- .../OE_Neuropix-PXI-QuadBase/settings.xml | 4074 ++++++----------- tests/test_io/test_openephys.py | 16 +- 2 files changed, 1398 insertions(+), 2692 deletions(-) mode change 100755 => 100644 tests/data/openephys/OE_Neuropix-PXI-QuadBase/settings.xml diff --git a/tests/data/openephys/OE_Neuropix-PXI-QuadBase/settings.xml b/tests/data/openephys/OE_Neuropix-PXI-QuadBase/settings.xml old mode 100755 new mode 100644 index c2c9996d..60a60c03 --- a/tests/data/openephys/OE_Neuropix-PXI-QuadBase/settings.xml +++ b/tests/data/openephys/OE_Neuropix-PXI-QuadBase/settings.xml @@ -2,2722 +2,1426 @@ - 0.6.6 - 8 - 31 Jan 2025 17:56:19 + 1.0.0-dev + 9 + 28 Apr 2025 9:35:53 Windows 10 - + - - - - - - - - - - - - - - - - - + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + - -
+ +
+ + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - + +