[Pybrainsim-activity] SF.net SVN: pybrainsim:[142] trunk/src/PyBrainSim.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2010-06-27 17:14:50
|
Revision: 142 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=142&view=rev Author: rgoj Date: 2010-06-27 17:14:44 +0000 (Sun, 27 Jun 2010) Log Message: ----------- * Added a plot to the dipole spherical head model example. Modified Paths: -------------- trunk/src/PyBrainSim.py Modified: trunk/src/PyBrainSim.py =================================================================== --- trunk/src/PyBrainSim.py 2010-06-27 16:41:28 UTC (rev 141) +++ trunk/src/PyBrainSim.py 2010-06-27 17:14:44 UTC (rev 142) @@ -290,17 +290,25 @@ head.setSamplingFrequency(1) # Adding registration sites - nElectrodes = 20 + nElectrodes = 200 + angles = [] for i in range(nElectrodes): - head.addRegistrationSite([i*numpy.pi/(nElectrodes-1),numpy.pi/2]) + angles.append(i*numpy.pi/(nElectrodes-1) - numpy.pi/2) + head.addRegistrationSite([angles[-1],numpy.pi/2]) - # Adding generators - generator = GeneratorNoisy('Gen', head, position = [ 0.3, 0, 0, 0, 0], mean=1, stddev=0.1) + # Adding a generator + orientation = 0; + generator = GeneratorNoisy('Gen', head, position = [ 0.3, 0, orientation, 0, 0], mean=1, stddev=0.1) # Run the simulation just once (or, equivalently for one second with the sampling rate of 1 Hz) simulatedData = numpy.array(head.runSimulation(1)) print(simulatedData) + pylab.plot(angles,simulatedData) + pylab.xlabel("Location of measurement on scalp [radians]") + pylab.ylabel("Potential on scalp [arbitrary units]") + pylab.title("Potential from superficial dipole of orientation " + str(orientation)) + pylab.show() def menuButtonQuit(self, control): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |