pybrainsim-activity Mailing List for PyBrainSim - The Brain Phantom Project (Page 2)
Status: Planning
Brought to you by:
rgoj
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(123) |
Aug
(114) |
Sep
(44) |
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <rg...@us...> - 2009-09-13 19:24:23
|
Revision: 127
http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=127&view=rev
Author: rgoj
Date: 2009-09-13 19:24:15 +0000 (Sun, 13 Sep 2009)
Log Message:
-----------
* Added an example cortical area simulation with a neural mass model from Jansen and Rit 1995.
This currently isn't programmed with classes, so it will need to be rewritten to allow neural mass model specification, but it shows that it is easy to use such models and is a good starting point for writing the classes.
Modified Paths:
--------------
trunk/src/PyBrainSim.py
Modified: trunk/src/PyBrainSim.py
===================================================================
--- trunk/src/PyBrainSim.py 2009-09-11 10:30:28 UTC (rev 126)
+++ trunk/src/PyBrainSim.py 2009-09-13 19:24:15 UTC (rev 127)
@@ -178,6 +178,88 @@
exampleHead = Head()
exampleHead.displayHead()
elif userChoice == 8:
- print("Not implemented yet...")
+ # This class will produce noise that will be fed into the modelled
+ # cortical area as input.
+ class NeuralNoise:
+ def __init__(self, timeSpan, dtime):
+ self.noise = []
+ self.dtime = dtime
+ self.timePoints = range( int(timeSpan//dtime+1) )
+ # Random noise distributed evenly between 120 and 320
+ for i in self.timePoints:
+ self.noise.append( 120+200*random() )
+ def getNoise(self, time):
+ # Searching for the appropriate time point
+ for i in self.timePoints:
+ if time < self.timePoints[i]*self.dtime:
+ # Interpolating between the randomly generated values
+ return self.noise[i] + \
+ (self.noise[i+1]-self.noise[i]) \
+ * ((self.timePoints[i]*self.dtime-time)/self.dtime)
+
+ # The sigmoid function
+ def sigmoidFunction(v):
+ """Constants taken from Jansen and Rit 1995, p. 360"""
+ cEzero = 2.5
+ cR = 0.56
+ cVzero = 6
+
+ """Sigmoid function taken from Jansen and Rit 1995, p. 360"""
+ return 2*cEzero / ( 1 + numpy.exp( cR*( cVzero - v ) ) )
+
+ # Defining the equations
+ def f(t, y, noiseObject, cC):
+ cA=3.25
+ ca=100.0
+ cB=22.0
+ cb=50.0
+ cC1=cC
+ cC2=0.8*cC1
+ cC3=0.25*cC1
+ cC4=0.25*cC1
+ noise = noiseObject.getNoise(t)
+ #print("Time: " + str(t) + " Noise: " + str(noise))
+ return [y[1], cA*ca*( sigmoidFunction(y[2] - y[4]) ) - 2*ca*y[1] -
+ ca**2*y[0], y[3], cA*ca*( noise + cC2*sigmoidFunction(cC1*y[0]) ) -
+ 2*ca*y[3] - ca**2*y[2], y[5], cB*cb*( cC4*sigmoidFunction(cC3*y[0])
+ ) - 2*cb*y[5] - cb**2*y[4]]
+
+ # How many seconds should be modelled and how accurately
+ timeSpan = 3
+ dtime = 0.001
+ firstPointToDisplay = 1000
+
+ # A noise object that will be used as input into the equations
+ someNoise = NeuralNoise(timeSpan+1, dtime*10)
+
+ # Initial conditions
+ y0, t0 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 0
+
+ # Preparing for simulations
+ r = []
+ recording = [ [], [], [], [], [], [] ]
+ parameter = [ 68, 128, 135, 270, 675, 1350 ]
+
+ # Differential equation integration
+ for i in range(len(parameter)):
+ # Preparing the integration
+ r.append(ode(f).set_integrator('vode', method='bdf'))
+ r[i].set_initial_value(y0, t0)
+ r[i].set_f_params( someNoise, parameter[i] )
+ # Integrating
+ print("Performing simulation " + str(i+1) + "/" + str(len(parameter)))
+ while r[i].successful() and r[i].t < timeSpan:
+ r[i].integrate(r[i].t+dtime)
+ recording[i].append(r[i].y[2] - r[i].y[4])
+
+ # Show results of simulations
+ from pylab import *
+ for i in range(len(parameter)):
+ subplot( len(parameter), 1, i+1)
+ if i==0:
+ title("Simulations based on Fig. 3 from Jansen and Rit 1995")
+ ylabel( "C = " + str(parameter[i]) )
+ plot(recording[i][firstPointToDisplay:])
+ show()
else:
print("No such option unfortunately...")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 20:05:39
|
#113: Test programmatic adding of generators with the dummy GUI
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
Changes (by rgoj):
* component: Simulations => Interface
* milestone: Neural mass model simulation => Simple graphical user
interface
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/113#comment:1>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 20:05:04
|
#107: Design the GUI for setting up new simulations
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
Changes (by rgoj):
* milestone: Neural mass model simulation => Simple graphical user
interface
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/107#comment:1>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:29:06
|
#119: Implement and test programmatic stimulus specyfying
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/119>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:27:54
|
#118: Implement and test programmatic adding registration sites
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/118>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:27:09
|
#117: Implement and test programmatic changin of head model
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/117>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:26:37
|
#116: Implement and test programmatic adding of connections
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/116>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:26:16
|
#115: Implement and test programmatic adding of generators
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/115>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:18:31
|
#114: Create the GUI for setting up simulations
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/114>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:18:09
|
#113: Test programmatic adding of generators with the dummy GUI
-------------------------+--------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Neural mass model simulation
Component: Simulations | Keywords:
-------------------------+--------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/113>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:17:48
|
#112: Create a dummy generator adding interface to test the programmatic adding
of generators
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/112>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:06:39
|
#111: How can we nicely implement setting up the simulations via a GUI?
--------------------+-------------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Design | Keywords:
--------------------+-------------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/111>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:05:59
|
#110: Decide whether to add a "remove generator/connection/etc" function.
--------------------+-------------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Design | Keywords:
--------------------+-------------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/110>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:04:20
|
#109: Make the text displayed to standard output display in a graphical log
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/109>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:03:45
|
#108: Implement the main window allowing the user to graphically choose example
simulations.
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/108>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:01:09
|
#107: Design the GUI for setting up new simulations
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Neural mass model simulation
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/107>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:00:37
|
#106: Design the main window for the graphical PyBrainSim interface
--------------------+-------------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Design | Keywords:
--------------------+-------------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/106>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 19:00:03
|
#105: Write a simple test of the gui in a new source file
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/105>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-12 18:58:38
|
#104: Choose the libraries and method of creating the GUI
--------------------+-------------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Simple graphical user interface
Component: Design | Keywords:
--------------------+-------------------------------------------------------
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/104>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: <rg...@us...> - 2009-09-11 10:30:35
|
Revision: 126
http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=126&view=rev
Author: rgoj
Date: 2009-09-11 10:30:28 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
* Connections can now have gain, with the default gain equal to 1.
Modified Paths:
--------------
trunk/src/Connection.py
Modified: trunk/src/Connection.py
===================================================================
--- trunk/src/Connection.py 2009-09-11 10:07:37 UTC (rev 125)
+++ trunk/src/Connection.py 2009-09-11 10:30:28 UTC (rev 126)
@@ -27,10 +27,11 @@
"""
class Connection:
- def __init__(self, name, head, sourceGenerator, targetGenerator):
+ def __init__(self, name, head, sourceGenerator, targetGenerator, gain = 1):
self.name = name
self.sourceGenerator = sourceGenerator
self.targetGenerator = targetGenerator
+ self.gain = gain
head.addConnection(self)
def printInfo(self):
@@ -46,4 +47,4 @@
return self.targetGenerator
def runConnection(self, sourceGeneratorOutput):
- self.targetGenerator.receiveInput(sourceGeneratorOutput)
+ self.targetGenerator.receiveInput(self.gain * sourceGeneratorOutput)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-11 10:12:00
|
#74: Correct installation scripts to install necessary modules
-----------------------+----------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: new
Priority: major | Milestone: Neural mass model simulation
Component: Interface | Keywords:
-----------------------+----------------------------------------------------
Comment(by rgoj):
New modules:
numpy
scipy.integrate.ode
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/74#comment:1>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-11 10:10:38
|
#73: Which Python modules to use for solving differential equations?
--------------------+-------------------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: closed
Priority: major | Milestone: Neural mass model simulation
Component: Design | Resolution: fixed
Keywords: |
--------------------+-------------------------------------------------------
Changes (by rgoj):
* status: new => closed
* resolution: => fixed
Old description:
New description:
Decided on:
scipy.integrate.ode
(they have a runge-kutta 45 method in their repositories waiting,
hopefully soon to be released)
--
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/73#comment:1>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|
|
From: <rg...@us...> - 2009-09-11 10:07:44
|
Revision: 125
http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=125&view=rev
Author: rgoj
Date: 2009-09-11 10:07:37 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
* Adding module imports:
** numpy
** integration from scipy
Modified Paths:
--------------
trunk/src/PyBrainSim.py
Modified: trunk/src/PyBrainSim.py
===================================================================
--- trunk/src/PyBrainSim.py 2009-09-11 10:03:26 UTC (rev 124)
+++ trunk/src/PyBrainSim.py 2009-09-11 10:07:37 UTC (rev 125)
@@ -26,7 +26,9 @@
pybrainsim.sourceforge.net
"""
+import numpy
from random import random
+from scipy.integrate import ode
from Head import Head
from HeadModel import HeadModel
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rg...@us...> - 2009-09-11 10:03:36
|
Revision: 124
http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=124&view=rev
Author: rgoj
Date: 2009-09-11 10:03:26 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
* Preparing the PyBrainSim script to host an example cortical area simulation with a neural mass model from Jansen and Rit 1995.
Modified Paths:
--------------
trunk/src/PyBrainSim.py
Modified: trunk/src/PyBrainSim.py
===================================================================
--- trunk/src/PyBrainSim.py 2009-09-02 08:51:22 UTC (rev 123)
+++ trunk/src/PyBrainSim.py 2009-09-11 10:03:26 UTC (rev 124)
@@ -48,9 +48,10 @@
3. Incrementing numbers, two generators and a stimulus for one of them\n\
4. A single sinusoidal generator\n\
5. A hundred sinusoidal generators with random frequencies, some connected\
- to a stimulus.\n\
+ to a stimulus\n\
6. A single sinusoidal generator but with two registration sites\n\
- 7. A presentation of the 3d head model."
+ 7. A presentation of the 3d head model\n\
+ 8. A model of a cortical area, based on Jansen and Rit 1995."
print(welcomeMessage)
userChoice = input("Your choice: ")
@@ -174,5 +175,7 @@
elif userChoice == 7:
exampleHead = Head()
exampleHead.displayHead()
+elif userChoice == 8:
+ print("Not implemented yet...")
else:
print("No such option unfortunately...")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: PyBrainSim - T. i. <no...@so...> - 2009-09-02 09:01:10
|
#64: Show in 3D a halved sphere
----------------------------+-----------------------------------------------
Reporter: rgoj | Owner: rgoj
Type: task | Status: closed
Priority: major | Milestone: 3D visualization of head model
Component: Visualizations | Resolution: fixed
Keywords: |
----------------------------+-----------------------------------------------
Changes (by rgoj):
* status: new => closed
* resolution: => fixed
--
Ticket URL: <http://sourceforge.net/apps/trac/pybrainsim/ticket/64#comment:1>
PyBrainSim <http://sourceforge.net/projects/pybrainsim/>
An interactive tool for the simulation and visualization of the electromagnetic activity of the brain.
|