I am instantiating a neuron using a python class that loads a neurolucida .asc file:
Code: Select all
from neuron import h, gui
h.load_file('import3d.hoc')
h.load_file("stdlib.hoc")
class toyCell_a:
def __init__(self):
self.load_morphology()
def __str__(self):
return 'cellID'
def load_morphology(self):
cell = h.Import3d_Neurolucida3()
cell.input('file.asc')
i3d = h.Import3d_GUI(cell, False)
i3d.instantiate(self)
cell_a = toyCell_a()
Code: Select all
NEURON: syntax error
near line 1
{hoc_pointer_(&_pysec.cellID.apic[11].v( 0.5 ))}
^
doNotify()
Exception in gui thread
- Create the neuron outside of a class, ie just load the .asc file and instantiate the neuron as a top-level function
- Change the morphology file to an .swc format and load using h.Import3d_SWC_read(), while still creating the neuron within a class
And finally if I remove def __str__(self): function from the cell class, I see no python sections listed at all.
I am using NEURON 8.2.6 and Python 3.11.9
Is this a bug, or am I using these functions incorrectly?
Thanks for any help.
EDIT: I just tried changing the str function to match the variable name I assign when calling the toyCell_a class:
Code: Select all
def __str__(self):
return 'cell_a'