Animation of synapse activation

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
rlindroos
Posts: 15
Joined: Thu Jan 02, 2014 2:23 pm

Animation of synapse activation

Post by rlindroos » Fri Aug 17, 2018 7:31 am

Hi all,
I have a model with a detailed morphology that I drive with synaptic input (of Exp2syn type).

I would now like to visualize the synaptic activation in a animation/movie, i.e. map the synaptic current onto the morphology over time.
Is there a best practice for this?

I have made a clumsy quick fix using a custom made mechanism, spikeMonitor, that maps the point process nature of the synapse onto a range variable (using pointers). I can then capture the state of this range variable, during the simulation using PlotShape().

Image

Code: Select all

COMMENT
Spike detection mechanism for visualization of synaptic input onto the morphology

ENDCOMMENT

NEURON {
	THREADSAFE
    SUFFIX spikeMonitor
    RANGE spike, fake
    POINTER I
}

PARAMETER {
    fake    = 0
}

ASSIGNED { 
    I
    spike
}

INITIAL {
	I       = 0
	spike   = 0
}

BREAKPOINT {
    spike = I
}
Another idea is to add a marker indicating the approximate location of the synapse on top of the morphology and change the color of this to indicate activation.

What would you recommend? Or even better is there a ready a solution for this?

ted
Site Admin
Posts: 5376
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Animation of synapse activation

Post by ted » Mon Aug 20, 2018 12:21 pm

I'm surprised that it works. I do have one minor question. Is "fake" really necessary?

rlindroos
Posts: 15
Joined: Thu Jan 02, 2014 2:23 pm

Re: Animation of synapse activation

Post by rlindroos » Tue Aug 21, 2018 12:33 pm

Well, probably not. I use "fake" as pointer target for segments not containing synapses.
That is they are pointed back to themselves...

ted
Site Admin
Posts: 5376
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Animation of synapse activation

Post by ted » Tue Aug 21, 2018 4:54 pm

Your approach works if there is only one such synaptic mechanism per segment. It can't be used if more than one NetCon drives that synaptic mechanism. The result it produces is unrelated to the NetCon's weight. But it is adequate for your needs?

rlindroos
Posts: 15
Joined: Thu Jan 02, 2014 2:23 pm

Re: Animation of synapse activation

Post by rlindroos » Wed Aug 22, 2018 2:17 am

I only have one NetCon per synapse so that would be adequate, yes.

I'm also not pointing to the weight of the NetCon object but to the current of the synapse itself.

e.g.

Code: Select all

from neuron import h
def cell
insert synapses (in some segments)
insert spikeMonitor (in all sections)

for sec in h.allsec():
	for seg in sec:
		if seg has synapse:
			point synapse.I to spikeMonitor.I
		else:
			point spikeMonitor.fake to spikeMonitor.I
			
def PlotShape()
initialize and run
Would something like this work for multiple sources?

(have deleted the code and made another solution using python now, since it seemed like you could not remove the visualized variable from origo without the gui + python is more versatile in general)

Post Reply