-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTIMS_FLAG.m
51 lines (44 loc) · 1.79 KB
/
STIMS_FLAG.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
%%%%%%%%%%%%% STIMULUS RING CREATION
%%%%%%%%%%%%% Alex Cope 2009
circleRadius = 20;%35
maxDist = 11.0;
tile=(imread(['./Images/blank2.png']));
targIm=(imread(['./Images/RG.png']));
distIm1=(imread(['./Images/GB.png']));
distIm2=(imread(['./Images/BR.png']));
layOuts = [ ...
1 2 2 1 2 2 1 1 1 2 1 2 2 1;
2 1 2 1 2 1 1 2 1 2 2 1 1 2;
1 2 1 2 2 1 2 1 2 1 1 2 2 1;
2 2 1 1 1 2 2 1 2 2 1 1 2 1;
1 1 2 2 1 2 1 2 2 1 2 1 1 2;
2 1 1 2 1 1 2 2 1 1 2 2 2 1;
1 2 2 1 2 1 2 1 1 2 2 1 2 1;
2 1 1 2 1 1 2 2 1 2 1 2 1 2;
2 1 2 1 2 2 1 1 2 2 1 1 2 1;
1 2 1 2 1 2 1 2 2 1 2 1 2 1;
2 2 1 1 1 2 2 1 2 1 1 2 1 2;
1 1 2 2 2 1 1 2 1 1 2 2 1 2];
OffS = floor(size(targIm)./2);
deltaTheta = 2*pi / (maxDist + 1);
xshift = 0;%round(rand()*4)-2;
yshift = 0;%round(rand()*4)-2;
for i = 1:(numDist+1)
x = floor(circleRadius * sin(deltaTheta * (runNum-1) + deltaTheta * (i-1) * ...
(maxDist+1)/(numDist+1)))+floor(size(tile,1)./2)+xshift;
y = floor(circleRadius * cos(deltaTheta * (runNum-1) + deltaTheta * (i-1) * ...
(maxDist+1)/(numDist+1)))+floor(size(tile,2)./2)+yshift;
if targetMode == 2
targetVals{i} = [y-150 x-150 10]; % y location of target, x location of target, acceptable distance from target
end
if i == 1
tile(x-OffS(1)+1:x+OffS(1), y-OffS(2)+1:y+OffS(2), :) = targIm(:,:,:);
if targetMode == 1
targetVals{1} = [y-150 x-150 10]; % y location of target, x location of target, acceptable distance from target
end
else
eval(['tile(x-OffS(1)+1:x+OffS(1), y-OffS(2)+1:y+OffS(2), :) = distIm' int2str(layOuts(runNum,i-1)) '(:,:,:);']);
end
end
figure(66)
imagesc(tile);