Missing documents for pointprocess.get_loc() and .has_loc()
Posted: Wed Oct 03, 2007 9:40 pm
these two methods would be very useful to everybody, but they do not appear in the on line reference.
The NEURON Forum
https://www.neuron.yale.edu/phpBB/
Code: Select all
strdef section_name, cmd
objref this_synapse, syn_section
this_synapse = cells.o[3].synlist.o[2] // replace w/ parameter when functionalized
range_syn = this_synapse.get_loc() // (0-1) https://www.neuron.yale.edu/phpBB/viewtopic.php?f=28&t=1057&p=3551&hilit=synapse+location#p3551
section_name = secname()
sprint(cmd, "section_L = %s.L", section_name)
execute(cmd)
// Find coordinates for 3d-coord prior to and after syn_range
ii = 0
while ( (arc3d(ii)/section_L) <= range_syn) ii = ii +1 // find surrounding 3d indexes
range_prior = arc3d(ii-1)/section_L
range_post = arc3d(ii)/section_L
range_syn_normalized = (range_syn-range_prior)/(range_post - range_prior)
coord_x = range_syn_normalized * ( x3d(ii)-x3d(ii-1) )
coord_y = range_syn_normalized * ( y3d(ii)-y3d(ii-1) )
coord_z = range_syn_normalized * ( z3d(ii)-z3d(ii-1) )
pop_section()
Code: Select all
/*0 S0 */ {cell_append(new S_NetStim(), 60, 120, 0)}
/*1 S1 */ {cell_append(new S_NetStim(), 51, 120, 0)}
/*2 D2 */ {cell_append(new Default_Cell(), 32, 123, 0)}
/*3 D3 */ {cell_append(new Default_Cell(), 33, 123, 0)}
/*4 S4 */ {cell_append(new S_NetStim(), 54, 120, 0)}
/*5 D5 */ {cell_append(new Default_Cell(), 35, 123, 0)}
/*6 S6 */ {cell_append(new S_NetStim(), 60, 125, 0)}
/*7 S7 */ {cell_append(new S_NetStim(), 60, 124, 0)}
Code: Select all
create soma, dend
access soma
connect dend(0), soma(1)
objref asyn
dend asyn = new AlphaSynapse(0.5)
print "default section: ", secname()
// test 0
print " "
print "Test 1: Executing .get_loc() at top level"
asyn.get_loc()
print "Checking current section at top level: ", secname()
print " "
print "Test 2: Executing .get_loc() at top level"
asyn.get_loc() {
print "but curly brackets start a block of code that executes in the context"
print "of that call, so when we test for the current section, we're not at"
print "the top level, and the current section is: ", secname()
}
print "Closing the block of code returns us to top level,"
print "and the current section is: ", secname()
proc test_3() {
print "proc test_3 executes .get_loc()"
asyn.get_loc()
print "Within proc test_3, current section is: ", secname()
}
print " "
print "Test 3"
test_3()
print "After return to top level, current section is: ", secname()
proc test_4() {
print "proc test_4 calls proc test_3"
test_3()
print "After return from proc test_3, but still inside proc test_4,"
print "current section is: ", secname()
}
print " "
print "Test 4"
test_4()
print "After return to top level, current section is: ", secname()
Code: Select all
default section: soma
Test 1: Executing .get_loc() at top level
0.5
Checking current section at top level: soma
Test 2: Executing .get_loc() at top level
but curly brackets start a block of code that executes in the context
of that call, so when we test for the current section, we're not at
the top level, and the current section is: dend
Closing the block of code returns us to top level,
and the current section is: soma
Test 3
proc test_3 executes .get_loc
Within proc test_3, current section is: dend
After return to top level, current section is: soma
Test 4
proc test_4 calls proc test_3
proc test_3 executes .get_loc
Within proc test_3, current section is: dend
After return from proc test_3, but still inside proc test_4,
current section is: dend
After return to top level, current section is: soma
Code: Select all
create soma, dend, axon // added axon
access soma
connect dend(0), soma(0)
connect axon(0), soma(1) // added axon
objref asyn, asyn2
dend asyn = new AlphaSynapse(0.5)
axon asyn2 = new AlphaSynapse(0.7) // added asyn2
print "default section: ", secname()
// test 0
print " "
print "Test 1: Executing .get_loc() at top level"
asyn.get_loc()
print "Checking current section at top level: ", secname()
print " "
print "Test 2: Executing .get_loc() at top level"
asyn.get_loc() {
print "but curly brackets start a block of code that executes in the context"
print "of that call, so when we test for the current section, we're not at"
print "the top level, and the current section is: ", secname()
}
print "Closing the block of code returns us to top level,"
print "and the current section is: ", secname()
proc test_3() {
print "proc test_3 executes .get_loc()"
asyn.get_loc()
print "Within proc test_3, current section is: ", secname()
}
print " "
print "Test 3"
test_3()
asyn2.get_loc() // changed to asyn2
print "After return to top level, current section is: ", secname()
proc test_4() {
print "proc test_4 calls proc test_3"
test_3()
print "After return from proc test_3, but still inside proc test_4,"
asyn2.get_loc() // added asyn2
print "current section is: ", secname()
}
print " "
print "Test 4"
test_4()
print "After return to top level, current section is: ", secname()
Code: Select all
default section: soma
Test 1: Executing .get_loc() at top level
0.5
Checking current section at top level: soma
Test 2: Executing .get_loc() at top level
but curly brackets start a block of code that executes in the context
of that call, so when we test for the current section, we're not at
the top level, and the current section is: dend
Closing the block of code returns us to top level,
and the current section is: soma
Test 3
proc test_3 executes .get_loc()
Within proc test_3, current section is: dend
0.5
After return to top level, current section is: soma
Test 4
proc test_4 calls proc test_3
proc test_3 executes .get_loc()
Within proc test_3, current section is: dend
After return from proc test_3, but still inside proc test_4,
current section is: axon
After return to top level, current section is: soma
oc>