[visionegg] Re: Who's using the Presentation class?

  • From: Eamon Caddigan <ecaddiga@xxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Wed, 25 Jan 2006 22:26:36 -0600

Thanks Simeon,

It's great to finally see a full-blown experiment.

I've refined my design a bit and am becoming happy with it. I've created a subclass of VisionEgg.Core.Stimulus, TrialStimulus, to do most of the actual work. A function controller uses between_go_func to handle everything between trials. While actually running a trial, an instance of TrialStimulus is attached to the viewport and takes care of the rest, its draw() method presenting the appropriate stimuli based on the time and user input.

I'm also using pylink to interface with our EyeLink II, and things would be a lot more straightforward if I knew how to push the tracker's button events onto pygame's event queue. Polling the eyetracker with another FunctionController works, but it's kinda kludgey.

A couple questions: does anybody know whether it's possible to create a FunctionController that *only* defines between_go_func? Also, it there a preferred way to break out of a go loop and return to run_forever besides zeroing-out the go_duration?

Thanks again,
Eamon


On Jan 23, 2006, at 8:28 AM, Simeon Fitch wrote:

Eamon,

The Kubovy Lab @ UVa is doing what you describe (if I understand you
correctly) by using multiple presentation/viewport instances for each
component of each trial (all sharing the same screen). For example, in
one experiment we present:

1) A fixation spot
2) A mask
3) The stimulus
4) A response screen

Each of these is a stimulus tied to a Presentation and Viewport. A
"show()" convenience method has been added to each class to reset the
Presentation object and call its "go()" method.

The inner "loop" of this experiment looks something like this:
----------------------------
# Define the trials
conditions = setupTrialData(sequenceFileName)
breakNotice = Instructions(screen, "Take a moment to rest.")
for i, trial in enumerate(conditions):
    lattice.setTrial(trial)
    fixationPres.go()
    mask.show()
    lattice.show()
    response.show()
    logger.log(trial)

    if ((i+1) % session.breakInterval) == 0:
        breakNotice.show()
-------------------------------
The power of the Presentation object becomes apparent when you have
Stimulus parameters which change over time (e.g. a function of 't') or
between trials.

You are very welcome to download our source code and play with it
however you like. Instructions are available here:

http://kubovylab.psyc.virginia.edu/index.php/ How_to_Get_The_Source_Code

For a quick sense on how we are using VisionEgg, some example screen
shots are available here:

http://kubovylab.psyc.virginia.edu/index.php/Main_Page

Along with instructions on how to get it running, if interested:

http://kubovylab.psyc.virginia.edu/index.php/ Perception_Toolkit_Development_Environment_Setup

Good luck!

Simeon Fitch

--
Simeon H.K. Fitch, Owner
Mustard Seed Software
Charlottesville, VA  22901





On 1/23/06, Eamon Caddigan <ecaddiga@xxxxxxxx> wrote:
Hi all,

Our lab is getting ready to run its first experiments that make use
of Vision Egg. They work well enough, but I've been unable to make
use of the Presentation class for my main loop without the result
feeling uncomfortably kludgey.

I'm happy to write my own main loop. However, since the code I write
now may be used by other people in the lab as we continue
transitioning to Vision Egg, I want it to fall in line with the
current best practices.

I'd probably feel better about this if the examples distributed with
Vision Egg included a multi-trial experiment.

Thanks,
Eamon Caddigan

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

Other related posts: