function [h,t_start,t_end] = JOVE_PlotAtlasTC(h,TC,idx,DataType,W,S,TR) cla(h); pause(1); n_TP = size(TC,2); hold(h,'on'); if length(idx) > 10 CM = cbrewer('div','Spectral',length(idx)); else CM = cbrewer('qual','Set1',length(idx)); end tmp = TC(idx,:); tmp = tmp(:); range = [-max(abs(tmp)),max(abs(tmp))]; switch DataType case 'Atlas' for i = 1:length(idx) plot(h,0:TR:(n_TP-1)*TR,TC(idx(i),:),'color',CM(i,:),'Linewidth',2); end if isnan(range(1)) || isnan(range(2)) axis(h,[0,(n_TP-1)*TR,0,1]); else axis(h,[0,(n_TP-1)*TR,range(1),range(2)]); end xlabel(h,'Time [s]'); ylabel(h,'Atlased time courses [a.u.]'); case 'ISFC' t_start = (TR*W)-1; t_end = (size(TC,2)-1)*TR + t_start; for i = 1:length(idx) plot(h,t_start:S*TR:t_end,TC(idx(i),:),'color',CM(i,:),'Linewidth',2); end if isnan(range(1)) || isnan(range(2)) axis(h,[t_start,t_end,0,1]); else axis(h,[t_start,t_end,-1,1]); end xlabel(h,'Time [s]'); ylabel(h,'ISFC [-]'); otherwise end end