Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Cannot change Gabor patch size

Hello opensesame wizards,

I'm trying to create Gabor patches with a certain size. However, for some strange reason the value I add to the 'size=' variable doesn't seem to have any effect. For example, the code:

pre_canvas.gabor(-100, 0, angle, .025, size=200)

pre_canvas.gabor(100, 0, angle, .025, size=400) me two identical Gabor patches. No matter what I do, the size remains the same.

I'm using a PsychoPy backend, and running OpenSesame 3.2.5 (I tried it on a different version, and got the same problem unfortunately).

Any clues?

Many thanks in advance,

Jasper de Waard


  • Hi Jasper,

    Not sure why (maybe intentional, maybe a bug), but the size keyword doesn't do anything if you use a gaussian envelope on your grating. To manipulate the size, you have to instead change the "stdev" keyword. For Gaussian Gabors, size is defined as 6* the stdev. see here (function: _mask):


    @sebastiaan, if this intentional, we should update the documentation; if not, we should fix it.

  • Hi Eduard,

    Thanks, that's very enlightening!

    Cheers, Jasper

  • Hi guys,

    Thanks for pointing this out. The meaning of the size keyword is indeed a bit confusing. Strictly speaking, the size of a gabor patch is infinite, and the stdev keyword just indicates how quickly the patch fades away, so to say. But practically speaking, there's of course an image with a finite size, and that's what the size argument refers to, except that for the psycho backend the size is chosen so large that the patch always looks infinite. (I don't recall why, to be honest.)

    Long story short: I'll update the docs to clarify this!



Sign In or Register to comment.