Skip to content

Commit

Permalink
Add shank_pitch to NP-2.4 in SpikeGLX
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Jul 31, 2023
1 parent 3fb8864 commit 2413705
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/probeinterface/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2413705

Please sign in to comment.