[visionegg] Re: Advice on using Presentation for sequential stimulus.
- From: Andrew Straw <astraw@xxxxxxxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Mon, 22 Aug 2005 09:25:24 -0700
Dear Simeon,
What you describe is one, fairly "Vision Egg-y" way of using multiple
stimuli sequentially. There are various alterations on the theme you
could perform, such as re-using the same Viewport and Presentation
classes. One way is to change the contents of
Viewport.parameters.stimuli, Presentation.parameters.go_duration,
Presentation.parameters.viewports between "epochs" -- you would still do
multiple go loops per trial. Another way is to define Controllers for
the "on" parameter of your stimuli that only turn them on at the
appropriate time, and your keyboard response handler would also ignore
keypresses until the appropriate time. This technique could be done such
that only a single go loop happened per trial. But I don't think either
of these would be a great simplification to what you're doing -- they're
simply alternative suggestions.
For such experiments I've done myself, I have ignored the whole
VisionEgg.FlowControl module, which is the other possibility I can think
of presently.
This is an area where improvements could be made, I think. I'm somewhat
inspired by the "trial strings" of PsyScript/RSVP [1]. Although I've
never worked with it, it seems to describe the time-course of entire
experiments in strings of a few characters. So, some kind of simplified
experiment description is an interesting possibility. I assume such
simplification would come at the expense of assumptions about what
experiments people want to do, but perhaps those assumptions are met
enough of the time to justify implementing some system like this.
[1]: A description of the "do trial" command in PsyScript:
http://www.maccs.mq.edu.au/~tim/psyscript/docs/trials/intro_to_do_trial.html
Simeon Fitch wrote:
> In the experiment I'm composing the subject is shown a sequence of
> "Stimulus" instances, each for a specific duration, followed by a screen
> querying a response.
>
> I have code that seems to work fine, but I have a nagging suspicion that
> I may not be properly using the Vision Egg API, or overlooking a more
> straight-forward way of achieving the same thing. I'd appreciate any
> recommendations or tips anyone might have.
>
> Here's the basic structure:
> for t in numberOfTrials:
> Display fixation spot for 1 second
> Display a mask pattern for 3 frames @ 0.05s/frame
> Display a dot lattice for 0.3s
> Display response options and wait for subjeect to press a key
>
> I've structured my code such that each step is managed by a separate
> "Core.Stimulus" subclass, which in turn has its own viewport and
> presentation. The root of my question is whether I can be using the
> FlowControl classes or something else to do the following in a more
> elegant manner:
>
> fixation = FixationSpot(position=center)
> fixationView = Viewport(screen=screen, size=screen.size, stimuli=[fixation])
> fixationPres = Presentation(go_duration=(1, 'seconds'),
> viewports=[fixationView])
>
> lattice = DotLattice(position=center, dotSize=5)
> latticeView = Viewport(screen=screen, size=screen.size, stimuli=[lattice])
> latticePres = Presentation(go_duration=(0.5, 'seconds'),
> viewports=[latticeView])
>
> mask = DotLatticeMask(lattice)
> maskView = Viewport(screen=screen, size=screen.size, stimuli=[mask])
> maskPres = Presentation(go_duration=(3, 'frames'),
> viewports=[maskView])
>
> callbacks = [
> (KEYDOWN, lambda event: response.keydown(event, responsePres)),
> ]
>
> response = ResponseVectors(position=center, lattice=lattice)
> responseView = Viewport(screen=screen, size=screen.size, stimuli=[response])
> responsePres = Presentation(go_duration=('forever',),
> viewports=[responseView],
> handle_event_callbacks=callbacks)
>
> # Main experimentation loop
> for trial in conditions:
> lattice.setTrial(trial)
>
> fixationPres.go()
> maskPres.go()
> latticePres.go()
> responsePres.go()
>
> dataFileWriter.writerow(trial.values())
>
>
> Basically, in contrast to the multiStim.py demo file which shows
> multiple stimuli at the same time, I want to know how to properly show
> multiple stimuli sequentially.
>
> Thanks,
>
> Simeon
>
> --
> Simeon H.K. Fitch, Owner
> Mustard Seed Software
> http://www.mseedsoft.com/
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- Follow-Ups:
- References:
- [visionegg] Advice on using Presentation for sequential stimulus.
- From: Simeon Fitch
Other related posts:
- » [visionegg] Advice on using Presentation for sequential stimulus.
- » [visionegg] Re: Advice on using Presentation for sequential stimulus.
- [visionegg] Advice on using Presentation for sequential stimulus.
- From: Simeon Fitch