function calc_correlations(roipth, data, outfile)

roi_extension='nii';
roipth=[roipth filesep];
roifile=dir([roipth '/*.' roi_extension]);
roifiles=[repmat(roipth,length(roifile),1) char(roifile.name)];
roistats=calc_roi_mean(roifiles, data);
cm=corrcoef(roistats.mean_act);
save(outfile,'cm','roifiles')
