def test_probegroup(): probegroup = ProbeGroup() for i in range(3): probe = generate_dummy_probe() probe.move([i * 100, i * 80]) probegroup.add_probe(probe) indices = probegroup.get_global_device_channel_indices() ids = probegroup.get_global_electrode_ids() df = probegroup.to_dataframe()
def test_probegroup(): probegroup = ProbeGroup() nchan = 0 for i in range(3): probe = generate_dummy_probe() probe.move([i * 100, i * 80]) n = probe.get_contact_count() probe.set_device_channel_indices(np.arange(n)[::-1] + nchan) shank_ids = np.ones(n) shank_ids[:n // 2] *= i * 2 shank_ids[n // 2:] *= i * 2 + 1 probe.set_shank_ids(shank_ids) probegroup.add_probe(probe) nchan += n indices = probegroup.get_global_device_channel_indices() ids = probegroup.get_global_contact_ids() df = probegroup.to_dataframe() #~ print(df['global_contact_ids']) arr = probegroup.to_numpy(complete=False) other = ProbeGroup.from_numpy(arr) arr = probegroup.to_numpy(complete=True) other = ProbeGroup.from_numpy(arr) d = probegroup.to_dict() other = ProbeGroup.from_dict(d) #~ from probeinterface.plotting import plot_probe_group, plot_probe #~ import matplotlib.pyplot as plt #~ plot_probe_group(probegroup) #~ plot_probe_group(other) #~ plt.show() # checking automatic generation of ids with new dummy probes probegroup.probes = [] for i in range(3): probegroup.add_probe(generate_dummy_probe()) probegroup.auto_generate_contact_ids() probegroup.auto_generate_probe_ids() for p in probegroup.probes: assert p.contact_ids is not None assert 'probe_id' in p.annotations
from probeinterface.plotting import plot_probe, plot_probe_group ############################################################################## # Generate 4 tetrodes: # from probeinterface import generate_tetrode probegroup = ProbeGroup() for i in range(4): tetrode = generate_tetrode() tetrode.move([i * 50, 0]) probegroup.add_probe(tetrode) probegroup.set_global_device_channel_indices(np.arange(16)) df = probegroup.to_dataframe() df plot_probe_group(probegroup, with_channel_index=True, same_axes=True) ############################################################################## # Generate a linear probe: # from probeinterface import generate_linear_probe linear_probe = generate_linear_probe(num_elec=16, ypitch=20) plot_probe(linear_probe, with_channel_index=True) ############################################################################## # Generate a multi-column probe: