Skip to content

Commit

Permalink
Long report figure bug
Browse files Browse the repository at this point in the history
Corrected opening of addition SPM figure and set axis handles to avoid printing in other figures in the longitudinal CAT report.
  • Loading branch information
robdahn committed Nov 20, 2023
1 parent c499bdf commit b9ef5a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions cat_long_report.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
cjob.verb = 0;
cjob.c = {};
cjob.data_xml = {};
cjob.new_fig = 0;
cres = cat_stat_homogeneity(cjob);

% the average is created by a more complex function and not only the
Expand Down Expand Up @@ -343,6 +344,7 @@
cjob.verb = 0;
cjob.data_xml = {};
cjob.gap = 3;
cjob.new_fig = 0;
try
% try to estimate covariance ... if it fails then asume that the
% meshes are not equal and resmaple them
Expand Down
18 changes: 9 additions & 9 deletions cat_main_reportfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -427,16 +427,16 @@ function cat_main_reportfig(Ym,Yp0,Yl1,Psurf,job,qa,res,str)
leg = [leg {'dIQR/100'}];
end
% plot lines
pt = plot( IQR/100 ); set(pt,'Color',tcmap(1,:),'Marker',marker{2}, ...
pt = plot( axi(1), IQR/100 ); set(pt,'Color',tcmap(1,:),'Marker',marker{2}, ...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
if ~any(isnan(ZSCORE)) && numel(res.long.files) > 2
pt = plot( ZSCORE ); set(pt,'Color',tcmap(2,:),'Marker',marker{1}, ...
pt = plot( axi(1), ZSCORE ); set(pt,'Color',tcmap(2,:),'Marker',marker{1}, ...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
pt = plot( RMSE); set(pt,'Color',tcmap(3,:),'Marker',marker{3}, ...
pt = plot( axi(1), RMSE); set(pt,'Color',tcmap(3,:),'Marker',marker{3}, ...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
end
% final settings
ylim([mlim 0]); xlim([0.9 numel(res.long.files)+0.1]);
ylim( [mlim 0]); xlim([0.9 numel(res.long.files)+0.1]);
set(cp(1),'Fontsize',fontsize*0.8,'xtick',max(1,0:round(numel(res.long.files)/100)*10:numel(res.long.files)), ...
'ytick',mlim:max(0.01,round((abs(mlim)/5)*200)/200):0,...
'XAxisLocation','origin');
Expand Down Expand Up @@ -537,29 +537,29 @@ function cat_main_reportfig(Ym,Yp0,Yl1,Psurf,job,qa,res,str)
set(axi(2),'Color',job.extopts.report.color,'YAxisLocation','right','XAxisLocation','bottom','box','on');
% plot tissue values
for ti = [2 3 1]
pt = plot( ( res.long.vol_abs_CGW(:,ti) - repmat( res.long.vol_abs_CGW(1,ti) , size(res.long.vol_abs_CGW,1) , 1) )');
pt = plot( axi(2), ( res.long.vol_abs_CGW(:,ti) - repmat( res.long.vol_abs_CGW(1,ti) , size(res.long.vol_abs_CGW,1) , 1) )');
set(pt,'Color',tcmap(ti,:),'Marker',marker{ti},...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
end
% plot WMH
if any( res.long.vol_abs_WMH )
pt = plot(res.long.vol_abs_WMH - res.long.vol_abs_WMH(1));
pt = plot( axi(2), res.long.vol_abs_WMH - res.long.vol_abs_WMH(1));
set(pt,'Color',tcmap(6,:),'LineStyle','-','Marker',marker{4}, ...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
end
% plot TIV
pt = plot(res.long.vol_TIV - res.long.vol_TIV(1));
pt = plot( axi(2), res.long.vol_TIV - res.long.vol_TIV(1));
set(pt,'Color',tcmap(4,:),'LineStyle','-','Marker',marker{4}, ...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
% plot TSA
if isfield(res.long,'surf_TSA')
pt = plot(res.long.surf_TSA - res.long.surf_TSA(1));
pt = plot( axi(2), res.long.surf_TSA - res.long.surf_TSA(1));
set(pt,'Color',tcmap(5,:),'LineStyle','-','Marker',marker{5}, ...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
end
% plot thickness
if isfield(res.long,'change_dist_thickness')
pt = plot(res.long.change_dist_thickness(:,1) * 1000);
pt = plot( axi(2), res.long.change_dist_thickness(:,1) * 1000);
set(pt,'Color',tcmap(6,:),'LineStyle','-','Marker',marker{6}, ...
'MarkerFaceColor',job.extopts.report.color,'MarkerSize',max(3,6 - numel(res.long.files)/10));
end
Expand Down

0 comments on commit b9ef5a4

Please sign in to comment.