Skip to content

Commit

Permalink
Fix NP2 extended versions for SpikeGLX and OpenEphys
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Oct 30, 2023
1 parent f2c9d16 commit 80f2209
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/probeinterface/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,13 +1468,13 @@ def read_openephys(
break

stagger = np.mod(pos[1] / npx_probe[ptype]["y_pitch"] + 1, 2) * npx_probe[ptype]["stagger"]
shank_id = shank_ids[0] if ptype == 24 else 0
shank_id = shank_ids[i] if npx_probe[ptype]["shank_number"] > 1 else 0

contact_id = int(
(pos[0] - stagger - npx_probe[ptype]["shank_pitch"] * shank_id) / npx_probe[ptype]["x_pitch"]
+ npx_probe[ptype]["ncol"] * pos[1] / npx_probe[ptype]["y_pitch"]
)
if ptype == 24:
if npx_probe[ptype]["shank_number"] > 1:
contact_ids.append(f"s{shank_id}e{contact_id}")
else:
contact_ids.append(f"e{contact_id}")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io/test_openephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ def test_older_than_06_format():


if __name__ == "__main__":
test_multiple_probes()
# test_multiple_probes()
test_older_than_06_format()
4 changes: 2 additions & 2 deletions tests/test_io/test_spikeglx.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_NP2_2013_all():

assert probe.ndim == 2
# all channels are from the first shank
assert probe.get_shank_count() == 1
assert probe.get_shank_count() == 4
assert probe.get_contact_count() == 384

# Test contact geometry
Expand All @@ -121,7 +121,7 @@ def test_NP2_2013_subset():

assert probe.ndim == 2
# all channels are from the first shank
assert probe.get_shank_count() == 1
assert probe.get_shank_count() == 4
assert probe.get_contact_count() == 120

# Test contact geometry
Expand Down

0 comments on commit 80f2209

Please sign in to comment.