Howdy, Stranger!

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

Supported by

[solved] Gabor patch parameters

edited October 2012 in Miscellaneous

Hi,

I have some trouble with the gabor patch parameters in the OpenSesame function. I wanted to know how exactly spatial frequency is defined and how you can define contrast of the gabor gratings in OpenSesame using this function.

From what I understood the gabor gratings’ spatial frequency in contemporary literature is mostly defined in cycles per degree (that is visual angle). In the OpenSesame function however, it is defined in cycles per pixel, creating different gratings when filling in values defined as in cycles per degree. So my question is how do you come from the one value to the other?

The other parameter, contrast, is not entirely clear to me either. It is not definable in the function or did I overlook something? Or is it solely based on the difference between the two RGB values.



Hope you guys can help me out! Id really appreciate it!

Comments

  • edited October 2012

    Right, OpenSesame uses computer units, because these are unambiguous. But, of course, given knowledge of your set-up, you can translate these into other units.

    I wanted to know how exactly spatial frequency is defined and how you can define contrast of the gabor gratings in OpenSesame using this function. From what I understood the gabor gratings’ spatial frequency in contemporary literature is mostly defined in cycles per degree (that is visual angle). In the OpenSesame function however, it is defined in cycles per pixel, creating different gratings when filling in values defined as in cycles per degree. So my question is how do you come from the one value to the other?

    A typical monitor has about 30 to 40 pixels per degree (you can determine this from the viewing distance, display size, and display resolution). This means that 1 visual degree spans 30 to 40 pixels on the monitor. Therefore, if you want to have a spatial frequency of 1 cycle/°, you need to do something like the following:

    sfCyclesDeg = 1 # Desired spatial frequency in cycles per degree
    pixelsPerDegree = 30 # Depends on your set-up
    sfCyclesPx = sfCyclesDeg / pixelsPerDegree # Parameter for canvas.gabor()

    So basically, you just divide by the number of pixels per degree. Does that make sense?

    The other parameter, contrast, is not entirely clear to me either. It is not definable in the function or did I overlook something? Or is it solely based on the difference between the two RGB values.

    The latter: The Gabor is just an oscillation between the two colours (in the PsychoPy back-end it works a bit differently, but comes down to the same thing). So if you oscillate between 'white' and 'black' this would be a contrast of 100%, because that's the most contrast your monitor can give you. Note that saying that the contrast is 100% doesn't mean anything in an absolute sense. If you want to be more specific, you need to measure the luminosity of various colours on your monitor, ideally perform gamma-correction, etc. If you want to do that, you might want to look into PsychoPy's functionality. (I'm not saying it's necessary, or even recommending that you do this. But simply that these are things that you can do.)

    Cheers!

  • edited 6:39PM

    Ah! That makes sense!

    Thanks!

  • edited 6:39PM

    I'm confused. How do I factor in where so specify the size. I know my screen resolution, my screen size, my viewing distance, etc. And I need a 3cpd pattern, but the pattern changes depending on the size. ???

  • edited 6:39PM

    The way to convert from degrees of visual angle to pixels and vice versa is described in detail here:

    If this information doesn't answer your question, could you be a bit more specific and describe what you want to do, what you've done so far, and why you don't get the expected results?

    Cheers,
    Sebastiaan

  • edited March 2015

    Thanks for your reply. I understand that ppd is 180.pi*d*r where r is the resolution of the screen, d is the viewing distance, etc. And that I need to use cpd/ppd to get the parameter. But I don't understand where it asks for the size?

    I am looking to create 3 sinusoidal grating (each at 180 and 90), black bars on a white background, each will be viewed from 40 cm on an iPad screen (needs to be a large circle in the middle of the screen (sharp edge)) and the three cpd visual angle I need are:

    0.3
    2.3
    9.4

    Can you tell me what I need to put in?

  • edited 6:39PM

    But I don't understand where it asks for the size?

    I'm guessing that 'it' refers to the Online Gabor patch generator?

    A gabor patch doesn't have a size--it's infinite. So instead you specify the standard deviation, where larger standard deviations are bigger. Because the image is, in the end, a finite-size bitmap, you do specify a size, but that's just the 'box' around the Gabor patch so to say.

    Other than that it seems that you might be confusing the size of a Gabor with its spatial frequency. Only the spatial frequency is (or can be) specified in cycles/degree (cpd).

    Does that clear things up?

    Cheers,
    Sebastiaan

  • edited 6:39PM

    Thanks for your reply. I'm so confused. :( I do mean the Online Gabor patch generator. The frequency seems to change when I specify a different size box.

  • edited 6:39PM

    Can I email anyone to show you what I'm trying to do :)

  • edited 6:39PM

    The frequency seems to change when I specify a different size box.

    It doesn't. :P

    Can I email anyone to show you what I'm trying to do

    It's preferable to keep all questions on the forum, so other people can benefit as well.

  • edited 6:39PM

    I've no idea what I'm really doing lol What is standard deviation? Can you comment on what parameters you think I need based on my requires above? I'm trying to reproduce something called a pattern glare test. Sorry for being so stupid! I'm so out my depth here! Thanks for trying to help.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games