-
Notifications
You must be signed in to change notification settings - Fork 0
/
fp_visualizeEagDBsubset.m
executable file
·121 lines (95 loc) · 2.89 KB
/
fp_visualizeEagDBsubset.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
% fp_visualizeEagDB.m
% script which loads and then visualizes the eagleman database of
% grapheme-color synesthetes
% load data
load Engl_Alpha_5.mat;
% rgb has all our matching data
% rgb 6588x3x26
% let's permute our rgb matrix so it is an image
p_rgb = permute(rgb, [1,3,2]);
% p_rgb 6588x26x3
% unfortunately there are a few values which are just a tiny bit smaller
% than 0 and some which are a tiny bit larger than 1
% just reset those
p_rgb(p_rgb>1)=1;
p_rgb(p_rgb<0)=0;
% now we can look at the whole data set
figure('name', 'all matches in eagleman database', 'Color', [1 1 1]);
imagesc(p_rgb(:,nooverlap,:));
ylabel('SUBJECTS');
xlabel('LETTERS');
set(gca,'XTick',[1:length(nooverlap)],'XTickLabel',no_o_letters, 'TickDir','out', 'YDir','normal');
box off;
Title('All letter-color matches in eagleman database');
[dbNumbered dbLabeled] = fpRGB2ColorsJW(rgb);
% dbLabeled 6588x26 11947850 cell
% dbNumbered 6588x26 1370304 double
% the lookup table for numbers to names is
names = {...
'black' ...
'white' ...
'red' ...
'green' ...
'yellow' ...
'blue' ...
'brown' ...
'purple' ...
'pink' ...
'orange' ...
'grey'...
};
histcolors = [ 0 0 0;
1 1 1;
1 0 0;
0 1 0;
1 1 0;
0 0 1;
.8 .4 .12;
.8 0 .8;
1 .1 .55;
1 .6 0;
.5 .5 .5;];
%
%
%
% % ok: now we want some histograms
% % since we want to color each bar in the right color can't really use the
% % hist function
% figure('name','histogram of color names for each letter ', 'Color', [1 1 1]);
% for i = 1:26
%
% subplot(6,5,i);
% [counts, bins]=hist(dbNumbered(:,i),11)
% hBar =bar(bins, counts,'hist');
% ylabel('Number of Subjects');
% % set(gca,'XTick',[0:length(names)],'XTickLabel',names,'YLim',[0
% % 3000],'FontSize',6);
% set(gca,'YLim',[0 3000],'FontWeight','bold');
% set(hBar,'FaceVertexCData',histcolors);
% title(labels(i));
% box off;
%
% end
% let's do it again as percent
figure('name','percent of times each letter is given a color label', 'Color', [1 1 1]);
for i = 1:26
subplot(6,5,i);
[counts, bins]=hist(dbNumbered(:,i),11)
counts = counts/length(dbLabeled);
hBar =bar(bins, counts,'hist');
ylabel('Number of Subjects');
% set(gca,'XTick',[0:length(names)],'XTickLabel',names,'YLim',[0
% 3000],'FontSize',6);
set(gca,'YLim',[0 .6],'FontWeight','bold');
set(hBar,'FaceVertexCData',histcolors);
title(labels(i));
box off;
end
format short g;
% want to slip a table in here too in the command window
disp(['letter black white red green yellow blue brown purple pink orange grey']);
for i=1:26
[counts, bins]=hist(dbNumbered(:,i),11);
counts = counts/length(dbLabeled);
disp([letters(i) ' ' num2str(counts,'%0.2f ')]);
end