コード例 #1
0
def generate_CN_probe(probe_info, probeIdx):
    """
    Generate a mono shank CN probe
    """
    if probe_info['part'] == 'Fb' or probe_info['part'] == 'F':
        probe = generate_multi_columns_probe(
            num_columns=probe_info['electrode_cols_n'],
            num_contact_per_column=[
                int(x) for x in convert_probe_shape(
                    probe_info['electrode_rows_n'])[probeIdx]
            ],
            xpitch=float(probe_info['electrodeSpacingWidth_um']),
            ypitch=probe_info['electrodeSpacingHeight_um'],
            y_shift_per_column=convert_probe_shape(
                probe_info['electrode_yShiftCol'])[probeIdx],
            contact_shapes=probe_info['ElectrodeShape'],
            contact_shape_params={
                'width': probe_info['electrodeWidth_um'],
                'height': probe_info['electrodeHeight_um']
            })
        probe.set_planar_contour(convert_probe_shape(probe_info['probeShape']))

    else:
        probe = generate_multi_columns_probe(
            num_columns=probe_info['electrode_cols_n'],
            num_contact_per_column=int(probe_info['electrode_rows_n']),
            xpitch=float(probe_info['electrodeSpacingWidth_um']),
            ypitch=probe_info['electrodeSpacingHeight_um'],
            y_shift_per_column=convert_contact_shape(
                probe_info['electrode_yShiftCol']),
            contact_shapes=probe_info['ElectrodeShape'],
            contact_shape_params={
                'width': probe_info['electrodeWidth_um'],
                'height': probe_info['electrodeHeight_um']
            })
        probe.set_planar_contour(convert_probe_shape(probe_info['probeShape']))

    if type(probe_info['electrodesCustomPosition']) == str:
        probe._contact_positions = np.array(
            convert_probe_shape(probe_info['electrodesCustomPosition']))

    return probe
コード例 #2
0
def test_generate():
    probe = generate_dummy_probe()
    probegroup = generate_dummy_probe_group()
    
    tetrode = generate_tetrode()
    
    multi_columns = generate_multi_columns_probe(num_columns=3,
                num_elec_per_column=[10, 12, 10],
                xpitch=22, ypitch=20,
                y_shift_per_column=[0, -10, 0])
    
    linear = generate_linear_probe(num_elec=16,  ypitch=20,
                    electrode_shapes='square', electrode_shape_params={'width': 15})
    
    multi_shank = generate_multi_shank()
コード例 #3
0
# 

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:
# 

from probeinterface import generate_multi_columns_probe

multi_columns = generate_multi_columns_probe(num_columns=3,
                                             num_contact_per_column=[10, 12, 10],
                                             xpitch=22, ypitch=20,
                                             y_shift_per_column=[0, -10, 0],
                                             contact_shapes='square', contact_shape_params={'width': 12})
plot_probe(multi_columns, with_channel_index=True, )

##############################################################################
# Generate a square probe:
# 

square_probe = generate_multi_columns_probe(num_columns=12,
                                            num_contact_per_column=12,
                                            xpitch=10, ypitch=10,
                                            contact_shapes='square', contact_shape_params={'width': 8})
square_probe.create_auto_shape('rect')
plot_probe(square_probe)
コード例 #4
0
##############################################################################
# Import

import numpy as np
import matplotlib.pyplot as plt

from probeinterface import Probe, ProbeGroup
from probeinterface.plotting import plot_probe, plot_probe_group
from probeinterface import generate_multi_columns_probe

##############################################################################
# Let's first generate a probe. By default, the wiring is not complicated:
# each column increments the electrode index from the bottom to the top of the probe:

probe = generate_multi_columns_probe(num_columns=3,
                                     num_elec_per_column=[5, 6, 5],
                                     xpitch=75, ypitch=75, y_shift_per_column=[0, -37.5, 0],
                                     electrode_shapes='circle', electrode_shape_params={'radius': 12})

plot_probe(probe, with_channel_index=True)

##############################################################################
# The Probe is not connected to any device yet:

print(probe.device_channel_indices)

##############################################################################
# Let's imagine we have a headstage with the following wiring: the first half
# of the channels have natural indices, but the order of other half is reversed:

channel_indices = np.arange(16)
channel_indices[8:16] = channel_indices[8:16][::-1]
コード例 #5
0
                   shapes=shapes,
                   shape_params=shape_params)
probe.create_auto_shape()

##############################################################################

plot_probe(probe)

##############################################################################
#  We can also use the `rotate_contacts` to make contact-wise rotations:

from probeinterface import generate_multi_columns_probe

probe = generate_multi_columns_probe(num_columns=3,
                                     num_contact_per_column=8,
                                     xpitch=20,
                                     ypitch=20,
                                     contact_shapes='square',
                                     contact_shape_params={'width': 12})
probe.rotate_contacts(45)
plot_probe(probe)

##############################################################################

probe = generate_multi_columns_probe(num_columns=5,
                                     num_contact_per_column=5,
                                     xpitch=20,
                                     ypitch=20,
                                     contact_shapes='square',
                                     contact_shape_params={'width': 12})
thetas = np.arange(25) * 360 / 25
probe.rotate_contacts(thetas)
コード例 #6
0
##############################################################################
# Import

import numpy as np
import matplotlib.pyplot as plt

from probeinterface import Probe, ProbeGroup
from probeinterface.plotting import plot_probe, plot_probe_group
from probeinterface import generate_multi_columns_probe, generate_linear_probe

##############################################################################
# Some examples in 2d

fig, ax = plt.subplots()

probe0 = generate_multi_columns_probe()
plot_probe(probe0, ax=ax)

# make some colors for each probe
probe1 = generate_linear_probe(num_elec=9)
probe1.rotate(theta=15)
probe1.move([200, 0])
plot_probe(probe1, ax=ax, electrode_colors=['red', 'cyan', 'yellow'] * 3)

# prepare yourself for carnival!
probe2 = generate_linear_probe()
probe2.rotate(theta=-35)
probe2.move([400, 0])
n = probe2.get_electrode_count()
rand_colors = np.random.rand(n, 3)
plot_probe(probe2,
コード例 #7
0
                     shapes=shapes,
                     shape_params=shape_params)
probe.create_auto_shape()

##############################################################################

plot_probe(probe)

##############################################################################
#  We can also use the `rotate_electrodes` to make electrode-wise rotations:

from probeinterface import generate_multi_columns_probe

probe = generate_multi_columns_probe(num_columns=3,
                                     num_elec_per_column=8,
                                     xpitch=20,
                                     ypitch=20,
                                     electrode_shapes='square',
                                     electrode_shape_params={'width': 12})
probe.rotate_electrodes(45)
plot_probe(probe)

##############################################################################

probe = generate_multi_columns_probe(num_columns=5,
                                     num_elec_per_column=5,
                                     xpitch=20,
                                     ypitch=20,
                                     electrode_shapes='square',
                                     electrode_shape_params={'width': 12})
thetas = np.arange(25) * 360 / 25
probe.rotate_electrodes(thetas)