hello,
I tried to write a recursive program, which visits all sections and gives me for every
segment in every section :
- a list with references for all (to actual section) attached pointprocesses ( like IClamp,and
others that are not reachable with >netconlist()<)
- and for every pointprocess the relative location between 0-1 in section, where it was
attached.
Unfortunately, I can't figure out a Neuron method, (similar to netconlist() / ismembrane()
for netcon events/density mechanisms) which picks out all point processes from a section,
returns their references or their relative position in section.
I would be glad for a hint
peter
figure out point processes in a section/segment
From a section centric perspective it is easy
to do that in c but not so easy in hoc. So you
are probably better off taking a point process
centric perspective, finding the positions of each
type of point process and then collecting the
ones that are in a particular section. This is the
way it is done in the ModelView implementation.
The key idioms are the following.
1) all the point process of type IClamp are
objref list
list = new List("IClamp")
2) one can know all the point process types
by creating a MechanismType object.
3) One can create a corresponding list of
sections and vector of positions to the IClamp
list above with the idiom
4) collect the point processes in a particular
section by
of course if you want not just a single section
but all of them then if the double loop ineficiency
is noticable, then create a temporary section
to integer map using an analogy to the idiom in
nrn/share/lib/hoc/mview/mview1 in the
proc assoc_cell_number()
Note. I did not execute the above code
fragments so there may be typos but the ideas
are sound.
to do that in c but not so easy in hoc. So you
are probably better off taking a point process
centric perspective, finding the positions of each
type of point process and then collecting the
ones that are in a particular section. This is the
way it is done in the ModelView implementation.
The key idioms are the following.
1) all the point process of type IClamp are
objref list
list = new List("IClamp")
2) one can know all the point process types
by creating a MechanismType object.
3) One can create a corresponding list of
sections and vector of positions to the IClamp
list above with the idiom
Code: Select all
objref slist, xvec
slist = new List()
xvec = new Vector
for i=0, list.count-1 {
x = list.object(i).getloc()
xvec.append(x)
slist.append(new SectionRef())
pop_section()
}
section by
Code: Select all
desired_section_name {
for i=0, list.count-1 {
if (slist.object(i).iscas()) {
print secname(), xvec.x[i], list.object(i)
}
}
}
but all of them then if the double loop ineficiency
is noticable, then create a temporary section
to integer map using an analogy to the idiom in
nrn/share/lib/hoc/mview/mview1 in the
proc assoc_cell_number()
Note. I did not execute the above code
fragments so there may be typos but the ideas
are sound.