Multi shank probes

This example shows how to deal with multi-shank probes.

In probeinterface this can be done with a Probe object, but internally each probe handles a shank_ids vector to carry information about which contacts belong to which shanks.

Optionally, a Probe object can be rendered split into Shank.

Import

import numpy as np
import matplotlib.pyplot as plt

from probeinterface import Probe, ProbeGroup
from probeinterface import generate_linear_probe, generate_multi_shank
from probeinterface import combine_probes
from probeinterface.plotting import plot_probe

Let’s use a generator to create a multi-shank probe:

multi_shank = generate_multi_shank(num_shank=3, num_columns=2, num_contact_per_column=6)
plot_probe(multi_shank)
Probe - 36ch - 3shanks
(<matplotlib.collections.PolyCollection object at 0x7f6b982d9e10>, <matplotlib.collections.PolyCollection object at 0x7f6b98237d90>)

multi_shank is one probe object, but internally the Probe.shank_ids vector handles the shank ids.

print(multi_shank.shank_ids)
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '1' '1' '1' '1' '1'
 '1' '1' '1' '1' '1' '1' '2' '2' '2' '2' '2' '2' '2' '2' '2' '2' '2' '2']

The dataframe displays the shank_ids column:

df = multi_shank.to_dataframe()
df
x y contact_shapes radius shank_ids contact_ids
0 0.0 0.0 circle 6.0 0
1 0.0 20.0 circle 6.0 0
2 0.0 40.0 circle 6.0 0
3 0.0 60.0 circle 6.0 0
4 0.0 80.0 circle 6.0 0
5 0.0 100.0 circle 6.0 0
6 20.0 0.0 circle 6.0 0
7 20.0 20.0 circle 6.0 0
8 20.0 40.0 circle 6.0 0
9 20.0 60.0 circle 6.0 0
10 20.0 80.0 circle 6.0 0
11 20.0 100.0 circle 6.0 0
12 150.0 0.0 circle 6.0 1
13 150.0 20.0 circle 6.0 1
14 150.0 40.0 circle 6.0 1
15 150.0 60.0 circle 6.0 1
16 150.0 80.0 circle 6.0 1
17 150.0 100.0 circle 6.0 1
18 170.0 0.0 circle 6.0 1
19 170.0 20.0 circle 6.0 1
20 170.0 40.0 circle 6.0 1
21 170.0 60.0 circle 6.0 1
22 170.0 80.0 circle 6.0 1
23 170.0 100.0 circle 6.0 1
24 300.0 0.0 circle 6.0 2
25 300.0 20.0 circle 6.0 2
26 300.0 40.0 circle 6.0 2
27 300.0 60.0 circle 6.0 2
28 300.0 80.0 circle 6.0 2
29 300.0 100.0 circle 6.0 2
30 320.0 0.0 circle 6.0 2
31 320.0 20.0 circle 6.0 2
32 320.0 40.0 circle 6.0 2
33 320.0 60.0 circle 6.0 2
34 320.0 80.0 circle 6.0 2
35 320.0 100.0 circle 6.0 2


We can iterate over a multi-shank probe and get Shank objects. A Shank is linked to a Probe object and can also retrieve positions, contact shapes, etc.:

for i, shank in enumerate(multi_shank.get_shanks()):
    print('shank', i)
    print(shank.__class__)
    print(shank.get_contact_count())
    print(shank.contact_positions.shape)
shank 0
<class 'probeinterface.shank.Shank'>
12
(12, 2)
shank 1
<class 'probeinterface.shank.Shank'>
12
(12, 2)
shank 2
<class 'probeinterface.shank.Shank'>
12
(12, 2)

Another option to create multi-shank probes is to create several Shank objects as separate probes and then combine them into a single Probe object

# generate a 2 shanks linear
probe0 = generate_linear_probe(num_elec=16, ypitch=20,
                               contact_shapes='square',
                               contact_shape_params={'width': 12})
probe1 = probe0.copy()
probe1.move([100, 0])

multi_shank = combine_probes([probe0, probe1])
print(multi_shank.shank_ids)
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '1'
 '1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '1']
plot_probe(multi_shank)

plt.show()
Probe - 32ch - 2shanks

Total running time of the script: (0 minutes 0.245 seconds)

Gallery generated by Sphinx-Gallery