Skip to content

Commit 606d57e

Browse files
authored
Merge pull request #413 from alejoe91/quad-base-fix2
Fix quad-base with custom names
2 parents c19bc18 + 57eee43 commit 606d57e

File tree

6 files changed

+5399
-1699
lines changed

6 files changed

+5399
-1699
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ dev_*
2525
cov.xml
2626
.DS_Store
2727

28-
29-
neuropixel_library_generated/*
3028
uv.lock
29+
30+
# libraries
31+
**/neuropixels_library_generated
32+
**/cambridgeneurotech_library

resources/generate_cambridgeneurotech_library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
help="Path to the folder containing the CambridgeNeurotech probe tables CSV files from https://github.com/cambridge-neurotech/probe_maps",
3333
)
3434
parser.add_argument(
35-
"--output-folder", type=str, default="./cambridgeneurotech", help="Output folder to save the generated probes"
35+
"--output-folder", type=str, default="./cambridgeneurotech_library", help="Output folder to save the generated probes"
3636
)
3737

3838

src/probeinterface/neuropixels_tools.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,18 @@ def _parse_openephys_settings(
12651265
else:
12661266
name = probe_names_used[probe_idx]
12671267

1268+
# For Quad Base probes, the stream name is the same for all 4 shanks,
1269+
# so we append the shank id to match the stream name (if not already present)
1270+
# and ensure consistency with stream names.
1271+
shank = np_probe.attrib.get("shank")
1272+
if shank is not None:
1273+
shank_str = f"-{int(shank) + 1}"
1274+
if shank_str not in name:
1275+
name = f"{name}{shank_str}"
1276+
# update the name in the probe_name_used so that the correct probe name
1277+
# shows up in the list of available probe names
1278+
probe_names_used[probe_idx] = name
1279+
12681280
info = {
12691281
"probe_part_number": probe_part_number,
12701282
"serial_number": probe_serial_number,

tests/data/openephys/OE_Neuropix-PXI-QuadBase/settings_custom_names.xml

Lines changed: 3486 additions & 1691 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)