Search found 17 matches
- Tue Apr 26, 2016 1:33 pm
- Forum: NEURON + Python
- Topic: Export a subset of loaded morphology
- Replies: 3
- Views: 8231
Re: Export a subset of loaded morphology
Ok nice - and then you would need a `load_json`function, something like: def load_json(morphfile): with open(morphfile, 'r') as f: secdata = json.load(morphfile) seclist = [] for sd in secdata: # make section sec = h.Section(name=sd['name']) seclist.append(sec) # make 3d morphology for x,y,z,d in zi...
- Tue Apr 26, 2016 12:35 am
- Forum: NEURON + Python
- Topic: Export a subset of loaded morphology
- Replies: 3
- Views: 8231
Export a subset of loaded morphology
I have a use case where I import a (large, complex) morphology from an swc file. Then I have a procedure for pruning branches to make a simpler morphology. At the end of the day, I have a python list with of NEURON section objects (they are all connected and the list contains the root node). Now I w...
- Tue Dec 22, 2015 12:52 pm
- Forum: UNIX/Linux
- Topic: NEURON dockerfile
- Replies: 1
- Views: 9658
NEURON dockerfile
I'm in the process of making a Dockerfile for NEURON to make it easier for others to try out simulations without installing on their own machines. I anticipate that I'll have a lot of questions throughout the course of this process... Apologies in advance, I haven't installed NEURON on a machine in ...
- Fri Oct 17, 2014 2:00 am
- Forum: NEURON + Python
- Topic: Simple function to add synapses
- Replies: 8
- Views: 9856
Re: Simple function to add synapses
Yes, I don't need to run the code multiple times within the same iPython session. I just happened to be doing that when I was testing things out... So I have a satisfactory solution to the problem.
- Sat Oct 11, 2014 2:01 pm
- Forum: NEURON + Python
- Topic: Simple function to add synapses
- Replies: 8
- Views: 9856
Re: Simple function to add synapses
I finally figured it out. There is nothing wrong with the code, but NEURON does not clean up after itself, causing the code to crash the second time its run. Before I was doing this: $ ipython In [1]: %run model.py # this works fine the first time In [2]: %run model.py # the second run usually segfa...
- Fri Oct 10, 2014 3:15 pm
- Forum: NEURON + Python
- Topic: Simple function to add synapses
- Replies: 8
- Views: 9856
Re: Simple function to add synapses
So I updated the code to keep the h.Vector() objects in memory. Another post on the forum seemed to suggest that this was important. However, I'm still getting sporadic segfaults. The code DOES work maybe 50% of the time. When I comment out the section for adding synapses, I get no segfaults. from n...
- Fri Oct 10, 2014 11:47 am
- Forum: NEURON + Python
- Topic: Simple function to add synapses
- Replies: 8
- Views: 9856
Re: Simple function to add synapses
Thanks for the reply. I think I'm moving in the right direction. However, the code below segfaults and I'm not sure why (it may be completely unrelated to the synapses, I will investigate further). from neuron import h import numpy as np import pylab as plt # Load morphology and other stuff h.load_f...
- Thu Oct 09, 2014 9:23 pm
- Forum: NEURON + Python
- Topic: Simple function to add synapses
- Replies: 8
- Views: 9856
Simple function to add synapses
This is a very basic question. I would like to implement a python function that adds an Exp2Syn at a specified location, which triggers a series of post-synaptic events at specified times. I want to do something like: from neuron import h def add_synapse(section,loc,weight,times): " " &quo...
- Fri Sep 12, 2014 3:31 pm
- Forum: Getting started
- Topic: how to display 3d coordinates of a segment
- Replies: 9
- Views: 39623
Re: how to display 3d coordinates of a segment
In case anybody is interested, I figured out how you can do this in Python: from neuron import h dend1 = h.Section() dend2 = h.Section() dend3 = h.Section() h.pt3dadd(0,0,0,1,sec=dend1) h.pt3dadd(1,0,0,1,sec=dend1) h.pt3dadd(0,0,0,1,sec=dend3) h.pt3dadd(0,1,0,1,sec=dend3) for s in dend1,dend2,dend3:...
- Thu Aug 21, 2014 11:35 am
- Forum: Reaction-diffusion in NEURON
- Topic: Active Transport
- Replies: 4
- Views: 11028
Re: Active Transport
Hi Ted, I'm interested in activity-dependent transcription of mRNA and its transport to neurites. Some mRNAs can be produced and transported quite rapidly (~15 minutes after high frequency stimulation). I like the idea of a phenomenological model, but I would like to couple mRNA production and expre...
- Wed Aug 20, 2014 5:25 pm
- Forum: Reaction-diffusion in NEURON
- Topic: Active Transport
- Replies: 4
- Views: 11028
Active Transport
I'm curious if it is possible to use the rxd module to model active transport of intracellular solutes. For a simple example, suppose I have two sections: from neuron import h, rxd soma = h.Section() dend = h.Section() dend.connect(soma , 1, 0) Lets say that some mRNA transcript of ('m') interest is...
- Tue May 20, 2014 3:24 pm
- Forum: Adding new mechanisms and functions to NEURON
- Topic: How to access L (length of section) in NMODL
- Replies: 1
- Views: 2955
How to access L (length of section) in NMODL
I have a couple of mechanisms that need to know the surface area of the section they are inserted into. I tried to achieve this by the following code ASSIGNED { diam (um) L (um) surface_area (um) } BREAKPOINT { surface_area = 3.141592 * diam * L } I found that diam was correctly specified... but... ...
- Wed Apr 30, 2014 1:51 pm
- Forum: Adding new mechanisms and functions to NEURON
- Topic: Check if pointer is null in NMODL
- Replies: 7
- Views: 7463
Re: Check if pointer is null in NMODL
Excellent. Thank you!
- Wed Apr 30, 2014 12:16 pm
- Forum: Adding new mechanisms and functions to NEURON
- Topic: Check if pointer is null in NMODL
- Replies: 7
- Views: 7463
Re: Check if pointer is null in NMODL
I am now getting a list of compile-time errors. The first listed one is: invalid storage class for function 'state_change' I get this error for the following code: DERIVATIVE state_change { rates(v) : Calculate minf, taum, hinf, tauh m' = (minf-m)/taum h' = (hinf-h)/tauh if( plastic==1 ){ gbar' = (a...
- Wed Apr 30, 2014 11:36 am
- Forum: Adding new mechanisms and functions to NEURON
- Topic: Check if pointer is null in NMODL
- Replies: 7
- Views: 7463
Re: Check if pointer is null in NMODL
Great! This is easy to implement. Thanks for your help.
Out of curiousity, how does NEURON handle the line
Will this slow the simulation down a little bit, or is it smart enough to ignore gbar in the integration routine entirely?
Thanks again!
Out of curiousity, how does NEURON handle the line
Code: Select all
gbar' = 0
Thanks again!