I am trying to write a non-cellular object that operates on other cell objects, gathering information of the sections in the cell. The routines should operate on any generic cell. I simply want to call forall or forsec, but just on whatever cell object I am using. This works fine if the code that gathers the information on the cell is not an object itself (i.e., it is not a template). When the code that gathers the information is also an object, however, I cannot get it to work. Any ideas?
Thanks,
Tom
forsec on external object?
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: forsec on external object?
Are you dealing with cell classes that have properly defined "all" subsets? If so, your non-cell class object foo could contain a public proc bar like this
proc bar() {
forsec $o1.all { . . . }
}
and
foo.bar(somecellobjref)
would iterate over just somecellobjref's sections.
proc bar() {
forsec $o1.all { . . . }
}
and
foo.bar(somecellobjref)
would iterate over just somecellobjref's sections.
Re: forsec on external object?
This is a general method, and while I can define "all" in my own cells, I'd like to deal with other cell models that do not have "all" defined. Is there another way?
Thanks,
Tom
Thanks,
Tom
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: forsec on external object?
Beats me. First thing I'd do with any cell class that lacks an all set would be to . . . define an all set. Maybe Michael Hines has a different trick up his sleeve.
Re: forsec on external object?
If you can get any section of an object as the currently accessed section, then you can create a whole cell section list with
http://www.neuron.yale.edu/neuron/stati ... #wholetree
(Of course this won't work in the case an object holds more than one tree , e.g. after multisplit)
WIthout knowing anything about internal section names, sectionlists, or connectivity, the only way I can think of offhand to
create an "all" sectionlist is to use a top level object reference and a top level procedure as in:
http://www.neuron.yale.edu/neuron/stati ... #wholetree
(Of course this won't work in the case an object holds more than one tree , e.g. after multisplit)
WIthout knowing anything about internal section names, sectionlists, or connectivity, the only way I can think of offhand to
create an "all" sectionlist is to use a top level object reference and a top level procedure as in:
Code: Select all
// example cell template
begintemplate Cell
public soma, axon
create soma, axon
endtemplate Cell
// 5 of them for our test
objref cells[5]
for i=0,4 cells[i] = new Cell()
// use the built-in hoc_obj_[0] to create the
// sectionlist. Any global objref would do.
proc cellall() {
hoc_obj_[0] = new SectionList()
object_push($o1)
forall {
execute("hoc_obj_[0].append()")
}
object_pop()
// for testing
forsec hoc_obj_[0] { print secname() }
}
// test
cellall(cells[1])
cellall(cells[3])
Re: forsec on external object?
Thanks! I did not know about wholecell(). I've combined both of these approaches to give me a SectionList in root-to-leaf order without accessing globals:
Code: Select all
objref sl
sl = new SectionList()
object_push(cellObj)
forall {
execute("sl.wholetree()")
break // Stop after the first section
}
object_pop()
// for testing
forsec sl { print secname() }