示例#1
0
pulse_start = 240
pulse_duration = 160
print("pulse duration: {0} ms".format(pulse_duration * cell.dt))

pulse = np.zeros(n_tsteps)
pulse[pulse_start:(pulse_start + pulse_duration)] = 1.

# TO DETERMINE OR NOT, maybe just start from zmin = - max cortical thickness
cortical_surface_height = 50

# Parameters for the external field
sigma = 0.3

amp = 60  # * 10**3  # nA

polarity, n_elec, positions = utils.create_array_shape('line', 15)
source_xs = positions[0]
source_ys = positions[1]
source_zs = positions[2]

source_zs = np.ones(len(source_xs)) * cortical_surface_height

# utils.clamp_ends(cell, pulse_start, pulse_start + pulse_duration, voltage=-76., axis='z')
# utils.clamp_ends(cell, 0, pulse_start + pulse_duration, voltage=-76., axis='z')
source_amps = np.multiply(polarity, amp)

v_cell_ext = np.zeros((cell.totnsegs, n_tsteps))

if half_linear:
    v_cell_ext[:, :] = utils.half_linear_field(
        cell, pulse_start, pulse_start + pulse_duration, n_tsteps,
# source_xs = np.array([-50, 0, 50, 0, 0])
# source_ys = np.array([0, 50, 0, -50, 0])

# source_geometry = np.array([0, 0, 1, 1, 1, 1, 0, 0])
# stim_amp = 1.
# n_stim_amp = -stim_amp / 4
# source_geometry = np.array([0, 0, 0, 0, stim_amp])
# source_geometry = np.array([-stim_amp / 4, -stim_amp / 4, -stim_amp / 4, -stim_amp / 4, stim_amp])
# source_geometry = np.array([stim_amp, stim_amp, stim_amp, stim_amp, -stim_amp])

# source_geometry = np.array([-1, -1, 1, 1, 1, 1, -1, -1])

distance = 50
c_vext = 0.

polarity, n_elec, positions = utils.create_array_shape('monopole', 25)
source_xs = positions[0]
source_ys = positions[1]
source_zs = positions[2]

# Stimulation Parameters:

amp = 100 * (10**3)
num = 0

# source_zs = np.ones(len(source_xs)) * distance
source_amps = np.multiply(polarity, amp)
ExtPot = utils.ImposedPotentialField(source_amps, source_xs, source_ys,
                                     source_zs, sigma)

# Find external potential field at all cell positions as a function of time
    print("pulse duration: {0} ms ; pulse amplitude: {1} - {2} uA".format(
        pulse_duration * dt, np.min(amp_spread), np.max(amp_spread)))

pulse = np.zeros(n_tsteps)
pulse[pulse_start:(pulse_start + pulse_duration)] = 1.

# create the electric pulse wave form
# pulse = utils.form_pulse(pulse_start, pulse_duration, phase_length, dt, tstop)

# TO DETERMINE OR NOT, maybe just start from zmin = - max cortical thickness
cortical_surface_height = 50

# Parameters for the external field
sigma = 0.3
name_shape_ecog = params.sim['ecog_type']
polarity, n_elec, positions = utils.create_array_shape(name_shape_ecog, 25)
dura_height = 50
displacement_source = 0

current = np.zeros((SIZE, n_intervals))
c_vext = np.zeros((SIZE, n_intervals))
ap_loc = np.zeros((SIZE, n_intervals), dtype=np.int)
max_vmem = np.zeros((SIZE, n_intervals))
vext_soma = np.zeros((SIZE, n_intervals))
t_max_vmem = np.zeros((SIZE, n_intervals))

source_xs = positions[0]
source_ys = positions[1] + displacement_source
# source_ys = positions[1]
source_zs = positions[2] + dura_height
示例#4
0
# source_xs = np.array([-50, 0, 50, 0, 0])
# source_ys = np.array([0, 50, 0, -50, 0])

# source_geometry = np.array([0, 0, 1, 1, 1, 1, 0, 0])
# stim_amp = 1.
# n_stim_amp = -stim_amp / 4
# source_geometry = np.array([0, 0, 0, 0, stim_amp])
# source_geometry = np.array([-stim_amp / 4, -stim_amp / 4, -stim_amp / 4, -stim_amp / 4, stim_amp])
# source_geometry = np.array([stim_amp, stim_amp, stim_amp, stim_amp, -stim_amp])

# source_geometry = np.array([-1, -1, 1, 1, 1, 1, -1, -1])

distance = 50
c_vext = 0.

polarity, n_elec, positions = utils.create_array_shape('multipole3', 25)
source_xs = positions[0]
source_ys = positions[1]
source_zs = positions[2]

# Stimulation Parameters:

amp = 200 * (10**3)  # uA
num = 0

source_zs = np.ones(len(source_xs)) * distance
source_amps = np.multiply(polarity, amp)
ExtPot = utils.ImposedPotentialField(source_amps, source_xs, source_ys, source_zs, sigma)

# Find external potential field at all cell positions as a function of time
v_cell_ext = np.zeros((cell.totnsegs, n_tsteps))