My understanding is that compartments in NEURON are represented by segments, which are organized into groups called sections. Let 'dend[1]' be an example section. dend[1] has dend[1].nseg compartments, but dend[1].nseg + 2 segment objects in the iterator returned by dend[1].allseg(). This is because the endpoint of each section is also modeled using a segment object. My current understanding is that the section endpoints are not actually considered 'compartments' in NEURON's spatial discretization of the cable equation, but the segments in the interior of the section represent the midpoints of each compartment. Is this correct?
Each segment object defines the method ri() which "returns the resistance (in megohms) between the center of the segment and its parent segment." My second question is: how do we know what the parent of a given segment is? Say dend[1].nseg = 3, so list(dend[1].allseg()) is [dend[1](0), dend[1](0.166667), dend[1](0.5), dend[1](0.833333), dend[1](1)]. It seems reasonable to me that the parent segment of dend[1](0) would be dend[1].parentseg(), and the documentation seems to confirm this. I would expect that the 'parent segment' of the other segments in dend[1] would be the preceding segment in the section, so the parent of dend[1](0.166667) would be dend[1](0) and the parent of dend[1](0.5) would be dend[1](0.166667). Is this true?
If the previous paragraph is correct, I would expect dend[1](0.166667).ri() to return the resistance between dend[1](0) and dend[1](0.166667), and dend[1](0).ri() to return the resistance between dend[1].parentseg() and dend[1](0). Lets say that dend[1].parentseg() is the last segment in a previous section, dend[0], which has nseg = 1. Then we could represent the underlying compartmental topology as
Code: Select all
... -- dend[0](0.5) -- r_1 -- dend[1](0.166667) -- r_2 -- dend[1](0.5) -- r_3 -- dend[1](0.833333) -- ...
r_1: dend[0](1).ri() + dend[1](0).ri() + dend[1](0.166667).ri()
r_2: dend[1](0.5).ri()
r_3: dend[1](0.833333).ri()
Furthermore, if dend[0] were also connected to another section dend[2] with dend[2].nseg = 3 and dend[2].parentseg() = dend[0](1.), the topology and resistances would be:
Code: Select all
/-- r_1 -- dend[1](0.166667) -- r_2 -- dend[1](0.5) -- r_3 -- dend[1](0.833333) -- ...
/
... -- dend[0](0.5)
\
\-- r_4 -- dend[2](0.166667) -- r_5 -- dend[2](0.5) -- r_6 -- dend[2](0.833333) -- ...
r_4 = dend[0](1).ri() + dend[2](0).ri() + dend[2](0.166667).ri()
r_5 = dend[2](0.5).ri()
r_6 = dend[2](0.833333).ri()
Is this correct?