from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt import sys import os from kcsd import sKCSD import kcsd.utility_functions as utils import kcsd.validation.plotting_functions as pl import sKCSD_utils n_src = 512 if __name__ == '__main__': fname_base = "Figure_8" fig_dir = 'Figures' fig_name = sKCSD_utils.make_fig_names(fname_base) tstop = 850 scale_factor = 1000**2 scale_factor_LFP = 1000 R_inits = np.array([(2**(i - .5)) / scale_factor for i in range(3, 9)]) lambdas = np.array([(10**(-i)) for i in range(5)]) colnb = 10 rownb = 10 fname = '%s_rows_%d' % (fname_base, rownb) dt = .5 if sys.version_info < (3, 0): c = sKCSD_utils.simulate(fname, morphology=6, tstop=tstop, seed=1988, weight=0.04, n_syn=1000,
ax = [] for i in range(2): for j in range(2, 5): ax.append(plt.subplot(gs[i, j])) cax = ax_gt.imshow(ground_truth, extent=[0, tstop, 1, 52], origin='lower', aspect='auto', cmap='seismic_r', vmax=gvmax, vmin=gvmin) ax_gt.set_title('Ground truth') ax_gt.set_xlabel('time (s)') ax_gt.set_ylabel('#segment') new_fname = fname_base + '.png' fig_name = sKCSD_utils.make_fig_names(new_fname) vmax, vmin = pl.get_min_max(ground_truth) for i, datd in enumerate(data_dir): data = utils.LoadData(datd) ele_pos = data.ele_pos/scaling_factor data.LFP = data.LFP/scaling_factor_LFP morphology = data.morphology morphology[:, 2:6] = morphology[:, 2:6]/scaling_factor k = sKCSD(ele_pos, data.LFP, morphology, n_src_init=n_src, src_type='gauss', lambd=lambd, R_init=R,
skcsd.sum(axis=(2, 3)), extent=extent, cmap='seismic_r', vmax=gvmax, vmin=gvmin, alpha=0.5) if __name__ == '__main__': fname_base = "Figure_complex" data_dir = simulate() fig, ax_somav, ax = make_figure() ground_truth, data, time, somav = read_in_data(data_dir) toplot = np.argmax(somav) gvmax, gvmin = pl.get_min_max(ground_truth[:, toplot]) new_fname = fname + '.png' fig_name = sKCSD_utils.make_fig_names(new_fname) cell_itself = make_larger_cell(data, n_src) morphology, extent = cell_itself.draw_cell2D() extent = [ex*1e6 for ex in extent] draw_somav(ax_somav, time, somav) k = sKCSD(data.ele_pos, data.LFP, data.morphology, n_src_init=n_src, src_type='gauss', lambd=lambd, exact=True, R_init=R, sigma=0.3) path = os.path.join(data_dir, 'lambda_%f_R_%f_n_src_%d' % (lambd, R, n_src)) if sys.version_info < (3, 0):
2:{'colnb':5, 'rownb': 5, 'xmin':-400, 'xmax':400, 'ymin':-400, 'ymax':400}, 3:{'colnb':5, 'rownb': 5, 'xmin':-800, 'xmax':800, 'ymin':-800, 'ymax':800}, 4:{'colnb':9, 'rownb': 9, 'xmin':-800, 'xmax':800, 'ymin':-800, 'ymax':800}, 5:{'colnb':9, 'rownb': 9, 'xmin':-400, 'xmax':400, 'ymin':-400, 'ymax':400}, 6:{'colnb':21, 'rownb': 21, 'xmin':-400, 'xmax':400, 'ymin':-400, 'ymax':400}, } titles = ['IED 50 um', 'IED 100 um', 'IED 200 um', 'IED 400 um', 'IED 200 um', 'IED 100 um', 'IED 40 um'] if __name__ == '__main__': fname_base = "Figure_10" fig_name = sKCSD_utils.make_fig_names(fname_base) tstop = 250 scale_factor = 1000**2 scale_factor_LFP = 1000 R = 64e-6/np.sqrt(2) l = .1 data_dir = [] for i in range(7): colnb = different_trials_parameters[i]['colnb'] rownb = different_trials_parameters[i]['rownb'] xmin = different_trials_parameters[i]['xmin'] xmax = different_trials_parameters[i]['xmax'] ymin = different_trials_parameters[i]['ymin'] ymax = different_trials_parameters[i]['ymax'] c = sKCSD_utils.simulate(fname_base,
import matplotlib.pyplot as plt import sys import os from kcsd import sKCSD, KCSD3D, sKCSDcell from kcsd import sKCSD_utils as utils import kcsd.validation.plotting_functions as pl import sKCSD_utils n_src = 512 R = 16e-6/2**.5 lambd = .1/((2*(2*np.pi)**3*R**2*n_src)) dt = 0.5 n = 100 # dist_table_density for kCSD if __name__ == '__main__': fname_base = "Figure_5" fig_name = sKCSD_utils.make_fig_names("Figure_5.png") tstop = 70 scaling_factor = 1000**2 scaling_factor_LFP = 1000 rownb = [16, 4] data_dir = [] colnb = [4, 16] lfps = [] xmax = [100, 500] ymax = [500, 100] cell_itself = [] for i, electrode_orientation in enumerate([1, 2]): fname = fname_base c = sKCSD_utils.simulate(fname, morphology=2,
import matplotlib.pyplot as plt import sys import os from kcsd import sKCSD, KCSD3D, sKCSDcell import kcsd.utility_functions as utils import kcsd.validation.plotting_functions as pl import sKCSD_utils n_src = 512 R = 16e-6/2**.5 lambd = .1/((2*(2*np.pi)**3*R**2*n_src)) dt = 0.5 n = 100 # dist_table_density for kCSD if __name__ == '__main__': fname_base = "Figure_5" fig_name = sKCSD_utils.make_fig_names("Figure_5.png") tstop = 70 scaling_factor = 1000**2 scaling_factor_LFP = 1000 rownb = [16, 4] data_dir = [] colnb = [4, 16] lfps = [] xmax = [100, 500] ymax = [500, 100] cell_itself = [] morpho = [] extent = [] for i, electrode_orientation in enumerate([1, 2]): fname = fname_base