[open] Gabor grating contrast
Hi,
for my experiment I want to change the contrast of the grating. I wrote a script that accounts for that by interpolating the measured luminance of the screen on a RGB scale. Based on these data points I assess the high and low luminance values and their according RGB values and define them as the two colors for the grating (versions of white/black resp. gray). Works fine for MATLAB.
My problem is, that I just stumbled across the documentation of the gabor function and saw that this might not work since I have to use the Psycho backend. That is, because Psycho backend does not allow changing the background and the second color. Does that mean that the second color would always be black and I would only be able to change the white color in order to manipulate the contrast? Or is only a change in an actual color (like red) not possible but within the range of black and white (so as long as all three RGB values stay the same) it is? I wanted to verify whether that's the case before I start transferring the script to python/opensesame.
If it is not possible to change the second color whatsoever, is there another way to change the contrast of a gabor patch in the Psycho backend?
Thanks!
Michif
Comments
Hi Michel,
If you use OpenSesame's built-in Gabor patches, or the
openexp.canvas.gabor()function, you can only get maximum contrast Gabor patches using the psycho back-end. However, by using PsychoPy directly you can create any kind of stimuli you like.Essentially, PsychoPy works with a single color and a contrast (whereas for example the online Gabor patch generator works with two colors). You can go from color-contrast to two colors like this:
The color is usually a value between 1 (white) and -1 (black), but see my post for other examples. So if you set
colorto 1 andcontrastto .05, you get a low contrast Gabor patch:For more information, see my recent post or the PsychoPy documentation:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!