-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup_ptb.m
27 lines (23 loc) · 946 Bytes
/
setup_ptb.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
%% Some Setup
AssertOpenGL;
sca;
PsychDefaultSetup(2);
InitializePsychSound;
pahandle = PsychPortAudio('Open', [], [], 0);
screenNumber = min(Screen('Screens'));
white = WhiteIndex(screenNumber);
black = BlackIndex(screenNumber);
grey = white / 2;
% Open the screen
%[window, windowRect] = PsychImaging('OpenWindow', screenNumber, grey, [400, 0, 1600, 900], 32, 2, [], [], kPsychNeed32BPCFloat);
[window, windowRect] = PsychImaging('OpenWindow', screenNumber, grey, [], 32, 2, [], [], kPsychNeed32BPCFloat);
% You definetly want to set a custom look up table.
% gamma is the look up table
if exist('gamma_lut', 'var') == 0 && length(gamma_lut) == 256
throw(MException('EXP:Quit', 'variable gamma not in workspace; no gamma lut loaded'));
end
Screen('LoadNormalizedGammaTable', window, gamma_lut*[1 1 1]);
HideCursor(screenNumber)
Screen('Flip', window);
% Make gabortexture
gabortex = make_gabor(window, 'gabor_dim_pix', gabor_dim_pix);