These are some useful functions used in CSD methods, They include CSD source profiles to be used as ground truths, placement of electrodes in 1D, 2D and 3D., etc These scripts are based on Grzegorz Parka’s, Google Summer of Code 2014, INFC/pykCSD This was written by : Michal Czerwinski, Chaitanya Chintaluri Laboratory of Neuroinformatics, Nencki Institute of Experimental Biology, Warsaw.
elephant.current_source_density_src.utility_functions.
check_for_duplicated_electrodes
(elec_pos)[source]¶Checks for duplicate electrodes Parameters ———- elec_pos : np.array Returns ——- has_duplicated_elec : Boolean
elephant.current_source_density_src.utility_functions.
distribute_srcs_1D
(X, n_src, ext_x, R_init)[source]¶Distribute sources in 1D equally spaced Parameters ———- X : np.arrays
points at which CSD will be estimated
elephant.current_source_density_src.utility_functions.
distribute_srcs_2D
(X, Y, n_src, ext_x, ext_y, R_init)[source]¶Distribute n_src’s in the given area evenly Parameters ———- X, Y : np.arrays
points at which CSD will be estimated
elephant.current_source_density_src.utility_functions.
distribute_srcs_3D
(X, Y, Z, n_src, ext_x, ext_y, ext_z, R_init)[source]¶Distribute n_src sources evenly in a rectangle of size Lx * Ly * Lz Parameters ———- X, Y, Z : np.arrays
points at which CSD will be estimated
Returns: | X_src, Y_src, Z_src : np.arrays
nx, ny, nz : ints
R : float
|
---|
elephant.current_source_density_src.utility_functions.
gauss_1d_dipole
(x)[source]¶1D Gaussian dipole source is placed between 0 and 1 to be used to test the CSD
Parameters: | x : np.array
|
---|---|
Returns: | f : np.array
|
elephant.current_source_density_src.utility_functions.
gauss_3d_dipole
(x, y, z)[source]¶3D Gaussian dipole profile - to be used to test csd. Parameters ———- x : np.array
Spatial x pts. at which the true csd is evaluated
elephant.current_source_density_src.utility_functions.
generate_electrodes
(dim, xlims=[0.1, 0.9], ylims=[0.1, 0.9], zlims=[0.1, 0.9], res=5)[source]¶Generates electrodes, helpful for FWD funtion. Parameters ———- dim : int
Dimensionality of the electrodes, 1,2 or 3
ele_x, ele_y, ele_z : flattened np.array of the electrode pos
elephant.current_source_density_src.utility_functions.
get_src_params_2D
(Lx, Ly, n_src)[source]¶Distribute n_src sources evenly in a rectangle of size Lx * Ly Parameters ———- Lx, Ly : floats
lengths in the directions x, y of the area, the sources should be placed
Returns: | nx, ny : ints
Lx_n, Ly_n : floats
ds : float
|
---|
elephant.current_source_density_src.utility_functions.
get_src_params_3D
(Lx, Ly, Lz, n_src)[source]¶Helps to evenly distribute n_src sources in a cuboid of size Lx * Ly * Lz Parameters ———- Lx, Ly, Lz : floats
lengths in the directions x, y, z of the area, the sources should be placed
elephant.current_source_density_src.utility_functions.
large_source_2D
(x, y)[source]¶2D Gaussian large source profile - to use to test csd Parameters ———- x : np.array
Spatial x pts. at which the true csd is evaluated
elephant.current_source_density_src.utility_functions.
patch_quantities
()[source]¶patch quantities with the SI unit Siemens if it does not exist
elephant.current_source_density_src.utility_functions.
small_source_2D
(x, y)[source]¶2D Gaussian small source profile - to be used to test csd Parameters ———- x : np.array
Spatial x pts. at which the true csd is evaluated