Search found 160 matches

by ramcdougal
Fri May 20, 2016 2:51 pm
Forum: NEURON + Python
Topic: Guidance on plotting cell's geometry in Python?
Replies: 4
Views: 7295

Re: Guidance on plotting cell's geometry in Python?

where I expect methods to be associated with the section objects and instead they're accessed through the hoc object (my terminology here might be wrong). Is there some guiding rule as to why this is the case? This is a legacy artifact of NEURON's transition from a HOC-based interface which did not...
by ramcdougal
Fri May 20, 2016 9:08 am
Forum: NEURON + Python
Topic: import swc file for network simulation
Replies: 2
Views: 8579

Re: import swc file for network simulation

For an example addressing both (1) and (2), see the load_swc function in https://github.com/ahwillia/PyNeuron-Toolbox/blob/master/PyNeuronToolbox/morphology.py You linked to a prior thread about using SWC morphologies. Remember Ted's cautions : always check the morphology to make sure it is reasonab...
by ramcdougal
Thu May 05, 2016 10:32 am
Forum: NEURON + Python
Topic: AP propagates too slow
Replies: 7
Views: 5776

Re: AP propagates too slow

To set the temperature via Python:

Code: Select all

h.celsius = 20
With important exceptions, the Python interface is essentially the same as the HOC interface, but prefaced with an "h."
by ramcdougal
Mon May 02, 2016 4:38 pm
Forum: UNIX/Linux
Topic: Issue compiling ...geometry3d/surfaces.cpp NEURON v7.4
Replies: 3
Views: 9924

Re: Issue compiling ...geometry3d/surfaces.cpp NEURON v7.4

Here's a patch that fixes the issue present when compiling with newer versions of cython: it changes the tuple position into a list. diff -r b8295be34ae5 share/lib/python/neuron/rxd/geometry3d/surfaces.pyx --- a/share/lib/python/neuron/rxd/geometry3d/surfaces.pyx Mon May 02 14:29:44 2016 +0200 +++ b...
by ramcdougal
Sat Apr 30, 2016 9:27 am
Forum: NEURON + Python
Topic: AP propagates too slow
Replies: 7
Views: 5776

Re: AP propagates too slow

Is the morphology (in particular, the diameter) the same?
by ramcdougal
Tue Apr 26, 2016 3:41 pm
Forum: NEURON + Python
Topic: Export a subset of loaded morphology
Replies: 3
Views: 5570

Re: Export a subset of loaded morphology

Almost. In my example, parent is the index of the parent section; parent_loc is the normalized position within that section. Thus: parent_sec = sec_list[sd['parent']] # not parent_loc, grab from sec_list not sec sec.connect(parent_sec(sd['parent_loc']), sd['section_orientation']) This last line is i...
by ramcdougal
Tue Apr 26, 2016 10:31 am
Forum: NEURON + Python
Topic: Export a subset of loaded morphology
Replies: 3
Views: 5570

Re: Export a subset of loaded morphology

To the best of my knowledge, there is no built-in 1-line solution, but: The key functions and classes are h.parent_connection , h.section_orientation , and h.SectionRef . It's a little tricky to do this right because of the distinction between a "true parent" and a mere "parent". There are two funct...
by ramcdougal
Fri Mar 11, 2016 6:00 pm
Forum: MSWin
Topic: Neuron as a Python Module Redux
Replies: 8
Views: 11857

Re: Neuron as a Python Module Redux

Try permanently setting the PATH environment variable for the system instead of through the command line. (See below.) In addition, make sure you are using the 32 bit NEURON to match your 32 bit Python. For completeness, I just tried the following on a machine starting from no OS, and it worked: Ins...
by ramcdougal
Sat Mar 05, 2016 10:59 am
Forum: MSWin
Topic: Neuron as a Python Module Redux
Replies: 8
Views: 11857

Re: Neuron as a Python Module Redux

Open a DOS prompt (cmd) and try running: set PATH=c:\nrn\bin;%PATH% Then (in the same window), type "python" and "import neuron". Does that work? If so, you can make the change permanent by adding c:\nrn\bin to the PATH environment variable; instructions are available here and elsewhere. A similar p...
by ramcdougal
Wed Dec 30, 2015 10:40 pm
Forum: Reaction-diffusion in NEURON
Topic: calcium diffusion in different shells
Replies: 8
Views: 7149

Re: calcium diffusion in different shells

You are right that cai as defined in those models is not the average calcium concentration. That is by design. cai and cao are the two calcium concentrations made available to ion channel, pump, etc mechanisms defined in NMODL via USEION. As such, they are the concentrations that the mechanism can "...
by ramcdougal
Fri Oct 02, 2015 11:07 am
Forum: NEURON + Python
Topic: Problem with hclass in NEURON 7.4
Replies: 5
Views: 2225

Re: Problem with hclass in NEURON 7.4

One more change should fix that, this time in share/lib/python/neuron/__init__.py : Replace the __new__ method (starts at line 168) with def __new__(cls, *args, **kwds): kwds2 = {'hocbase': cls.htype} if 'sec' in kwds: kwds2['sec'] = kwds['sec'] return hoc.HocObject.__new__(cls, *args, **kwds2) (Dep...
by ramcdougal
Thu Oct 01, 2015 11:40 am
Forum: NEURON + Python
Topic: Problem with hclass in NEURON 7.4
Replies: 5
Views: 2225

Re: Problem with hclass in NEURON 7.4

Sorry about that; ironically, this was caused by an attempt to improve error checking in the hocobj_call function. A fix is to add the line: PyDict_DelItemString(kwds, "hocbase"); at line 182 in src/nrnpython/nrnpy_hoc.cpp (right before the call to hocobj_call). We'll try to update the repository so...
by ramcdougal
Tue Jun 16, 2015 4:23 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Segmentation Violation when loading new mechanism
Replies: 2
Views: 5676

Re: Segmentation Violation when loading new mechanism

From the comment, note that: Pointers specified at the hoc level must be used to connect the extracellular mechanism's e_extracellular and i_membrane to this mechanism's ex and im, respectively. If you're not setting the pointers, then they won't point anywhere meaningful. When the model tries to us...
by ramcdougal
Thu Apr 30, 2015 3:13 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Import or conversion of ChannelML(NeuronML-1.8) for NEURON
Replies: 5
Views: 7340

Re: Import or conversion of ChannelML(NeuronML-1.8) for NEUR

Did you try running without the nrn_load_dll?

If you import neuron from a script in the folder with x86_64, i686, or whatever it should automatically find and load the compiled mechanisms. If that doesn't just work, can you tell us what platform you're running on?
by ramcdougal
Tue Apr 28, 2015 9:32 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Import or conversion of ChannelML(NeuronML-1.8) for NEURON
Replies: 5
Views: 7340

Re: Import or conversion of ChannelML(NeuronML-1.8) for NEUR

The basic sequence is: start with a ChannelML model run the converter script to generate an NMODL mechanism compile the mechanism with: nrnivmodl launch NEURON insert the mechanism into a NEURON model You're missing the third step. When you launch NEURON after compiling the mechanism, you should see...