Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CSD plot for comparing against animal studies #68

Closed
jasmainak opened this issue May 13, 2019 · 7 comments · Fixed by #329 or #815
Closed

add CSD plot for comparing against animal studies #68

jasmainak opened this issue May 13, 2019 · 7 comments · Fixed by #329 or #815
Labels
enhancement New feature or request
Milestone

Comments

@jasmainak
Copy link
Collaborator

jasmainak commented May 13, 2019

Background

The ability to calculate LFP for simulated electrodes in the model (#150) allow for time vs. depth laminar CSD plots to be generated. Laminar CSD (electrodes arranged vertically) is the primary goal of this feature because laminar CSD is commonly used in animal studies where a laminar probe is inserted into the cortext to measure extracellular potentials. In the experimental animal studies, CSD is calculated from the bandpass filtered LFP data (low-frequency portion of extracellular potentials) to identify underlying neuronal activity at specific cortical layers. Such activity is identified as a "sink" (net influx of current into cell) or "source" (efflux into extracellular space) in the temporal-spatial domain.

Figure 5 from Sherman et al. 2016 shows laminar CSD plots of an anesthetized mouse and an awake monkey.

Screen Shot 2020-09-08 at 8 41 05 AM

Sherman MA, Lee S, Law R, et al. Neural mechanisms of transient neocortical beta rhythms: Converging evidence from humans, computational modeling, monkeys, and mice. Proc Natl Acad Sci U S A. 2016;113(33):E4885-E4894. doi:10.1073/pnas.1604135113

CSD can be calculated via

numpy.diff(LFP_data,n=2,axis=ax)/spacing_mm**2

The sign may be adjusted to make a current sinks negative and sources positive.

Goal

Create laminar CSD plots from simulated data that are comparable to Figure 5 in Sherman et al. 2016

Requirements

  1. Averaging LFP over multiple trials is typically done before computing CSD

  2. CSD plots are created using a 2D spline over values at each electrode depth. Support various spline functions.

  3. Users need to be able to easily adjust the X,Y scales to match simulated data with their experimental data

  4. The CSD of the first and last channels cannot be computed using the 2nd spatial derivative. The Vaknin method is used to derive approximate CSD signals at these points

    G. Vaknin, P.G. DiScenna, T.J. Teyler, A method for calculating current source density (CSD) analysis without resorting to recording sites outside the sampling volume, Journal of Neuroscience Methods, Volume 24, Issue 2, 1988, Pages 131-135, ISSN 0165-0270, https://doi.org/10.1016/0165-0270(88)90056-8.

  5. Implement iCSD method as an alternative to numpy.diff() above

@jasmainak jasmainak transferred this issue from jonescompneurolab/hnn-core Aug 26, 2019
@jasmainak jasmainak transferred this issue from another repository Aug 26, 2019
@jasmainak jasmainak transferred this issue from jonescompneurolab/hnn-core Aug 26, 2019
@jasmainak jasmainak transferred this issue from another repository Aug 26, 2019
@jasmainak jasmainak added the enhancement New feature or request label Jul 23, 2020
@jasmainak
Copy link
Collaborator Author

@blakecaldwell can you help me in this issue by adding more details what is needed? You can edit the issue description and perhaps add an image? Perhaps link to publication or an already existing implementation somewhere?

@jasmainak
Copy link
Collaborator Author

@cjayb I'm reopening this since CSD is not yet implemented

@jasmainak jasmainak modified the milestones: 0.2, 0.3 Aug 27, 2021
@jasmainak
Copy link
Collaborator Author

jasmainak commented Nov 24, 2021

API settled upon after discussion with @ntolley and Ayo was the following:

csd = net.lfp_array[‘array1’][trial_idx].get_csd(method=laplacian’, interpolation=spline’)
net.lfp_array[‘array1’][trial_idx].plot(…, csd=csd)

@rythorpe
Copy link
Contributor

I just re-discovered this issue after finishing #517. Have we moved past this or should we make the above-mentioned features + API the next PR?

@jasmainak
Copy link
Collaborator Author

I think it would be good for users to have access to the CSD array somehow. I can imagine it being a common use-case and also makes it easier to write tests.

Also in terms of implementation, we should start using the "f-matrix" even for the basic implementation, as in here. That way, it will be easier to extend to the other methods.

@jasmainak jasmainak modified the milestones: 0.3, 0.4 Mar 20, 2023
@ntolley
Copy link
Contributor

ntolley commented Jun 13, 2024

Our conversation at dinner made me think of this.

We technically have a CSD plot in what of the examples (just not smoothed/interpolated). Should we consider this closed?

@jasmainak
Copy link
Collaborator Author

I'd like to have at least one of the interpolated versions so that it can be overlaid with LFP. It's not too hard to implement, just need a motivated student to complete it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants