Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

NetStim Visualisation

41 views
Skip to first unread message

Reza

unread,
May 13, 2024, 8:07:31 AM5/13/24
to NetPyNE Q&A forum
Hello guys!

Regarding the following code in my .hoc file, I am wondering if there is a chance to plot the NetStim input current either in Graph in GUI or in python.

[
begintemplate SenInf_NetStim
public pp, connect2target, x, y, z, position, is_art
objref pp
proc init() {
  pp = new NetStim()
    pp.interval = 20
    pp.number = 2
    pp.start = 15
}
func is_art() { return 1 }
obfunc connect2target() { localobj nc
  nc = new NetCon(pp, $o1)
  if (numarg() == 2) { $o2 = nc }
  return nc
}
proc position(){x=$1  y=$2  z=$3}
endtemplate SenInf_NetStim
]


Can we also set the duration and amplitude of it?

Thank you. 
Reza

Eugenio Urdapilleta

unread,
May 16, 2024, 10:20:55 AM5/16/24
to NetPyNE Q&A forum
Hi Reza, 
 in NetPyNE you can access the spike times data coming from NetStims by setting cfg.recordStim = True in the configuration file. if you want to know exactly how to manage in the best way in NEURON/hoc, maybe you can ask in the NEURON forum (but probably you should create a vector and record from the corresponding netcon). Best,

Eugenio

Reza

unread,
May 16, 2024, 10:31:41 AM5/16/24
to NetPyNE Q&A forum
Hi Eugenio,
Thank you for your reply.

Do you know where exactly I need to use "cfg.recordStim = True"?
As I cannot modify the values or even add/remove code snippets of the .hoc file from Python, I want to know how exactly it works.

Could you also provide me with the NEURON forum address, please?

Thank you. 

Eugenio Urdapilleta

unread,
May 16, 2024, 1:21:27 PM5/16/24
to NetPyNE Q&A forum
Hi Reza,
 you can use  "cfg.recordStim = True" if you are building a NetPyNE model. If you are doing a model in hoc, this has no sense. From your hoc, I see that you plan to do your network by yourself, not using NetPyNE (for example, NetPyNE does't import netstims from hoc). You can find the NEURON forum at: https://www.neuron.yale.edu/phpbb/viewforum.php?f=32
The forum is a big source of inspiration, if you have some time to spend there, it's time you'll gain (for your project, but also to see future possibilities). Best,

Eugenio

Reza

unread,
May 17, 2024, 3:14:51 AM5/17/24
to NetPyNE Q&A forum
Thank you, Eugenio!

Reza

unread,
May 17, 2024, 10:01:40 AM5/17/24
to NetPyNE Q&A forum
Hello guys!

How can we show the input stimulation source?
As we have 
netParams.stimSourceParams[input_1]=... 
netParams.stimTargetParams['input_1->Pyr'] = ...

I tried 
simConfig.analysis['plotTraces'] = {'include': [1, 9, 'Input_1']}
import pylab; pylab.show()

but didn't work!

Thanks.
Reply all
Reply to author
Forward
0 new messages