Mercurial > hg > camir-aes2014
comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirsimatrix/display.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function display(m) | |
2 % DISSIMATRIX/DISPLAY display of a dissimilarity matrix | |
3 disp(' '); | |
4 d = get(m,'Data'); | |
5 nam = get(m,'Name'); | |
6 fp = get(m,'FramePos'); | |
7 cha = get(m,'Channels'); | |
8 t = get(m,'Title'); | |
9 tp = get(m,'TrackPos'); | |
10 tv = get(m,'TrackVal'); | |
11 pp = get(m,'PeakPos'); | |
12 g = get(m,'Graph'); | |
13 b = get(m,'Branch'); | |
14 for i = 1:length(d) | |
15 if iscell(d{i}) | |
16 d{i} = d{i}{1}; | |
17 end | |
18 l = size(d{1},3); % Number of channels | |
19 il = (1-0.15)/l; | |
20 figure | |
21 for k = 1:l % For each channel | |
22 if l>1 | |
23 subplot('Position',[0.1 (k-1)*il+0.1 0.89 il-0.02]) | |
24 end | |
25 fpi = cell2mat(fp{i}); | |
26 if size(fpi,1) == 2 | |
27 fpi = (fpi(1,:,:,:)+fpi(2,:,:,:))/2; | |
28 end | |
29 if strcmp(m.view,'l') | |
30 h = imagesc(fpi,fpi(1:size(d{i},1))-fpi(1),d{i}(:,:,k)); | |
31 else | |
32 h = imagesc(fpi,fpi,d{i}(:,:,k)); | |
33 end | |
34 if not(isempty(g)) | |
35 hold on | |
36 pi = cell(1,size(g{i}{1},2)); | |
37 for j = 1:size(g{i}{1},2) | |
38 pi{j} = sort(pp{i}{1}{j}); | |
39 end | |
40 for j = 1:size(g{i}{1},2) | |
41 for h = 1:length(g{i}{1}{1,j,l}) | |
42 next = g{i}{1}{1,j,l}{h}; | |
43 if length(next)>1 | |
44 for n = 1:size(next,1) | |
45 plot([fpi(j) fpi(next(n,1))],... | |
46 [fpi(pi{j}(h)) - fpi(1), ... | |
47 fpi(pi{next(n,1)}(next(n,2))) - fpi(1)],... | |
48 'k','LineWidth',1) | |
49 %plot([fpi(j) fpi(next(n,1))],... | |
50 % [fpi(pi{j}(h)) - fpi(1), ... | |
51 % fpi(pi{next(n,1)}(next(n,2))) - fpi(1)],... | |
52 % 'w+','MarkerSize',10) | |
53 plot([fpi(j) fpi(next(n,1))],... | |
54 [fpi(pi{j}(h)) - fpi(1), ... | |
55 fpi(pi{next(n,1)}(next(n,2))) - fpi(1)],... | |
56 'kx','MarkerSize',10) | |
57 end | |
58 end | |
59 end | |
60 end | |
61 bi = b{i}{1}{1}; | |
62 for j = 1:size(bi,1)-1 | |
63 plot([fpi(bi(j,1)) fpi(bi(j+1,1))],... | |
64 [fpi(pi{bi(j,1)}(bi(j,2))) - fpi(1), ... | |
65 fpi(pi{bi(j+1,1)}(bi(j+1,2))) - fpi(1)],... | |
66 'w','LineWidth',1.5) | |
67 plot([fpi(bi(j,1)) fpi(bi(j+1,1))],... | |
68 [fpi(pi{bi(j,1)}(bi(j,2))) - fpi(1), ... | |
69 fpi(pi{bi(j+1,1)}(bi(j+1,2))) - fpi(1)],... | |
70 'w+','MarkerSize',15) | |
71 plot([fpi(bi(j,1)) fpi(bi(j+1,1))],... | |
72 [fpi(pi{bi(j,1)}(bi(j,2))) - fpi(1), ... | |
73 fpi(pi{bi(j+1,1)}(bi(j+1,2))) - fpi(1)],... | |
74 'kx','MarkerSize',15) | |
75 end | |
76 elseif not(isempty(tp)) && not(isempty(tp{i})) | |
77 hold on | |
78 for k = 1:size(tp{i}{1}{1},1) | |
79 prej = 0; | |
80 for j = 1:size(tp{i}{1}{1},2) | |
81 if tv{i}{1}{1}(k,j) | |
82 if prej% && not(isempty(tp(k,j))) | |
83 plot([fpi(prej) fpi(j)],... | |
84 [fpi(tp{i}{1}{1}(k,prej)) - fpi(1) ... | |
85 fpi(tp{i}{1}{1}(k,j)) - fpi(1)],... | |
86 'k','LineWidth',1) | |
87 plot([fpi(prej) fpi(j)],... | |
88 [fpi(tp{i}{1}{1}(k,prej)) - fpi(1) ... | |
89 fpi(tp{i}{1}{1}(k,j)) - fpi(1)],... | |
90 'w+','MarkerSize',10) | |
91 plot([fpi(prej) fpi(j)],... | |
92 [fpi(tp{i}{1}{1}(k,prej)) - fpi(1) ... | |
93 fpi(tp{i}{1}{1}(k,j)) - fpi(1)],... | |
94 'kx','MarkerSize',10) | |
95 end | |
96 prej = j; | |
97 end | |
98 end | |
99 end | |
100 elseif not(isempty(pp)) && not(isempty(pp{i})) | |
101 hold on | |
102 for k = 1:length(pp{i}{1}) | |
103 for j = 1:length(pp{i}{1}{k}) | |
104 plot(fpi(k),fpi(pp{i}{1}{k}(j)) - fpi(1), ... | |
105 'w+','MarkerSize',10) | |
106 end | |
107 end | |
108 end | |
109 set(gca,'YDir','normal') | |
110 if k == l | |
111 title(t) | |
112 end | |
113 if k == 1 | |
114 xlabel('temporal location of frame centers (in s.)') | |
115 end | |
116 if k == ceil(l/2) | |
117 if strcmp(m.view,'h') | |
118 ylabel('relative distance between compared frames (in s.)') | |
119 elseif strcmp(m.view,'l') | |
120 ylabel('temporal lag (in s.)') | |
121 else | |
122 ylabel('temporal location of frame centers (in s.)') | |
123 end | |
124 end | |
125 if l > 1 | |
126 pos = get(gca,'Position'); | |
127 hfig = axes('Position',[pos(1)-.05 pos(2)+pos(4)/2 .01 .01],... | |
128 'Visible','off'); | |
129 text(0,0,num2str(cha{i}(k)),'FontSize',12,'Color','r') | |
130 end | |
131 end | |
132 fig = get(0,'CurrentFigure'); | |
133 disp(['The ',t,' related to file ',nam{i},' is displayed in Figure ',num2str(fig),'.']); | |
134 end | |
135 disp(' '); | |
136 drawnow |