-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplotFeatureScores.m
More file actions
44 lines (43 loc) · 1.38 KB
/
plotFeatureScores.m
File metadata and controls
44 lines (43 loc) · 1.38 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
function [] = plotFeatureScores(featureScores,sortedFeatureIndices,freqNum,timeIntervalNum,plotFormat,layout,projectData)
%plotFeatureScores function plots all feature scores on head layout.
% plotFeatureScores(featureScores,freqNum,timeIntervalNum,plotFormat,layo
% ut)
% The CopyRight is reserved by the author.
% By Seyed Mostafa Kia, January, 2013
foldNum = size(featureScores,2);
allScores = [];
if projectData.config.FSSortingMethodType == 2 || projectData.config.FSSortingMethodType == 3
for i = 1 : foldNum
a(sortedFeatureIndices{1,i}) = featureScores{1,i};
allScores = [allScores;a];
end
else
for i = 1 : foldNum
allScores = [allScores;featureScores{i}];
end
end
scores = mean(allScores);
featureNum = size(scores,2);
channelFeatureNum =freqNum*timeIntervalNum;
channelFeatures = [];
for i = 1 : featureNum
if mod(i,channelFeatureNum) == 0
channelFeatures = [channelFeatures scores(1,i-channelFeatureNum+1:i)'];
end
end
cfg = [];
cfg.layout = layout;
cfg.comment = 'no';
cfg.zlim(1,1) = min(min(channelFeatures));
cfg.zlim(1,2) = max(max(channelFeatures));
cfg.interpolation = 'v4';
figure;
if freqNum == 1
freqNum = 2;
timeIntervalNum = round(timeIntervalNum/2);
end
for i = 1 : channelFeatureNum
plotFormat.powspctrm = channelFeatures(i,:);
subplot(freqNum,timeIntervalNum,i);
ft_topoplotTFR(cfg,plotFormat);
end