I am trying to manipulate my cell so each node would not have more than two children. The only section who has more than two children is the soma - (called a_soma in the code). My thought was to make a section array with the size of the number of children that the soma has, connect between them, calculate their correct length using parent_connection() and then connect each child to one of the soma array sections. here is the procedure:
Code: Select all
proc reduceSections(){localobj sl,conVec
comps = 0
forall{
comps = 0
sl=new SectionList()
sl.children()
somaref= new SectionRef()
forsec sl{
comps+=1
}
if (comps>2){
print diam
create somaext[comps+1]
index=0
somaL=somaref.sec.L
printf("%s l is %f diams is %f \n",secname(),somaref.sec.L, somaref.sec.diam)
conVec = new Vector()
cumL=0
conVec.append(0)
forsec sl{
conVec.append(parent_connection())
}
conVec=conVec.sort()
for(i=1;i<conVec.size();i+=1){
printf("i is %d diams is %f\n",i, somaref.sec.diam)
currPart = conVec.x(i)-conVec.x(i-1)
somaext[i-1]{
L=somaL*currPart
diam = somaref.sec.diam
parentCm = somaref.sec.cm
parentRa = somaref.sec.Ra
cumL+=L
}
connect somaext[i](0), somaext[i-1](1)
}
somaext[comps]{
L=somaL-cumL
diam = somaref.sec.diam
parentCm = somaref.sec.cm
parentRa = somaref.sec.Ra
}
forsec sl{
printf("index is %d i is %d\n",index,i)
disconnect()
secref= new SectionRef()
connect secref.sec(0),somaext[index](1)
index+=1
}
}
}
}
I can not understand what can causing the difference between the simulation, does anyone have an idea?
Thanks
Roy