[visionegg] Re: stimulus code outputs

Hello Darren,


Expy is an attempt to re-implement with pygame an old, (venerable ;-), DOS experimental stimulator (EXPE: www.lscp.net/expe) which I wrote 15 years ago (and is still used nowdays in some labs, for its "perfect" timing). Expy is extremely preliminary and we should not have put the web page in my opinion, because the program is not really usable. Emmanuel Dupoux and I hope to be able to recruit a programmer to pursue this project, but we are still looking for funding. Still if you can steal any ideas from the project, it would not have been entirely useless.


I would really like to use python/pygame and maybe VisionEgg to program experiments. Actually, a colleague, Mark Welxer, and I, have experimented with python a bit and encouraged students to use it: see http://cim.risc.cnrs.fr/cours/exphum/projects/projects.shtml), but I need to convinced myself that I can solve some latencies problems (not specific to python) for some experiments (I work under Linux; the situation may be better with Windows). Just try the following very simple minded program to see the latencies you can get:

import pygame
a= pygame.time.get_ticks()
max=-1
for i in range (1,1000):
   b = pygame.time.get_ticks()
   c = b-a
   if c>max:
       max=c
   a = b
   t.delay(10)
print max

(I just got max=140 msec on my system).

I know VisionEgg offers to swith to 'real-time' mode (SCHED_FIFO in Linux), but I have had bad experience in the past with real-time processes slowing down other threads (e.g. sound output was choppy). But I have not tested VisionEgg enough yet.

Anyway, maybe a good idea would be to set up some repository of real experiments programmed in python, using whatever packages (visionegg, pygame or other). This would encourage people to try and test these packages.

Christophe Pallier
www.pallier.org

Darren Weber wrote:

I notice that pyserial and pyparallel are used by expy - seems there
is more than one development effort in python for psychology
experiments; I wonder if some sort of integration of efforts might be
possible/useful?

http://www.ehess.fr/centres/lscp/expy/expy.html


On Wed, 23 Mar 2005 09:58:25 -0800, Darren Weber
<darrenleeweber@xxxxxxxxx> wrote:


http://pyserial.sourceforge.net/


On Wed, 23 Mar 2005 09:47:58 -0800, Darren Weber
<darrenleeweber@xxxxxxxxx> wrote:


The visionegg provides display capabilities, but what about output of
a stimulus code event to an external device.  For example, lets say we
present an image every 2 sec and there are 5 different categories of
image.  Each category is given a code, a number between 0-255.  Now,
we want to send this code to an EEG | MEG | fMRI system that will
record the timing of this event code during the acquisition of another
data timeseries.  It is simple enough to save a stimulus/event log to
a file, but it would be nice to interact with the serial/parallel port
also.  Is there a command like:

eventCode = 128 # or eventID (maybe event.id)
event.send.parallelport(eventCode)
event.send.serialport(eventCode)

I don't have any experience with sending codes to the serial/parallel
port.  Any tips or reading material would be really useful.

Best, Darren



======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html


======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: