Extracting coordinates in stylized geometry
Posted: Sat Mar 18, 2017 6:24 pm
Hello all,
I made 10 neurons with a soma,1 axon and 10 dendrites using 'template' function. The code works well and I could see my neurons in my shape plot. But now, I am trying to extract the coordinates for each of the section of my neurons which I created with stylized geometry using n3d(), x3d(), y3d() etc available in neuron syntax. The exact code I wrote for it is :
Although it might look really easy, I got stuck in it since last few days. I only get the name of the section printed after executing this code. However, I do not get any coordinates which I wanted to have. When I just gave the command n3d() to check it, it returned me the value 0. I couldn't understand how the number of 3d locations could be 0? Could somebody kindly look into my code (the complete code with neuron model is attached below) and suggest me what went wrong? I would highly appreciate your help.
Sincerely,
Dina
I made 10 neurons with a soma,1 axon and 10 dendrites using 'template' function. The code works well and I could see my neurons in my shape plot. But now, I am trying to extract the coordinates for each of the section of my neurons which I created with stylized geometry using n3d(), x3d(), y3d() etc available in neuron syntax. The exact code I wrote for it is :
Code: Select all
forall {
print secname()
for i=0,n3d()-1 print i, x3d(i), y3d(i), z3d(i), diam3d(i)
}
Although it might look really easy, I got stuck in it since last few days. I only get the name of the section printed after executing this code. However, I do not get any coordinates which I wanted to have. When I just gave the command n3d() to check it, it returned me the value 0. I couldn't understand how the number of 3d locations could be 0? Could somebody kindly look into my code (the complete code with neuron model is attached below) and suggest me what went wrong? I would highly appreciate your help.
Sincerely,
Dina
Code: Select all
load_file("nrngui.hoc")
begintemplate Neuron
public soma, dend, axon
create soma, axon, dend[1]
proc init() {
ndend = 10
create soma, axon, dend[ndend]
soma {
nseg = 1
diam = 80
L = 80
Ra = 123.0
insert hh
gnabar_hh=0.25
gl_hh = .0001666
el_hh = -60.0
}
axon {
nseg = 100
diam = 15
L = 200
Ra = 123
insert hh
gnabar_hh=0.25
gl_hh = .0001666
el_hh = -60.0
}
for i=0, ndend-1 dend[i] {
nseg = 20
diam = 1.0
L = 100
Ra = 123
insert pas
g_pas = .0001666
e_pas = -60.0
}
// Connect things together
connect axon(0), soma(0)
for i=0, ndend-1 {
connect dend[i](0), soma(1)
}
}
endtemplate Neuron
ndend = 10
nNeurons = 10
objectvar Neurons[nNeurons]
for i = 0, nNeurons-1 {
Neurons[i] = new Neuron()
}
for i = 0, nNeurons-1 {
Neurons[i].soma psection()
}
// This is where I have problem
forall {
print secname()
for i=0,n3d()-1 print i, x3d(i), y3d(i), z3d(i), diam3d(i)
}
access Neurons[0].soma