Current source density analysis

‘Current Source Density analysis (CSD) is a class of methods of analysis of extracellular electric potentials recorded at multiple sites leading to estimates of current sources generating the measured potentials. It is usually applied to low-frequency part of the potential (called the Local Field Potential, LFP) and to simultaneous recordings or to recordings taken with fixed time reference to the onset of specific stimulus (Evoked Potentials)’ (Definition by Prof.Daniel K. Wójcik for Encyclopedia of Computational Neuroscience)

CSD is also called as Source Localization or Source Imaging in the EEG circles. Here are CSD methods for different types of electrode configurations.

1D - laminar probe like electrodes. 2D - Microelectrode Array like 3D - UtahArray or multiple laminar probes.

The following methods have been implemented so far

1D - StandardCSD, DeltaiCSD, SplineiCSD, StepiCSD, KCSD1D 2D - KCSD2D, MoIKCSD (Saline layer on top of slice) 3D - KCSD3D

Each of these methods listed have some advantages. The KCSD methods for instance can handle broken or irregular electrode configurations electrode

Keywords: LFP; CSD; Multielectrode; Laminar electrode; Barrel cortex

Citation Policy: See ./current_source_density_src/README.md

Contributors to this current source density estimation module are: Chaitanya Chintaluri(CC), Espen Hagen(EH) and Michał Czerwinski(MC). EH implemented the iCSD methods and StandardCSD CC implemented the kCSD methods, kCSD1D(MC and CC) CC and EH developed the interface to elephant.

elephant.current_source_density.estimate_csd(lfp, coordinates=None, method=None, process_estimate=True, **kwargs)[source]

Function call to compute the current source density (CSD) from extracellular potential recordings(local-field potentials - LFP) using laminar electrodes or multi-contact electrodes with 2D or 3D geometries.

Parameters:
lfpneo.AnalogSignal

positions of electrodes can be added as neo.RecordingChannel coordinate or sent externally as a func argument (See coords)

coordinates[Optional] corresponding spatial coordinates of the

electrodes. Defaults to None Otherwise looks for ChannelIndex coordinate

methodstring

Pick a method corresponding to the setup, in this implementation For Laminar probe style (1D), use ‘KCSD1D’ or ‘StandardCSD’,

or ‘DeltaiCSD’ or ‘StepiCSD’ or ‘SplineiCSD’

For MEA probe style (2D), use ‘KCSD2D’, or ‘MoIKCSD’ For array of laminar probes (3D), use ‘KCSD3D’ Defaults to None

process_estimatebool

In the py_iCSD_toolbox this corresponds to the filter_csd - the parameters are passed as kwargs here ie., f_type and f_order In the kcsd methods this corresponds to cross_validate - the parameters are passed as kwargs here ie., lambdas and Rs Defaults to True

kwargsparameters to each method

The parameters corresponding to the method chosen See the documentation of the individual method Default is {} - picks the best parameters,

Returns:
Estimated CSD

neo.AnalogSignal object annotated with the spatial coordinates

Raises:
AttributeError

No units specified for electrode spatial coordinates

ValueError

Invalid function arguments, wrong method name, or mismatching coordinates

TypeError

Invalid cv_param argument passed

elephant.current_source_density.generate_lfp(csd_profile, x_positions, y_positions=None, z_positions=None, x_limits=[0.0, 1.0], y_limits=[0.0, 1.0], z_limits=[0.0, 1.0], resolution=50)[source]

Forward modelling for getting the potentials for testing Current Source Density (CSD).

Parameters:
csd_profilecallable

A function that computes true CSD profile. Available options are (see ./csd/utility_functions.py) 1D : gauss_1d_dipole 2D : large_source_2D and small_source_2D 3D : gauss_3d_dipole

x_positionsnp.ndarray

Positions of the x coordinates of the electrodes

y_positionsnp.ndarray, optional

Positions of the y coordinates of the electrodes Defaults to None, use in 2D or 3D cases only

z_positionsnp.ndarray, optional

Positions of the z coordinates of the electrodes Defaults to None, use in 3D case only

x_limitslist, optional

A list of [start, end]. The starting spatial coordinate and the ending for integration Defaults to [0.,1.]

y_limitslist, optional

A list of [start, end]. The starting spatial coordinate and the ending for integration Defaults to [0.,1.], use only in 2D and 3D case

z_limitslist, optional

A list of [start, end]. The starting spatial coordinate and the ending for integration Defaults to [0.,1.], use only in 3D case

resolutionint, optional

The resolution of the integration Defaults to 50

Returns:
LFPneo.AnalogSignal

The potentials created by the csd profile at the electrode positions. The electrode positions are attached as RecordingChannel’s coordinate.