Search found 160 matches

by ramcdougal
Mon Apr 06, 2015 12:52 pm
Forum: Reaction-diffusion in NEURON
Topic: New reaction-diffusion model on ModelDB
Replies: 6
Views: 8563

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

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

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

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

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

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()...
by ramcdougal
Tue Feb 17, 2015 6:29 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

I'm command-line centric, but this is how I would do it: Open the NEURON 7.3 folder on your desktop (assuming you kept the default install options) Double click "mintty bash"; this gives you a terminal starting from your C:\ drive (which it calls /cygdrive/c/... ignore that) Change to the place that...
by ramcdougal
Tue Feb 17, 2015 2:55 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

To run a file in Python use execfile. For your example you would:

Code: Select all

execfile('hh.py')
by ramcdougal
Tue Feb 17, 2015 11:42 am
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

Set up the recording before h.run()'ing the simulation and you should be good. A few tips: - You'd have much shorter and more readable code if you used lists (think arrays) because then you could use for loops to automate things. - Actually, even as-is, you could still use a for loop to handle some ...
by ramcdougal
Sun Feb 15, 2015 9:18 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

Vector.record takes a pointer which is denoted with the _ref_ syntax. You want vec1 = h.Vector() vec1.record(cell1.soma(0.5)._ref_v) That's cell dot section parens location dot _ref_ variable of interest (v, nai, etc...). NB: This assumes that soma is a Section not an array; if not, replace `soma` ...
by ramcdougal
Thu Feb 12, 2015 7:03 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

With an IClamp , you have the same situation as with an Exp2Syn: there are many places on cell1 that could receive the current (the various dendrites, the soma, the axon), and you have to be specific. The syntax is similar to that for the synapse; to put a current clamp at the center (0.5) of cell1'...
by ramcdougal
Wed Feb 11, 2015 3:13 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

These cells have morphology; it doesn't suffice to say connect to cell2, because that doesn't say where on cell2 you want to connect. The basic procedure is to create a mechanism for the post-synaptic side of the connection (e.g. an Exp2Syn ) at a given location on the post-synaptic cell and then ma...
by ramcdougal
Fri Feb 06, 2015 11:12 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

Stepping back a bit, if the goal is to use Python to create a network of some fixed pool of cell types, it's probably easiest and most efficient to use NEURON's GUI tools to convert swc files into cell templates (this is a manual process, but you only have to do it once per cell type) rather than ha...
by ramcdougal
Wed Feb 04, 2015 11:44 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

If you're using PyNEURON, you have to manually set a NEURONHOME environment variable in order for it to find the HOC libraries. The need for this extra step is unfortunate, but it's a simple process (see, for example, here -- updated 20191029, link broken so removed but this is no longer necessary i...
by ramcdougal
Wed Feb 04, 2015 1:02 pm
Forum: NEURON + Python
Topic: SWC files
Replies: 33
Views: 17864

Re: SWC files

My sincere apologies. I copied the function out of another file I wrote and didn't test it on its own; it requires the GUI tools to be loaded. I've modified the import accordingly. Please try this version: def instantiate_swc(filename): """load an swc file and instantiate it""" # load the NEURON lib...