[visionegg] Re: simple RSVP scripts
- From: "Gabriel Nevarez" <nevarezg@xxxxxxxxxxxxx>
- To: <visionegg@xxxxxxxxxxxxx>
- Date: Wed, 26 Jan 2005 00:09:54 +0000
quite the contrary... in loading the images, the first 3 or 4 images flip at an
abysmally slow pace (i.e, about a second or two between flips), whereas the
later ones flip at the appropriate rate... in the case of my laptop, 60hz...
this is consistent with what I assume is file-loading time or some other
otherhead. btw, these are large, 1024 x 768 x 24bit images ( x 10 images, in
this case of this demo script)
Since I'll have a splash-screen with instructions (which will allow sufficient
time for the textures to load completely), i doubt this will matter in a real
study, but it would be nice to have a deterministic timing model so I could make
sure that all textures are guaranteed to be loaded in memory before presentation
and subject responses occur.
don't know if it's platform-specific, but i'm running on a PowerBook G4 with an
ATI Mobility Radeon
9700 (128MB) on OS X 10.3... haven't tested on PC yet.
anyway, i'm going to play around with this more, including changing priority
scheduling and renicing (if necessary)
cheers,
-=gabe
>>> mspacek@xxxxxxxxxxxxxxx 25/01/05 11:05 PM >>>
Not sure what you mean. As far as I know, everything runs in a single
thread, so your loop to load the images won't finish until all the
images are loaded as texture objects. Only then will it go on to create
the viewport, and only then will it execute your custom presentation
loop. You shouldn't be experiencing any delay due to loading of images
in the presentation loop.
> ########################################################
> #
> #!usr/bin/pythonw
> # based on Andrew Straw's demo code
> # http://www.freelists.org/archives/visionegg/11-2002/msg00001.html
>
> from VisionEgg import *
> start_default_logging(); watch_exceptions()
>
> from VisionEgg.Core import *
> from VisionEgg.FlowControl import Presentation, FunctionController
> from VisionEgg.Textures import *
> from pygame.time import *
> import OpenGL.GL as gl
>
> import os
>
> photoX = ("01.bmp",
> "02.bmp",
> "03.bmp",
> "04.bmp",
> "05.bmp",
> "06.bmp",
> "07.bmp",
> "08.bmp",
> "09.bmp",
> "10.bmp")
>
> pwd = os.getcwd()
>
> #duration_per_image = 0.1 # seconds
> num_images = len(photoX)
>
> screen = get_default_screen()
>
> # Create list of stimuli
> preloaded_stimulus_list = [] # empty at first
>
> for i in range(num_images):
> # Read the texture file
> texture_name = os.path.join(pwd, 'data', photoX[i])
> texture = TextureFromFile(texture_name)
>
> # Load the texture to OpenGL, prepare for display
> stimulus = TextureStimulus(texture = texture,
> size = texture.size,
> # texture_min_filter=gl.GL_LINEAR
> )
> # Add to list of stimuli
> preloaded_stimulus_list.append( stimulus )
>
> ###############################################
> #
> # <procedural_version>
>
> viewport = Viewport(screen=screen)
>
> frame_timer = FrameTimer()
>
> num_loops = 100
>
> # show images
> for trialcounter in range(num_loops):
> for image_counter in range(num_images):
> viewport.parameters.stimuli =
> [preloaded_stimulus_list[image_counter]]
> screen.clear()
> viewport.draw()
> swap_buffers()
> frame_timer.tick()
>
> #
> # </procedural_version>
> #
> ###############################################
>
> frame_timer.print_histogram()
Cheers,
Martin Spacek
PhD student, Swindale lab
Graduate Program in Neuroscience
Dept. of Ophthalmology and Visual Sciences
University of British Columbia, Vancouver, BC, Canada
+1-604-875-4555 ext. 66282
mspacek@xxxxxxxxxxxxxxx | http://swindale.ecc.ubc.ca
======================================
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
- Follow-Ups:
- [visionegg] Re: simple RSVP scripts
- From: Martin Spacek
Other related posts:
- » [visionegg] simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- » [visionegg] Re: simple RSVP scripts
- [visionegg] Re: simple RSVP scripts
- From: Martin Spacek