probeinterface paper figures
Figure for probeinterface paper¶
Here a notebook to reproduce figures for paper
ProbeInterface: a unified framework for probe handling in extracellular electrophysiology
In [2]:
from probeinterface import plotting, io, Probe, ProbeGroup, get_probe
from probeinterface.plotting import plot_probe_group
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [3]:
# create contact positions
positions = np.zeros((32, 2))
positions[:, 0] = [0] * 8 + [50] * 8 + [200] * 8 + [250] * 8
positions[:, 1] = list(range(0, 400, 50)) * 4
# create an empty probe object with coordinates in um
probe0 = Probe(ndim=2, si_units='um')
# set contacts
probe0.set_contacts(positions=positions, shapes='circle',shape_params={'radius': 10})
# create probe shape (optional)
polygon = [(-20, 480), (-20, -30), (20, -110), (70, -30), (70, 450),
(180, 450), (180, -30), (220, -110), (270, -30), (270, 480)]
probe0.set_planar_contour(polygon)
In [4]:
# duplicate the probe and move it horizontally
probe1 = probe0.copy()
# move probe by 600 um in x direction
probe1.move([600, 0])
# Create a probegroup
probegroup = ProbeGroup()
probegroup.add_probe(probe0)
probegroup.add_probe(probe1)
In [5]:
fig2, ax2 = plt.subplots(figsize=(10,7))
plot_probe_group(probegroup, ax=ax2)
In [6]:
fig2.savefig("fig2.pdf")
In [7]:
probe0 = get_probe('cambridgeneurotech', 'ASSY-156-P-1')
probe1 = get_probe('neuronexus', 'A1x32-Poly3-10mm-50-177')
probe1.move([1000, -100])
probegroup = ProbeGroup()
probegroup.add_probe(probe0)
probegroup.add_probe(probe1)
fig3, ax3 = plt.subplots(figsize=(10,7))
plot_probe_group(probegroup, ax=ax3)
In [8]:
fig3.savefig("fig3.pdf")
In [9]:
manufacturer = 'cambridgeneurotech'
probe_name = 'ASSY-156-P-1'
probe = get_probe(manufacturer, probe_name)
print(probe)
In [10]:
probe.wiring_to_device('ASSY-156>RHD2164')
fig4, ax4 = plt.subplots(figsize=(12,7))
plotting.plot_probe(probe, with_device_index=True, with_contact_id=True, title=False, ax=ax4)
ax4.set_xlim(-100, 400)
ax4.set_ylim(-150, 100)
Out[10]:
In [11]:
fig4.savefig("fig4.pdf")
In [12]:
probe.device_channel_indices
Out[12]:
In [13]:
probe.to_dataframe(complete=True)
Out[13]: