[visionegg] Re: fixation viewport
- From: "Gabriel Nevarez" <nevarezg@xxxxxxxxxxxxx>
- To: <visionegg@xxxxxxxxxxxxx>
- Date: Sun, 20 Mar 2005 19:31:39 +0000
Hi Darren,
Actually, I rarely use the presentation object for my studies (instead,
creating update-loops where appropriate. This is more viable for
straightforward studies (such as the Rapid Serial Visual Presentation studies
that we're doing in our lab right now). I assume it works fine as you
suggested, but I haven't tried it.
Regarding the default screen.size, there is a current thread in the SDL lists
indicating that there is no way for SDL to get current screen properties (such
as resolution, pixel-depth, etc), therefore, no way to do this in pygame,
therefore visionegg. You have to explicitly state screen resolution (e.g., the
initial dialog box when VisionEgg starts up), then test to make sure that SDL
is not emulating when the hardware does not support the specified screen
resolution/bit depth.
I'm sure you could change the __init__ code to do what you suggest, at the cost
of portability between yours and other standard versions of VisionEgg. Don't
know if subclassing would work. Still, it's not that much of a hassle to leave
as is.
cheers,
-=Gabriel Nevarez
Research Programmer
Psychology Department
Cardiff University
http://www.cf.ac.uk/psych
>>> darrenleeweber@xxxxxxxxx 18/03/05 7:55 PM >>>
Thanks for the example code. It is a minor revelation to see how this works:
viewport = Viewport( screen = screen, stimuli = [stimulus, fixation] )
so that we can have a constant fixation point while the stimulus
texture can be updated in a during_go_func. In this way, the one
viewport is presenting multiple stimuli simultaneously and the
attributes/parameters of the stimuli are updated dynamically. I was
pleased to see that the fixation point was not obscured by the
stimulus (texture in this case), that is really nice. So, I guess it
is not necessary to have multiple viewports. I suppose multiple
viewports could be used with multiple presentations to interleave
stimulus and fixation stimuli, whereby the fixation presentation could
be about 1 sec and the during_go_func for a stimulus presentation
could call the fixation presentation before updating textures of the
stimulus object.
BTW, it seems that when FixationSpot is initialized, as with most
stimuli, the init function assumes the default screen size. I wonder
if there is a way for these init functions to get the current screen
size, if it exists. Without that, we OFTEN have this kind of
construct
stimulus = <anyStimClass>( position = (screen.size[0]/2, screen.size[1]/2) )
On Fri, 18 Mar 2005 13:47:12 -0500, Kevin MacKenzie <kjmacken@xxxxxxxx> wrote:
> Darren Weber wrote:
>
> >Yes, that would be nice, but how about answering my question?
> >
> Perhaps patience is a virtue you need to learn. I'm sorry, but hounding
> a list for answers to programming questions when you haven't (or at
> least shown no evidence of) examined the available demo code is rude,
> and I don't think the person who replied to your initial post should be
> lambasted for offering that suggestion.
>
> Now, look at the following code snippet (which will not work on its own,
> as I have removed irrelevant code for your problem).
>
> I have created a stimulus (in this case it is referred to by texture),
> and a fixation class.
>
> I create 2 viewports [f and p]. f is the viewport with only the
> fixation and p is with fixation and the stimulus. and present them in
> order using
>
> f.go
> p.go
>
> Add this concept to your existing code base and play with it.
>
> > Do I
> >have to search all over the python world to find this too?
> >
> Showing the list that you have initially attempted to solve your problem
> before asking seemingly random questions is not a bad starting point.
> Searching the demo direectory of the VisionEgg is a good starting point,
> and not as large as the entire python world.
>
> The MatLab news list for example wouldn't even respond to your initial
> posts as they are extremely harsh on people who are seemingly trying to
> get their code written in piecemeal fashion by asking questions after
> question.
>
> >variable/parameter to set and then just set it. However, it was not
> >solved in 5 minutes and I'm not sure what the next step is
> >
> Submit the code that you have then, and perhaps responses will come better.
>
> I hope that the code I have attached works out, good luck with it.
>
> Kevin
>
> >On Fri, 18 Mar 2005 17:58:27 +0000, Gabriel Nevarez
> ><nevarezg@xxxxxxxxxxxxx> wrote:
> >
> >
> >>Hi, Andrew and all,
> >>
> >>It might be a good idea to add a section to the VisionEgg web site with
> >>actual implemented studies (contributed by volunteers), in addition to the
> >>standard demos. This would aid with some of these questions, in addition
> >>to lowering the bar for newbies wanting to try out VisionEgg. At the very
> >>least, the addition of code templates for common psychophysical
> >>study-types, such as RSVP or multiple-object tracking, might be useful.
> >>
> >>As a research programmer, I have the luxury of dedicating myself to
> >>scowering the related python newgroups and lists and trying things out on
> >>my own, but many of my psychologist colleagues don't have either the time
> >>or programming knowledge to do this... in effect, the very reason tools
> >>like VisionEgg exist (to make psychophysical studies easier to implement!)
> >>
> >>I know I've had many of these same questions when I first started coding in
> >>python/VisionEgg, and I learned as everybody else does... by example.
> >>
> >>cheers,
> >>-=Gabriel Nevarez
> >>Research Programmer
> >>Psychology Department
> >>Cardiff University
> >>http://www.cf.ac.uk/psych
> >>
> >>
> >>
> >>>>>darrenleeweber@xxxxxxxxx 18/03/05 5:42 PM >>>
> >>>>>
> >>>>>
> >>Hi,
> >>
> >>the construct
> >>
> >>screen = get_default_screen()
> >>
> >>creates a gray screen. The reference documentation for the screen
> >>class indicates that it has a bgcolor parameter. I've tried a number
> >>of ways to set it, without success. How do we set this parameter? I
> >>want, bgcolor = (0.0, 0.0, 0.0), rather than the default gray.
> >>
> >>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
> >>
> >>
> >>
> >======================================
> >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
=====================================The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
Other related posts: