Search found 214 matches

by ramcdougal
Tue Apr 26, 2016 10:31 am
Forum: NEURON + Python
Topic: Export a subset of loaded morphology
Replies: 3
Views: 5807

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: 12804

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: 12804

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: 7870

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: 2591

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: 2591

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: 5852

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: 7576

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: 7576

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...
by ramcdougal
Mon Apr 06, 2015 12:52 pm
Forum: Reaction-diffusion in NEURON
Topic: New reaction-diffusion model on ModelDB
Replies: 6
Views: 9216

Re: New reaction-diffusion model on ModelDB

Your system is somehow finding the old Python library. When you compile, after the "sudo make install" try: "cd src/nrnpython" and "sudo python setup.py install". As far as compiling goes: if you're replacing a version built from the repository, then yes, you can safely do a "hg pull -u", "make", "s...
by ramcdougal
Fri Mar 06, 2015 10:59 am
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 20621

Re: SWC files

I just set up NEURON for 32-bit Python on Windows 7 on my machine. Here's how: Install Windows 7 Install PythonXY Install the latest "alpha" version of NEURON 7.4 (for 32-bit, this is currently 1232+.i686 ) Set PYTHONPATH to include C:\nrn74w\lib\python and set NEURONHOME to C:\nrn74w. (See here for...
by ramcdougal
Wed Feb 25, 2015 8:18 pm
Forum: NEURON + Python
Topic: substitute stadard init() precedure from Python
Replies: 2
Views: 2155

Re: substitute stadard init() precedure from Python

Often one doesn't need to change init but rather wants to do additional things (e.g. assign state variables) during the initialization. If that's your situation, use an h.FInitializeHandler . It has options to specify when exactly things are done, but in the simplest use case, you just pass it a fun...
by ramcdougal
Fri Feb 20, 2015 10:46 am
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 20621

Re: SWC files

Can you copy and paste the NEURON banner that displays when you do the import? For example, on my computer, from inside Python: >>> import neuron NEURON -- VERSION 7.4 (1332:477da879a623) 2015-02-11 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015 See http://www.neuron.yale.edu/neuron/cr...
by ramcdougal
Thu Feb 19, 2015 5:46 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 20621

Re: SWC files

Now that I know you're trying to use other Python packages (e.g. btmorph), let me revise my earlier advice. The mingw version (and not the cygwin version) on the download page is the best for working with other packages. The reason I didn't recommend it earlier is because the GUI doesn't work in tha...
by ramcdougal
Thu Feb 19, 2015 12:28 pm
Forum: NEURON + Python
Topic: Increase stacksize from python?
Replies: 2
Views: 2237

Re: Increase stacksize from python?

If you're using NEURON 7.3 or higher, the reaction-diffusion's morphology submodule will allow you to easily write a version of topology in pure Python. I haven't tested edge cases (i.e. connecting to positions other than the 1 end), but here's a version that does at least the basics: def topology()...