Thank you so much for your suggestion. I was able to compile the xtra.mod file after changing the directory. Thanks a lot! I did all this to get coordinates for all nodes and internodes in my section. But however now I have a new problem. I compiled the xtra.mod file and used my own hoc file for the neuron (where I inserted xtra mechanism and extracellular). There was no problem till this step and I got my 121 neurons which I arranged in 11X11 fashion along y-axis. Then after I loaded your file interpxyz.hoc and setpointers.hoc (to call grindaway procedure in interpxyz.hoc). I didn't get any errors. So, I wrote a small code to generate the coordinates for all nodes and internodes since this was what I was looking for. I got the output but however it looks weird.
for example: coordinates for pyramidal neuron[0].soma and coordinates for pyramidal neuron[1].soma is exactly the same. (although I have repositioned the coordinates already and even the shapeplot shows that the neurons are not overlapping and clearly have different coordinates)
My neuron has 10 dendrites. However, pyramidal neuron[0].dend[1] and pyramidal neuron[0].dend[2] are exactly equal and also pyramidal neuron[0].den[1] and pyramidal neuron[1].dend[1] are exactly equal and so on.
Could you please see what went wrong with the code I used to generate the coordinates? This was what I wrote to print the coordinates.
Code: Select all
//execute1("celltypes.element(\"pyramidalneuron\")")
load_file("nrngui.hoc")
begintemplate pyramidalneuron
public init, topol, basic_shape, subsets, geom, biophys, geom_nseg, biophys_inhomo
public synlist, x, y, z, position, connect2target
public soma, apicaldend, dend, axon
public all, apicaldendrite, dendrite, axons
objref synlist
proc init() {
topol()
subsets()
geom()
biophys()
geom_nseg()
synlist = new List()
synapses()
x = y = z = 0 // only change via position
}
create soma, apicaldend, dend[10], axon
proc topol() { local i
connect apicaldend(0), soma(1)
for i = 0, 9 connect dend[i](0), soma(1)
connect axon(0), soma(0)
basic_shape()
}
proc basic_shape() {
soma {pt3dclear() pt3dadd(0, 0, 0, 1) pt3dadd(0, 15, 0, 1)}
apicaldend {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(0, 165, 0, 1)}
dend {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(30, 135, 0, 1)}
dend[1] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(-29, 135, 0, 1)}
dend[2] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(45, 120, 0, 1)}
dend[3] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(60, 105, 0, 1)}
dend[4] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(-44, 120, 0, 1)}
dend[5] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(-59, 105, 0, 1)}
dend[6] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(-74, 90, 0, 1)}
dend[7] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(75, 90, 0, 1)}
dend[8] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(90, 75, 0, 1)}
dend[9] {pt3dclear() pt3dadd(0, 15, 0, 1) pt3dadd(-89, 75, 0, 1)}
axon {pt3dclear() pt3dadd(0, 0, 0, 1) pt3dadd(0, -194, 0, 1)}
}
objref all, apicaldendrite, dendrite, axons
proc subsets() { local i
objref all, apicaldendrite, dendrite, axons
all = new SectionList()
soma all.append()
apicaldend all.append()
for i=0, 9 dend[i] all.append()
axon all.append()
apicaldendrite = new SectionList()
apicaldend apicaldendrite.append()
dendrite = new SectionList()
for i=0, 9 dend[i] dendrite.append()
axons = new SectionList()
axon axons.append()
}
proc geom() {
forsec all { }
soma.L = 80
apicaldend.L = 2000
dend.L = 100
dend[1].L = 100
dend[2].L = 100
dend[3].L = 100
dend[4].L = 100
dend[5].L = 100
dend[6].L = 100
dend[7].L = 100
dend[8].L = 100
dend[9].L = 100
axon.L = 20000
soma.diam = 80
apicaldend.diam = 2
dend.diam = 1
dend[1].diam = 1
dend[2].diam = 1
dend[3].diam = 1
dend[4].diam = 1
dend[5].diam = 1
dend[6].diam = 1
dend[7].diam = 1
dend[8].diam = 1
dend[9].diam = 1
axon.diam = 15
}
external lambda_f
proc geom_nseg() {
forsec all { nseg = int((L/(0.1*lambda_f(100))+.999)/2)*2 + 1 }
}
proc biophys() {
forsec all {
Ra = 123
cm = 1
insert extracellular
xraxial[0] = 1e+09
xraxial[1] = 1e+09
xg[0] = 1e+09
xg[1] = 1e+09
xc[0] = 0
xc[1] = 0
e_extracellular = 0
insert xtra
rx_xtra = 1
x_xtra = 0
y_xtra = 0
z_xtra = 0
}
forsec apicaldendrite {
insert pas
g_pas = 0.001666
e_pas = -60
}
forsec dendrite {
insert pas
g_pas = 0.001666
e_pas = -60
}
forsec axons {
insert hh
gnabar_hh = 0.52
gkbar_hh = 0.036
gl_hh = 0.0001666
el_hh = -60
}
soma {
insert hh
gnabar_hh = 0.25
gkbar_hh = 0.036
gl_hh = 0.0001666
el_hh = -60
}
}
proc biophys_inhomo(){}
proc position() { local i
soma for i = 0, n3d()-1 {
pt3dchange(i, $1-x+x3d(i), $2-y+y3d(i), $3-z+z3d(i), diam3d(i))
}
x = $1 y = $2 z = $3
}
obfunc connect2target() { localobj nc //$o1 target point process, optional $o2 returned NetCon
soma nc = new NetCon(&v(1), $o1)
nc.threshold = 10
if (numarg() == 2) { $o2 = nc } // for backward compatibility
return nc
}
proc synapses() {}
endtemplate pyramidalneuron
//creating 121 neurons arranged along y-axis
nNeurons = 121
objectvar Neurons[nNeurons]
for i = 0, nNeurons-1 {
Neurons[i] = new pyramidalneuron()
}
//program to change the coordinates of the neuron
a = 0
for x=0, 10 {
for y=0, 10 {
b = x*2000 //distance between two adjacent neurons in x-axis
c = y*2000 //distance between two adjacent neurons in z-axis
Neurons[a].position(b,0,c) //coordinates for the new position of the neuron
a = a+1
}
}
load_file("interpxyz.hoc") // only interpolates sections that have extracellular (Ref: Ted)
load_file("setpointers.hoc") // automatically calls grindaway() in interpxyz.hoc (Ref: Ted)
//this prints coordinates
forall {
print secname()
for iii = 1, nseg {
xr = range.x[iii]
x_xtra(xr) = xint.x[iii]
y_xtra(xr) = yint.x[iii]
z_xtra(xr) = zint.x[iii]
print x_xtra(xr), y_xtra(xr), z_xtra(xr)
}
}
Thank you so much for your help and support. It wouldn't have been possible for me to go so far without your guidance. Thanks a lot!