-
Notifications
You must be signed in to change notification settings - Fork 1
/
makecolormaps.m
133 lines (128 loc) · 3.47 KB
/
makecolormaps.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
%makecolormap : est une fonction autoscale qui creer une map commencant
%a l'intensite minimum de l'image jusqu'au maximum. On peut choisir la
%couleur avec 'Green' ou 'Red' ou 'Trans' pour une image en lumiere transmise
%en grayscale.
%S. Labrecque 2007-07-24.
function [map] = makecolormaps(I, mapcolor)
% mapGreen=[];
% mapTrans=[];
% mapRed=[];
% mapBlue=[];
% mapYellow=[];
if isequal(mapcolor,'Green') == 1
% exsitingmap = exist('mapGreen.mat');
% if exsitingmap == 0
mapGreen=[];
maxImage=double(max(max(I)));
mapGreen=zeros(maxImage+1,3);
mapGreen(:,2)=[0:(1/maxImage):1];
map= mapGreen;
% save mapGreen mapGreen
% else
% load mapGreen
% end
end
if isequal(mapcolor,'Trans') == 1
% exsitingmap = exist('mapGreen.mat');
% if exsitingmap == 2
% load mapGreen
% end
% exsitingmap = exist('mapTrans.mat');
% if exsitingmap == 0
mapTrans=[];
maxImage=double(max(max(I)));
mapTrans=zeros(maxImage+1,3);
mapTrans(:,1)=[0:(1/maxImage):1];
mapTrans(:,2)=[0:(1/maxImage):1];
mapTrans(:,3)=[0:(1/maxImage):1];
map = mapTrans;
% save mapTrans mapTrans
% else
% load Maptrans
% end
end
if isequal(mapcolor,'Red') == 1
% exsitingmap = exist('mapGreen.mat');
% if exsitingmap == 2
% load mapGreen
% end
% exsitingmap = exist('mapTrans.mat');
% if exsitingmap == 2
% load mapTrans
% end
% exsitingmap = exist('mapRed.mat');
% if exsitingmap == 0
mapRed=[];
maxImage=double(max(max(I)));
mapRed=zeros(maxImage+1,3);
mapRed(:,1)=[0:(1/maxImage):1];
map = mapRed;
% save mapRed mapRed
% else
% load mapRed
% end
end
%%%%%%%%%%%%
if isequal(mapcolor,'Blue') == 1
% exsitingmap = exist('mapGreen.mat');
% if exsitingmap == 2
% load mapGreen
% end
% exsitingmap = exist('mapTrans.mat');
% if exsitingmap == 2
% load mapTrans
% end
% exsitingmap = exist('mapRed.mat');
% if exsitingmap == 2
% load mapRed
% end
%
% exsitingmap = exist('mapBlue.mat');
% if exsitingmap == 0
mapBlue=[];
maxImage=double(max(max(I)));
mapBlue=zeros(maxImage+1,3);
mapBlue(:,3)=[0:(1/maxImage):1];
map = mapBlue;
% save mapBlue mapBlue
% else
% load mapBlue
% end
end
%%%
if isequal(mapcolor,'Yellow') == 1
% exsitingmap = exist('mapGreen.mat');
% if exsitingmap == 2
% load mapGreen
% end
% exsitingmap = exist('mapTrans.mat');
% if exsitingmap == 2
% load mapTrans
% end
%
% exsitingmap = exist('mapRed.mat');
% if exsitingmap == 2
% load mapRed
% end
%
% exsitingmap = exist('mapBlue.mat');
% if exsitingmap == 2
% load mapBlue
% end
%
% exsitingmap = exist('mapYellow.mat');
% if exsitingmap == 0
mapYellow=[];
maxImage=double(max(max(I)));
mapYellow=zeros(maxImage+1,3);
mapYellow(:,1)=[0:(1/maxImage):1];
mapYellow(:,2)=[0:(1/maxImage):1];
map = mapYellow;
% save mapYellow mapYellow
% else
% load mapYellow
% end
end
% mapcolor
% pause
end