-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcali.m
More file actions
88 lines (53 loc) · 1.58 KB
/
cali.m
File metadata and controls
88 lines (53 loc) · 1.58 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
function triggerLinuxNframe(screenNum)
if ~exist('screenNum','var')
screenNum = 1; % 1 for inside monitor ;0 for outside monitor
end
screenNum = 1;
ColNum = 17;
rowNum = 9;
isdebug = false;
bkcolor = [0 0 0];
targetcolor = [255 255 255];
is2DCorrect = 0;
[CIExyY,myCorrectionMatrix] = ColorCAL2_bcl('initialize');
%
AssertOpenGL;
PsychImaging('PrepareConfiguration');
PsychImaging('AddTask', 'AllViews', 'DisplayColorCorrection', 'GainMatrix');
% opening your win over here
[w,fullrect] = PsychImaging('OpenWindow',screenNum,targetcolor);
if is2DCorrect
PsychColorCorrection('SetGainMatrix',w,matrix);
else
matrix = ones(fullrect([3,4]));
PsychColorCorrection('SetGainMatrix',w,matrix);
end
eachRectWidth = fullrect(3)/m;
eachRectHeight = fullrect(4)/n;
iRect = 0;
for locRow = 1:n
for locCol = 1:m
iRect = iRect+1;
RectPos(:,iRect) = [eachRectWidth*(locCol-1),eachRectHeight*(locRow-1),eachRectWidth*locCol,eachRectHeight*locRow]';
end
end
Screen('FrameRect',w,bkcolor',RectPos,1);
Screen('Flip',w);
% ifi = Screen('GetFlipInterval',w);
for iLoc = 1:iRect
fprintf('please press f\n');
while true
[kd,sec,keycode] = KbCheck;
if keycode(KbName('f'))
break;
end
end
WaitSecs(2);
for iTrial = 1:5
[CIExyY] = ColorCAL2_bcl('measure',1,myCorrectionMatrix);
allCIExyY(iTrial,:,iLoc) = CIExyY;
WaitSecs(2);
end
end
save;
sca;