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');
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');