From 24137059faabc96f9fee144bc256bc3a71615927 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Mon, 31 Jul 2023 11:37:37 +0200 Subject: [PATCH] Add shank_pitch to NP-2.4 in SpikeGLX --- src/probeinterface/io.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/probeinterface/io.py b/src/probeinterface/io.py index 78f283b..36bad82 100644 --- a/src/probeinterface/io.py +++ b/src/probeinterface/io.py @@ -976,15 +976,18 @@ def _read_imro_string(imro_str: str, imDatPrb_pn: Optional[str] = None) -> Probe stagger = np.mod(y_idx + 1, 2) * probe_description["stagger"] x_pos = x_idx * x_pitch + stagger y_pos = y_idx * y_pitch - positions = np.stack((x_pos, y_pos), axis=1) if imDatPrb_type == 24: shank_ids = np.array(contact_info["shank_id"]) + shank_pitch = probe_description["shank_pitch"] contact_ids = [f"s{shank_id}e{elec_id}" for shank_id, elec_id in zip(shank_ids, elec_ids)] + x_pos += np.array(shank_ids).astype(int) * shank_pitch else: shank_ids = None contact_ids = [f"e{elec_id}" for elec_id in elec_ids] + positions = np.stack((x_pos, y_pos), axis=1) + # construct Probe object probe = Probe(ndim=2, si_units="um") probe.set_contacts(