[visionegg] Re: map singratings on cylinder

  • From: Andrew Straw <astraw@xxxxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Fri, 21 Dec 2007 12:31:06 +0100

Hi Kaspar,

OK, my apologies! I think the problem is that the version of VE you're using doesn't recognize the new numpy scalar types (this has been fixed in the SVN version of VE). Anyhow, I think you should be able to work around the issue by converting values to the Python int type:

Index: /trunk/visionegg/demo/project_linear_grating_on_cylinder.py
===================================================================
--- /trunk/visionegg/demo/project_linear_grating_on_cylinder.py (revision 1408)
+++ /trunk/visionegg/demo/project_linear_grating_on_cylinder.py (revision 1409)
@@ -91,6 +91,6 @@

    # Now setup the projection and the viewport.
-    ll = lowerlefts[i+1]
-    width = lowerlefts[i]-ll
+    ll = int(lowerlefts[i+1])
+    width = int(lowerlefts[i]-ll)
    projection = SimplePerspectiveProjection(fov_x=fov_x,
                                             aspect_ratio=aspect_ratio)



Kaspar Müller wrote:
Hi Andrew

Thanks a lot for your quick and great support. The sreenshot looks exactly the way I would like to have my stimulus. Unfortunately, the script doesn't work for me, I get the following error message:

File "/project_linear_grating_on_cylinder.py", line 103, in -toplevel-
    size=(width,height))
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/VisionEgg/Core.py", line 1305, in __init__
    VisionEgg.ClassWithParameters.__init__(self,**kw)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/VisionEgg/__init__.py", line 349, in __init__ raise TypeError("Parameter '%s' value %s is type %s (not type %s) in %s"%(parameter_name,value_str,type(value),tipe,self)) TypeError: Parameter 'position' value (760.0, 0) is type <type 'tuple'> (not type Sequence2 of Real) in <VisionEgg.Core.Viewport object at 0x2c90a30>

Do you have an idea why it doesn't work for me? I already tried to install python 2.5 and all the packages, including reinstall of visionegg, but that didn't help.

Thanks again for your help!

Kaspar



On 21.12.2007, at 02:13, Andrew Straw wrote:

Kaspar Müller wrote:
I would like to project singratings on a round screen, therefore I need to correct the distortion in such a way that the grating-bars have the same width everywhere.

I just added a demo that, as far as I understand what you'd like to do, should do it:

http://visionegg.org/trac/browser/trunk/visionegg/demo/project_linear_grating_on_cylinder.py?rev=1408

I'm also attaching a screenshot.

-Andrew
<project_linear_grating_on_cylinder.png>

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


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

Other related posts: