[visionegg] Re: Vision Egg, EEG and fMRI
- From: Andrew Straw <andrew.straw@xxxxxxxxxxxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Fri, 3 Jan 2003 02:59:25 -0500
Hi Christoph! Best wishes for the New Year!
On Thursday, January 2, 2003, at 12:38 PM, Christoph Lehmann wrote:
I was asked by our group, whether VE could be used for
experiments, which use fMRI and EEG simultaneously (EEG in the
scanner):
How can I send a parallel port trigger (and write the time in a file,
as I do
already) by the time the picture has been swapped to screen, and not
by the
time the picture is loaded into memory (as I do currently)? You wrote,
that
the parallel port can only be updated, when OpenGL is instructed to
swap
buffers.... what about the time between this instruction and the
actual swap?
Is it possible at all, with VE (with windows only, or also with
linux), or do I
need to get the vsync pulse from the VGA cable? We now have the same
discussion
again, we had at the beginning: for EEG the timing with ms precision
is crucial
(not for fMRI)..
The parallel port can be updated any time (I hope I didn't mislead you
on this). But if you're in "sync-swap" mode (buffer swapping
synchronized with VSYNC/VBL), the display only changes just after the
VSYNC pulse. Therefore it is pointless to update the parallel port to
indicate a display change unless you know VSYNC happened. However, if
you are in sync-swap mode, you do know that when the VSYNC just
happened and you can therefore update the parallel port in time with
actual display changes (without tapping VSYNC from the video cable).
However,with further work, modifying the video cable may give you a
better solution: You could make an electronic device that checks when
the a digital output on the parallel port changes and then create the
"true" digital output trigger only when the VSYNC happened on the VGA
cable.
Don't be afraid of getting the VSYNC signal -- for example, the HD15 to
BNC adapters give you the signal very easily indeed.
Also, it may be possible to use audio output to achieve ms precision,
at least if you know somewhat in advance when you want an event to
happen. I have not ventured down that path and there is no Vision Egg
code for this.
Currently I am evaluating a function every frame. Is it possible to
write a
function, which runs only when the vsync pulse has been detected (so
that in
this function I can write the parallelport-out command and the log of
the time
for the log-file).
I think the only solution is as above. I don't think any operating
system or video driver provides a way for a callback function to be
executed immediately after the VSYNC pulse.
How can I evaluate the vertical refresh rate of a) my thinkpad and b)
of a pair
of LCD goggles? Do you have an idea?
The laptop's internal display is probably locked at 60 Hz, as are most
(all?) LCD displays, including projectors. When the laptop's video
card drives an external display, it uses whatever vertical refresh it's
told. In linux, this is specified in your XF86Config file and in
Windows / Mac OS X, this is set in the "Displays" Control Panel /
System Preferences, although it may be difficult or impossible to find
in Windows. I have no experience with LCD shutter goggles, but they
probably synchronize to whatever VGA signal they are given (within a
certain range, anyway).
I hope all of this helps!
Cheers!
Andrew
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- Follow-Ups:
- [visionegg] Re: Vision Egg, EEG and fMRI
- From: Christoph Lehmann
Other related posts:
- » [visionegg] Re: Vision Egg, EEG and fMRI
- » [visionegg] Re: Vision Egg, EEG and fMRI
experiments, which use fMRI and EEG simultaneously (EEG in the scanner):
How can I send a parallel port trigger (and write the time in a file, as I do
already) by the time the picture has been swapped to screen, and not by the
time the picture is loaded into memory (as I do currently)? You wrote, that
the parallel port can only be updated, when OpenGL is instructed to swap
buffers.... what about the time between this instruction and the actual swap?
Is it possible at all, with VE (with windows only, or also with linux), or do I
need to get the vsync pulse from the VGA cable? We now have the same discussion
again, we had at the beginning: for EEG the timing with ms precision is crucial
(not for fMRI)..
function, which runs only when the vsync pulse has been detected (so that in
this function I can write the parallelport-out command and the log of the time
for the log-file).
of LCD goggles? Do you have an idea?
- [visionegg] Re: Vision Egg, EEG and fMRI
- From: Christoph Lehmann