access point process parameters in template

Anything that doesn't fit elsewhere.
Post Reply
MBeining
Posts: 35
Joined: Thu Apr 03, 2014 8:18 am

access point process parameters in template

Post by MBeining » Sat May 21, 2016 8:18 am

Hi,
I use templates for my morphologies, but also for artificial cells such as NetStim, IntFire etc (is necessary that my Matlab2Neuron interface works properly)

Code: Select all

begintemplate cell_NetStim

public cell
public is_artificial
objref cell
proc celldef() {
cell = new NetStim()
is_artificial = 1}
proc init() {
  celldef()
}

endtemplate cell_NetStim
However when I initialize such a NetStim for example, I cannot access the parameters (number, start, noise etc) from outside the template. Since the code should be open also to new, self-made artificial cells, I cannot write all the classes explicitly. So my question, is there a way to make every class public in a template? Or to receive all RANGE/PUBLIC variables from an artificial cell within NEURON so that I can make them public afterwards?

Thank you very much!

ted
Site Admin
Posts: 5590
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: access point process parameters in template

Post by ted » Sun May 22, 2016 10:20 pm

I cannot access the parameters (number, start, noise etc) from outside the template.
Assuming that objref foo points to an instance of the class defined by the template, then foo.cell is the name of the NetStim, and the hoc names of that NetStim's parameters are
foo.cell.interval, foo.cell.number, etc..

I don't see how this serves a useful purpose. All you're doing is interposing an extra layer between the NetStim's parameters and the top level of the hoc interpreter. Why is it more convenient to do this

objref foo
foo = new cell_NetStim()
foo.cell.start = whatever

than to just do this

objref foo
foo = new NetStim()
foo.start = whatever

??
What you're getting for your effort is the necessity of having to type an additional 6 characters (.start) every time you want to access the NetStim's parameters, or the NetStim itself.

MBeining
Posts: 35
Joined: Thu Apr 03, 2014 8:18 am

Re: access point process parameters in template

Post by MBeining » Mon May 23, 2016 12:29 am

Oh, yes I forgot that additional ".cell.number" ... -_- Thank you!
Normally I do not have to type NEURON code since the Matlab interface is doing that for me, but of course you're right, maybe I'll change it for the official version.

Post Reply