{"action":"created","issue":{"url":"https://api.github.com/repos/LFPy/LFPy/issues/106","repository_url":"https://api.github.com/repos/LFPy/LFPy","labels_url":"https://api.github.com/repos/LFPy/LFPy/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/LFPy/LFPy/issues/106/comments","events_url":"https://api.github.com/repos/LFPy/LFPy/issues/106/events","html_url":"https://github.com/LFPy/LFPy/issues/106","id":362885014,"node_id":"MDU6SXNzdWUzNjI4ODUwMTQ=","number":106,"title":"Computing LFPs for existing, pre-built network models","user":{"login":"JustasB","id":10732358,"node_id":"MDQ6VXNlcjEwNzMyMzU4","avatar_url":"https://avatars1.githubusercontent.com/u/10732358?v=4","gravatar_id":"","url":"https://api.github.com/users/JustasB","html_url":"https://github.com/JustasB","followers_url":"https://api.github.com/users/JustasB/followers","following_url":"https://api.github.com/users/JustasB/following{/other_user}","gists_url":"https://api.github.com/users/JustasB/gists{/gist_id}","starred_url":"https://api.github.com/users/JustasB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustasB/subscriptions","organizations_url":"https://api.github.com/users/JustasB/orgs","repos_url":"https://api.github.com/users/JustasB/repos","events_url":"https://api.github.com/users/JustasB/events{/privacy}","received_events_url":"https://api.github.com/users/JustasB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-22T19:42:16Z","updated_at":"2018-09-23T11:01:57Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI have a case where I have several pre-built network models (NEURON+Python) and would like to compare the LFPs generated by them. \r\n\r\nI looked through the LFPy examples, and as far as I can see, each example shows building the cells+synapses+inputs and simulation parameters from within the LFPy framework. \r\n\r\nIn my case, each model has its own cells, synapses, input, and simulation parameters. I would like to insert a \"virtual LFP electrode\" and compute the LFP during various points of these pre-existing simulations, ideally without disturbing the simulations. Recreating each model in LFPy format would be unfeasible (I would also likelly introduce various inadvertent errors).\r\n\r\nI looked over the docs, and the following approach looked promising:\r\n\r\n- Before the start of the simulation, create a set of LFPy.Cell() instances, passing in h.SectionList()s of each cell sections.\r\n- Let the simulation h.run() until some pre-determined time\r\n- Then use LFPy.lfpcalc.calc_lfp_soma_as_point() method to compute the LFP(s) of each cell at that time point\r\n\r\nBut this just returned constant values for each cell across different time points.\r\n\r\n**Given a set of pre-existing Sections and an electrode at some location, is there a way to get the LFP at that electrode?**\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/LFPy/LFPy/issues/comments/423808277","html_url":"https://github.com/LFPy/LFPy/issues/106#issuecomment-423808277","issue_url":"https://api.github.com/repos/LFPy/LFPy/issues/106","id":423808277,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzgwODI3Nw==","user":{"login":"espenhgn","id":2492641,"node_id":"MDQ6VXNlcjI0OTI2NDE=","avatar_url":"https://avatars2.githubusercontent.com/u/2492641?v=4","gravatar_id":"","url":"https://api.github.com/users/espenhgn","html_url":"https://github.com/espenhgn","followers_url":"https://api.github.com/users/espenhgn/followers","following_url":"https://api.github.com/users/espenhgn/following{/other_user}","gists_url":"https://api.github.com/users/espenhgn/gists{/gist_id}","starred_url":"https://api.github.com/users/espenhgn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/espenhgn/subscriptions","organizations_url":"https://api.github.com/users/espenhgn/orgs","repos_url":"https://api.github.com/users/espenhgn/repos","events_url":"https://api.github.com/users/espenhgn/events{/privacy}","received_events_url":"https://api.github.com/users/espenhgn/received_events","type":"User","site_admin":false},"created_at":"2018-09-23T11:01:57Z","updated_at":"2018-09-23T11:01:57Z","author_association":"COLLABORATOR","body":"Hi @JustasB \r\n\r\nThanks for your interest in LFPy! \r\nAs you've found, what you want is unfortunately not well supported at the moment. I reckon that a kind of hybrid solution could be doable, but this is not something I've done in practice. If you look at the definition and use of the DummyCell class defined in the file https://github.com/LFPy/LFPy/blob/master/LFPy/network.py, it is possible to define an object that resemble the LFPy.Cell class and has the necessary attributes to allow use with for example LFPy.RecExtElectrode. For a network instantiated in NEURON it should, I think, be doable to define a similar object that collects all segment references and corresponding transmembrane currents. The way we use this DummyCell is to create a linear mapping between transmembrane currents of each compartment to its contribution on each electrode contact. Hence we do not store currents for running networks as one can compute the LFP each time step as a dot product between this resulting mapping matrix and vector of currents. \r\n\r\nIn your networks, do you store the currents?\r\n\r\nIn either case, I think in the future we will aim to improve support for NeuroML2, including networks. It is however difficult to add support for arbitrary networks defined either using HOC or python/neuron. \r\n\r\nOne final option for you is of course to incorporate the electrostatic forward models natively in your model code. Point-sources should be very easy to incorporate if you mostly want to get a qualitative estimate of the LFP. "}}
{"actor":{"display_login":"espenhgn"}}