forked from francopestilli/life_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paths_fe_probabilistic_vs_deterministic_96_mean.m
60 lines (52 loc) · 2.09 KB
/
s_fe_probabilistic_vs_deterministic_96_mean.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
function s_fe_probabilistic_vs_deterministic_96_mean
%
% This function loads prcomputed results for the test of probabilisitc and
% deterministic connectomes and makes a simple bar plot. It requires
% results generated by:
%
% s_fe_probabilistic_vs_deterministic_96
%
%
% Copyright Franco Pestilli (2014) Vistasoft Stanford University.
% Get the base directory for the data
datapath = '/home/frk/Dropbox/';
if notDefined('trackingType'), trackingType = 'lmax10';end
if notDefined('saveDir'), savedir = fullfile('/marcovaldo/frk/Dropbox','pestilli_etal_revision',mfilename);end
fprintf('[%s] Loading results \n',mfilename)
load(sprintf('average_results_%s',trackingType))
s = reshape(cell2mat(dprime),2,6);
sm = mean(s,1);
s_mean = mean(sm);
s_ste = std(sm)./sqrt(6);
figName = sprintf('mean_S_probabilistic_vs_deterministic_96_%s',trackingType);
h = figure('name',figName,'color','w');
bar(s_mean,'k');hold on
plot([1 1],[s_mean,s_mean] + [-s_ste/2 s_ste/2],'r-','linewidth',2)
ylabel('Proportion deleted fascicles','fontsize',12)
xlabel('Fascicle length','fontsize',12)
set(gca,'xlim',[0 2],...
'xtick',[1],...
'ylim', [0 200], ...
'ytick',[0 100 200], ...
'tickdir','out','box','off', ...
'fontsize',12,'visible','on')
saveFig(h,fullfile(savedir,figName),true)
end
%-------------------------------%
function saveFig(h,figName,eps)
if ~exist( fileparts(figName), 'dir'), mkdir(fileparts(figName));end
fprintf('[%s] saving figure... \n%s\n',mfilename,figName);
switch eps
case {0,'jpeg'}
eval(sprintf('print(%s, ''-djpeg90'', ''-opengl'', ''%s'')', num2str(h),[figName,'.jpg']));
case {1,'eps'}
eval(sprintf('print(%s, ''-cmyk'', ''-painters'',''-depsc2'',''-tiff'',''-r500'' , ''-noui'', ''%s'')', num2str(h),[figName,'.eps']));
case 'png'
eval(sprintf('print(%s, ''-dpng'',''-r500'', ''%s'')', num2str(h),[figName,'.png']));
case 'tiff'
eval(sprintf('print(%s, ''-dtiff'',''-r500'', ''%s'')', num2str(h),[figName,'.tif']));
case 'bmp'
eval(sprintf('print(%s, ''-dbmp256'',''-r500'', ''%s'')', num2str(h),[figName,'.bmp']));
otherwise
end
end