function roilist=spm_roi_list(roi_info);
% lists ROIs for a particular analysis
%
%  part of the SPM ROI Toolbox
%  - see http://spm-toolbox.sourceforge.net/ for more details
% ============================================================
% Russ Poldrack, 10/05/02

% load roi data from .mat file
try,
 load(roi_info);
catch,
 fprintf('problem loading %s\n',roi_info);
end;

point=zeros(1,3);
%spm_results_ui('Clear',Fgraph);
info=sprintf('ROI information for %s',roi_info);
info=sprintf('%s\nCluster #\tX\tY\tZ\tMax T\tNumVox\tPvox\tPclust\tClustSize',info);
nclust=size(ROI.sphere,2);
for cluster=1:nclust,
       point=ROI.sphere(cluster).center;
       info=sprintf('%s\n%d:\t\t%d\t%d\t%d\t%3.2f\t%d\t%0.3f\t%0.3f\t%d',...
         info,cluster,point,max(ROI.sphere(cluster).Z),...
	 size(ROI.sphere(cluster).XYZ,2),ROI.sphere(cluster).vox_p_corr,...
	 ROI.sphere(cluster).clust_p_corr,ROI.sphere(cluster).full_clust_size);
end;

info=sprintf('%s\n',info);
%ax=axes('Position',[0.05 0.85 0.1 0.1],'Parent',Fgraph, ...
%	'Visible','off');
%set(get(ax,'Title'),'String',info,'FontSize',12,'FontWeight','normal',...
%        'Visible','on','HorizontalAlignment','left','VerticalAlignment','top');
fprintf('%s',info);

% write to file
fid=fopen('roi_list.txt','w');
fprintf(fid,'%s',info);
fclose(fid);

return;