SectionList

The basics of how to develop, test, and use models.
Post Reply
namrata27

SectionList

Post by namrata27 »

Hello

I am using complex morphology import using neuro-morph. From a reference point (currently accessed section) I have identified all the sections which have a path to the currently accessed section (including the currently accessed section).
The code :

pt=598
access cell1_3[pt]

objref s,pos
s = new SectionList()
pos = new Vector()
s.wholetree()
forsec s print secname()

However the list includes cell1_1,cell1_3,spineh,spinen. I want to have a subset with only the section in the path of currently accessed section which are belonging to cell1_3.(i.e secname's in s should only begin with cell1_3)
And then to compute the distance from the currently accessed section (cell1_3[pt]) to points in the sub set of section list I use :

forsec s {
for (x,0) {
pos.append(distance(1,x))
}
}

Is this approach correct ????
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: SectionList

Post by shailesh »

The first part of your question, about obtaining a subset of a section list, can be achieved using "issection()"
More on issection(): http://www.neuron.yale.edu/neuron/stati ... #issection

So in your case it would be something like:

Code: Select all

objref sub_s //section list to hold desired subset of s
sub_s = new SectionList()

forsec s {
      if (issection("cell1_3.*")) {
            sub_s.append()
      }
}
or, more compactly as:

Code: Select all

forsec s if (issection("cell1_3.*")) sub_s.append()
Finally, you could verify the list by checking:

Code: Select all

sub_s.printnames()
namrata27

Re: SectionList

Post by namrata27 »

Thanks :)
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: SectionList

Post by shailesh »

Welcome :) ... Regarding the second part of your question about calculating the distance:
You need to add one more statement to define the origin for distance evaluation:

Code: Select all

cell1_3[pt] distance() //Missing statement - defines section 'cell1_3[pt]' as the origin for all distance calculations

forsec sub_s {
      for (x,0) {
            pos.append(distance(1,x))
      }
}
I believe the above is accurate - (though I confess I have not used it prior in my models)
Post Reply