Accessing all sections of a particular cell from a list
Posted: Tue May 13, 2014 3:41 pm
I have a python class which defines the population via a list
First question: Is this the proper way of defining a list of cells?
Now the main question:
I want to access sections of a particular cell from a member function of this class. I am not sure how to do that. Do I understand correctly that
will go over all sections of all cells and cannot be applied to a particular cell from the list?
The only thing I can think of is to define in my hoc definition of each cell and then do the following in Python:
Is this the right way for doing this? I am very new to this.
Code: Select all
class PL2PC:
def __init__(self, morph_fname, n_cells):
self.cell = []
for ic in range(0,n_cells):
self.cell.append(h.L2_PC(morph_fname))
Now the main question:
I want to access sections of a particular cell from a member function of this class. I am not sure how to do that. Do I understand correctly that
Code: Select all
for sec in h.allsec():
will go over all sections of all cells and cannot be applied to a particular cell from the list?
The only thing I can think of is to define
Code: Select all
allsections = new SectionList()
Code: Select all
cell0 = self.cell[0] # get at a particular cell
for sec in cell0.allsections