PsychImaging 'RestrictProcessing'

Hi all,

I am trying to use the PsychImaging pipeline to restrict PTB processing to a restricted area
of the screen. In order to get the best temporal resolution.

I have had a look at the syntax as used in the ImagingStereoDemo and also in the
PsychImaging file itself.

At the moment I am having a hard time getting some simple code to use restricted screen
area processing. If I change the area of processing in the ImagingStereoDemo I get an
appropriate change in what is displayed on the screen. But in the simple bit of code
below I am having problems replicating this.

The code just draws a 400 * 400 noise texture on a black screen. As far as I can see if I set
restrictSize = 400 I should see the whole noise texture, but changing to restrictSize = 10 I
should only see a 10 * 10 portion of the noise texture. But I just get an identical 400 * 400
stimulus displayed regardless of the value I use for restrictSize.

Am I missing something obvious?

Thanks,

Peter

close all;
clear all;

% Restricted processing size
restrictSize = 400;

AssertOpenGL;

KbName('UnifyKeyNames');
escape = KbName('ESCAPE');

scrnNum = max(Screen('Screens'));
PsychImaging('PrepareConfiguration');
PsychImaging('AddTask', 'General', 'RestrictProcessing', CenterRect([0 0 restrictSize
restrictSize], Screen('Rect', scrnNum)));
[windowPtr, windowRect]=PsychImaging('OpenWindow', scrnNum, BlackIndex(scrnNum), [],
32, 2, []);

% Make a random dot texture
noiseTex = Screen('MakeTexture', windowPtr, rand(400).* 255);

Screen('FillRect', windowPtr, BlackIndex(scrnNum));
Screen('BlendFunction', windowPtr, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');

% Run until a key is pressed
while 1
Screen('DrawTexture', windowPtr, noiseTex);
Screen('DrawingFinished', windowPtr);

[pressed dummy keycode] = KbCheck;
if pressed
if keycode(escape)
break;
end
end
Screen('Flip', windowPtr);
end

Screen('Flip', windowPtr);
Screen('CloseAll');
Thanks Mario.

That helps my puzzled brain :) My code runs happily, but anything to max the efficiency is
always good.

Peter



--- In psychtoolbox@yahoogroups.com, "Mario Kleiner" <mario.kleiner@...> wrote:
>
> Hi Peter,
>
> 'RestrictProcessing' only affects operations of the
> imaging pipeline, e.g, the stereo algorithms for
> anaglyph stereo, or other postprocessing routines,
> that is why ImagingStereoDemo uses it to restrict
> the processing for stereo display to some subregion.
>
> Your code doesn't use any imaging pipeline functions,
> it just opens a regular window through the
> PsychImaging('OpenWindow') function. Therefore
> the operation is a "no operation".
>
> Apart from that the 'General' in your command
> would be wrong, you'd need to define 'AllViews'
> or 'LeftView' or 'RightView'. The parser is silent
> about commands it doesn't recognize, so even
> if you'd write 'Sheep' or something there it
> wouldn't complain - it would just ignore it.
>
> -mario
>
> --- In psychtoolbox@yahoogroups.com, "peter.scarfe" <peterscarfe@> wrote:
> >
> > Hi all,
> >
> > I am trying to use the PsychImaging pipeline to restrict PTB processing to a restricted
> area
> > of the screen. In order to get the best temporal resolution.
> >
> > I have had a look at the syntax as used in the ImagingStereoDemo and also in the
> > PsychImaging file itself.
> >
> > At the moment I am having a hard time getting some simple code to use restricted
> screen
> > area processing. If I change the area of processing in the ImagingStereoDemo I get an
> > appropriate change in what is displayed on the screen. But in the simple bit of code
> > below I am having problems replicating this.
> >
> > The code just draws a 400 * 400 noise texture on a black screen. As far as I can see if
I
> set
> > restrictSize = 400 I should see the whole noise texture, but changing to restrictSize =
> 10 I
> > should only see a 10 * 10 portion of the noise texture. But I just get an identical 400 *
> 400
> > stimulus displayed regardless of the value I use for restrictSize.
> >
> > Am I missing something obvious?
> >
> > Thanks,
> >
> > Peter
> >
> > close all;
> > clear all;
> >
> > % Restricted processing size
> > restrictSize = 400;
> >
> > AssertOpenGL;
> >
> > KbName('UnifyKeyNames');
> > escape = KbName('ESCAPE');
> >
> > scrnNum = max(Screen('Screens'));
> > PsychImaging('PrepareConfiguration');
> > PsychImaging('AddTask', 'General', 'RestrictProcessing', CenterRect([0 0 restrictSize
> > restrictSize], Screen('Rect', scrnNum)));
> > [windowPtr, windowRect]=PsychImaging('OpenWindow', scrnNum,
BlackIndex(scrnNum),
> [],
> > 32, 2, []);
> >
> > % Make a random dot texture
> > noiseTex = Screen('MakeTexture', windowPtr, rand(400).* 255);
> >
> > Screen('FillRect', windowPtr, BlackIndex(scrnNum));
> > Screen('BlendFunction', windowPtr, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');
> >
> > % Run until a key is pressed
> > while 1
> > Screen('DrawTexture', windowPtr, noiseTex);
> > Screen('DrawingFinished', windowPtr);
> >
> > [pressed dummy keycode] = KbCheck;
> > if pressed
> > if keycode(escape)
> > break;
> > end
> > end
> > Screen('Flip', windowPtr);
> > end
> >
> > Screen('Flip', windowPtr);
> > Screen('CloseAll');
> >
>