[visionegg] image_sequence.py

Hi Andrew,

When trying to run the new demo: image_sequence.py I get the following
message in the VisionEgg log file:
***********************************************
Traceback (most recent call last):
  File "C:\Python22\VisionEgg\demo\image_sequence.py", line 47, in ?
    p.add_controller(None,None,FunctionController(during_go_func=put_image))
  File "C:\Python22\Lib\site-packages\VisionEgg\Core.py", line 1998, in
__init__
    kw['return_type'] = type(apply(during_go_func,(),call_args))
  File "C:\Python22\VisionEgg\demo\image_sequence.py", line 46, in put_image
    texture_buffer.put_sub_image_pil( image_list[i] ) # "blit" image
AttributeError: TextureBuffer instance has no attribute 'put_sub_image_pil'
**************************************************
The TextureBuffer has a method called: put_sub_image, so I think this should
be changed. I changed it and it still will not work, :-)

cheers, Joyca!

----- Original Message -----
From: "Christoph Lehmann" <christoph.lehmann@xxxxxxxxxxxx>
To: <visionegg@xxxxxxxxxxxxx>
Sent: Tuesday, December 03, 2002 10:17 PM
Subject: [visionegg] sorry, here the attachment (.txt)


> christoph
>
> --
> ========================================
> Christoph Lehmann
> University of Berne
> christoph.lehmann@xxxxxxxxxxxx
>
> --------------------------------------------------
> This mail sent through IMP at http://mail.unibe.ch
>
>
> -- Attached file included as plaintext by Ecartis --
> -- File: ve_mail.txt
>
> Hi Andrew
>
> I successfully ran the code you wrote together with Joyca (running it with
my Redhat, while Joyca runs it in Windows: I LOVE platform-independence):
>
> the code
> -------------
> #!/usr/bin/env python
> """Load a picture from a file."""
>
> from random import *
> import os
> from VisionEgg import *
> from VisionEgg.Core import *
> from VisionEgg.Textures import *
>
> path = "/home/christoph/VisionEgg/my_ve_projects/load_picture/data/" #the
path the images are in
>
> photo = []
> photoX = []
>
> # present them in random order
> for filename in os.listdir(path):
> Â Â Â photo.append(filename)
> length = len(photo)
> for i in range(0, length):
> Â Â Â ran = randint(0, len(photo)-1)
> Â Â Â file = photo[ran]
> Â Â Â photoX.append(file)
> Â Â Â photo.pop(ran)
>
> os.chdir(path)
>
> screen = get_default_screen()
>
> duration_per_image = 0.5 # seconds
> num_images = len(photoX)
>
> # Create list of stimuli
> preloaded_stimulus_list = [] # empty at first
> for i in range(num_images):
> Â Â Â # Read the texture file
> Â Â Â texture = TextureFromFile(photoX[i])
>
> Â Â Â # Load the texture to OpenGL, prepare for display
> Â Â Â stimulus = TextureStimulus(texture = texture,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â size =
(texture.orig.size[0]*2,texture.orig.size[1]*2),
> Â Â Â Â Â Â shrink_texture_ok=1)
> Â Â Â #texture.orig.size
>
> Â Â Â # Add to list of stimuli
> Â Â Â preloaded_stimulus_list.append( stimulus )
>
> def image_selector( t ):
> Â Â Â i = int(t/duration_per_image)
> Â Â Â return [ preloaded_stimulus_list[i] ]
> viewport = Viewport(screen=screen)
> p = Presentation(go_duration=(duration_per_image *
> num_images,'seconds'),viewports=[viewport])
> p.add_controller(viewport,'stimuli',
> FunctionController(during_go_func=image_selector) )
> p.go()
>
>
>
>
> -------------
> running the code with max priority as su I got (after correcting the
Core.py with your fix):
>
>
> VisionEgg info (2002-12-03 21:43:14): Requesting window 640 x 480 24 bpp
(8 8 8 0 RGBA).
> VisionEgg info (2002-12-03 21:43:14): OpenGL 1.2 Mesa 3.4.2, Mesa DRI
Radeon 20010402 AGP 1x
> Â Â Â x86/MMX/SSE, VA Linux Systems, Inc.
> VisionEgg info (2002-12-03 21:43:14): Video system reports 32 bpp (8 8 8 8
RGBA).
> VisionEgg info (2002-12-03 21:43:14): Setting maximum priority for POSIX
platform.
> Traceback (most recent call last):
> Â File "load_picture.py", line 36, in ?
> Â File "/usr/lib/python2.2/site-packages/VisionEgg/Textures.py", line 201,
in __init__
> Â Â Â self.orig = Image.open(file)
> Â File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 975, in open
> Â Â Â prefix = fp.read(16)
> IOError: [Errno 21] Is a directory
>
> ----------
> when running as normal user (not su) I get:
>
> VisionEgg info (2002-12-03 21:45:18): load_picture.py started.
> VisionEgg info (2002-12-03 21:45:23): Requesting window 640 x 480 24 bpp
(8 8 8 0 RGBA).
> VisionEgg info (2002-12-03 21:45:23): OpenGL 1.2 Mesa 3.4.2, Mesa DRI
Radeon 20010402 AGP 1x
> Â Â Â x86/MMX/SSE, VA Linux Systems, Inc.
> VisionEgg info (2002-12-03 21:45:23): Video system reports 32 bpp (8 8 8 8
RGBA).
> VisionEgg info (2002-12-03 21:45:23): Setting maximum priority for POSIX
platform.
> Traceback (most recent call last):
> Â File "load_picture.py", line 27, in ?
> Â File "/usr/lib/python2.2/site-packages/VisionEgg/Core.py", line 444, in
get_default_screen
> Â Â Â return Screen.create_default()
> Â File "/usr/lib/python2.2/site-packages/VisionEgg/Core.py", line 413, in
create_default
> Â Â Â hide_mouse=VisionEgg.config.VISIONEGG_HIDE_MOUSE)
> Â File "/usr/lib/python2.2/site-packages/VisionEgg/Core.py", line 324, in
__init__
> Â Â Â PlatformDependent.set_realtime()
> RuntimeError: sched_setscheduler returned EPERM (Permission error. Do you
have permission; are you superuser?)
> ----
>
> that's it. hope the traceback helps you.
>
> by the way: how to tell VE to show the jpgs centered on the screen (well I
can look in the ref, but if you anyway read my mail :) )
>
> the next thing I want to do is to get the mouse response of the user for
each pic shown and save it to a file ... no idea yet, how to do, but this
will be my next endeavor :).. again here: if this will be very easy and you
just have another minute to drop a line, thanks. otherwise I will experiment
on my own :)
>
> what about making a pool with all experiments, designed by people using
your great VisionEgg?
>
> salutations
> christoph
>
>
> On Mon, 2002-12-02 at 23:13, Andrew Straw wrote:
> >
> > Hi Christoph,
> >
> > I've just found a bug in "check_gl_assumptions()" of VisionEgg.Core
> > which I think may be part of the problem. (Could you please include a
> > traceback next time?) I can't access CVS at the moment to check in my
> > fix, but if you change "check_gl_assumptions()"  your Core.py to the
> > following, it should solve that problem.  I will check this into CVS as
> > soon as I can.
> >
> > ******************************
> > def check_gl_assumptions():
> >      """Called by Screen instance. Requires OpenGL context to be
> > created."""
> >      for gl_variable,required_value,failure_callback in gl_assumptions:
> >          # Code required for each variable to be checked
> >          if string.upper(gl_variable) == "GL_VENDOR":
> >              value =
> > string.split(string.lower(gl.glGetString(gl.GL_VENDOR)))[0]
> >              if value != required_value:
> >                  failure_callback()
> >          elif string.upper(gl_variable) == "GL_VERSION":
> >              value_str = string.split(gl.glGetString(gl.GL_VERSION))[0]
> >              value_ints = map(int,string.split(value_str,'.'))
> >              value = float( str(value_ints[0]) + "." +
> > string.join(map(str,value_ints[1:]),''))
> >              if value < required_value:
> >                  failure_callback()
> > ******************************
> >
> > Cheers!
> > Andrew
> >
> > On Monday, December 2, 2002, at 10:10  PM, Christoph Lehmann wrote:
> >
> > >
> > > running VE as root with max priority I get:
> > >
> > > execption: "failure_string" not defined
> > >
> > > ?
> > > thanks
> > >
> > > christoph
> > >
> > > --
> > > Christoph Lehmann
> > > Department of Psychiatric Neurophysiology
> > > University Hospital of Clinical Psychiatry
> > > Waldau
> > > CH-3000 Bern 60
> > > Switzerland
> > >
> > > Phone:  ++41 31 930 93 83
> > > Fax:    ++41 31 930 96 61
> > > Email:  lehmann@xxxxxxxxxxxx
> > > Web:
> > >
> > > ======================================
> > > 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
> --
> Christoph Lehmann
> Department of Psychiatric Neurophysiology
> University Hospital of Clinical Psychiatry
> Waldau
> CH-3000 Bern 60
> Switzerland
>
> Phone:Â ++41 31 930 93 83
> Fax:Â Â Â ++41 31 930 96 61
> Email:Â lehmann@xxxxxxxxxxxx
> Web:Â Â Â
>
> ======================================
> 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: