Gabor Patch Contrast Levels

Hello, I am using the CreateProceduralGabor function through Psychtoolbox and I am having a bit of trouble understanding how the contrast function works. I understand that a change in the contrastPreMultiplier part will make the Gabor I draw have either more or less contrast, but I do not know the mathematical method it uses to do this. My research depends on changing the contrast slowly, but I don't know how it is changing behind the scenes.


Can anyone help me better understand how the contrast of the Gabor is changed by changing the ContrastPreMultiplier?


Thank you,

Have you read the help text of the function? And the references and examples to which it points, e.g., ProceduralGaborDemo.m and ProceduralGarboriumDemo.m?

If so, please explain what is unclear from those descriptions.
-mario



---In PSYCHTOOLBOX@yahoogroups.com, <awadadelahmad@...> wrote :

Hello, I am using the CreateProceduralGabor function through Psychtoolbox and I am having a bit of trouble understanding how the contrast function works. I understand that a change in the contrastPreMultiplier part will make the Gabor I draw have either more or less contrast, but I do not know the mathematical method it uses to do this. My research depends on changing the contrast slowly, but I don't know how it is changing behind the scenes.


Can anyone help me better understand how the contrast of the Gabor is changed by changing the ContrastPreMultiplier?


Thank you,

Thank you for responding. Yes I have read the text function, but there are two main things I do not fully understand. The first is what the value of I is. From the equation (Imax-Imin)/(Imax+Imin), I do not know what I is. 

The other question I have is regarding the 'contrast' from the 'Screen('DrawTexture'...) part is related to the PreContrast Multiplier. It is described as an amplitude of the Gabor in Intensity Units that is then multiplied by to the Gabor equation before being converted to a color value. However, when I change either the 'contrast' value or the 'PreContrastMultiplier' value in my code, the same thing happens.

Any more insight on how the two are related to each other and what the intensity unit is would be greatly appreciated. 

Thank you!
XXX---In PSYCHTOOLBOX@yahoogroups.com, <awadadelahmad@...> wrote :

Thank you for responding. Yes I have read the text function, but there are two main things I do not fully understand. The first is what the value of I is. From the equation (Imax-Imin)/(Imax+Imin), I do not know what I is. 

-> Imin is the minimum intensity of the gabor patch (e.g., the grayscale value of the darkest pixel in the gabor), Imax is the maximum intensity pixel. Assuming your display is properly gamma calibrated/corrected to behave linear then that equation defines Michelson contrast.

The other question I have is regarding the 'contrast' from the 'Screen('DrawTexture'...) part is related to the PreContrast Multiplier. It is described as an amplitude of the Gabor in Intensity Units that is then multiplied by to the Gabor equation before being converted to a color value. However, when I change either the 'contrast' value or the 'PreContrastMultiplier' value in my code, the same thing happens.

-> Yes, because both 'contrast' and 'PreContrastMultiplier' are just multiplicative factors that control amplitude. 'contrast' is what you are meant to control/vary in your script, as it can be changed individually for each drawn gabor patch. 'PreContrastMultiplier' is just a global constant you'd set once, just like the 'disableNorm' flag, to select how the gabors are generally rendered. The reason for this is that as it turned out there isn't one precisely set definition of a Gabor across different fields, beyond "a sine-wave modulated by some exponential function". Image processing text books define it a bit different, with or without certain normalization terms e.g. Vision scientists seems to use it differently depending on the field. That's why we had to add those flags and constants to tweak it for different needs. ProceduralGaborDemo.m contains a reference implementation in Matlab of what would be used if you leave all optional parameters at their defaults. The help text also references forum message 9174 for more info.

Any more insight on how the two are related to each other and what the intensity unit is would be greatly appreciated. 

-> The intensity unit is pixel intensity values. How that translates into physical units depends on your display, its settings, and its gamma calibration.

-mario



Thank you!