CreateProcedural* verbosity

Dear PsychToolboxers,

We are fortunate to have this wonderful suite of CreateProcedural* functions on hand. My one complaint is that they spit out little messages every time you create a procedural texture e.g.

Building a vertex shader:Reading shader from file /usr/share/matlab/site/m/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/BasicSineGratingShader.vert.txt ...
Building a fragment shader:Reading shader from file /usr/share/matlab/site/m/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/ApertureSineGratingShader.frag.txt ...


I will need to create a new procedural texture on each trial, I believe, because the size of the texture on screen might vary from one trial to another ; of course, I will carefully close each texture at the end of each trial. I would like to avoid filling my terminal with these "Building a ..." messages, because they'd swamp out other messages about the subject's performance. Is that possible?

Cheers,
Jackson


From the help of CreateProceduralGabor:

% 'width' x 'height' The maximum size (in pixels) of the gabor. More
% precise, the size of the mathematical support of the gabor. Providing too
% small values here would 'cut off' peripheral parts or your gabor. Too big
% values don't hurt wrt. correctness or accuracy, they just hurt
% performance, ie. drawing speed. Use a reasonable size for your purpose.

You don't need a new one for each trial, one will do for a whole session in most cases. Cfe. ProceduralGarboriumDemo.m

The reason why that path is printed was my hope that people would get curious about how that works and maybe learn how to write and contribute back such procedural stimuli themselves. I doubt sine gratings and gabor blobs are the only stimuli that would greatly benefit from such a procedural implementation. A hope that has proven to be mostly unfounded, like most of my hopes of seeing more participation by users - ie. mere users turning into some sort of contributors. I'll consider disabling the output by default in a future release to stop this failed experiment.

-mario
Oh dear, that's something of a tragic tale, re: contributors. Nevertheless, thank you for clarifying the size issue. I was a bit worried by what it says at the bottom of CreateProcedural* help:

Make sure 'dstRect' has the size of 'gratingrect' to avoid spatial distortions!

But I suppose that there will be no distortions as long as dstRect has the same width:height ratio as gratingrect does. However, there is a further issue in understanding what the 'freq' auxiliary parameter is referring to. The help says:

'freq' is its spatial frequency in cycles per pixel

But doesn't specify which pixels. Do we mean pixels in the PTB window, or pixels in the support of the procedural texture? My tests suggest the latter. But this matters a lot when the 'gratingrect' and 'dstRect' rectangles are a different size. I might want, say, 200 pixels per cycle and give that value to 'freq'. But If 'dstRect' is exactly half the size of 'gratingrect' then I will actually get 100 pixels per cycle.

Is that right?

Best,
Jackson
ps - Of course, the actual value of freq would be 1 / 200 in the example case, but I would get something that looked like freq was 1 / 100.



<jsdpag@...> wrote :

Oh dear, that's something of a tragic tale, re: contributors. Nevertheless, thank you for clarifying the size issue. I was a bit worried by what it says at the bottom of CreateProcedural* help:

Make sure 'dstRect' has the size of 'gratingrect' to avoid spatial distortions!

But I suppose that there will be no distortions as long as dstRect has the same width:height ratio as gratingrect does. However, there is a further issue in understanding what the 'freq' auxiliary parameter is referring to. The help says:

'freq' is its spatial frequency in cycles per pixel

But doesn't specify which pixels. Do we mean pixels in the PTB window, or pixels in the support of the procedural texture? My tests suggest the latter. But this matters a lot when the 'gratingrect' and 'dstRect' rectangles are a different size. I might want, say, 200 pixels per cycle and give that value to 'freq'. But If 'dstRect' is exactly half the size of 'gratingrect' then I will actually get 100 pixels per cycle.


-> The support (=technically the texels in texture coordinate space). As "Make sure 'dstRect' has the size of 'gratingrect' to avoid spatial distortions!" says, you are supposed to have both srcRect and dstRect of the same size. E.g., dstRect = CenterRectOnPoint(srcRect, xc, yc) if you wanted to center the gabor at [xc, yc]. If you wanted to have well defined gabors of different size, you'd CreateProceduralGabor() them with the maximum size you expect them to be (in screen pixels), so the size of the support is == maximum size. Then you draw them 1-to-1 at that size onto the screen, ie. srcRect is left [], and dstRect = CenterRect....(Screen('Rect', gabor), xc, yc) to draw at its full size. You would control the visual extents of the gabor by selecting proper parameters for its exponential hull function, frequency, amplitude, etc. If you use a larger dstRect, you just zoom up the image of the gabor, which was evaluated at its original size of its support.

-mario


Is that right?

Best,
Jackson