0001 function mars_blob2roi(xSPM, pt)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 if nargin < 1
0015 error('Need SPM structure');
0016 end
0017 if nargin < 2
0018 error('Need point to identify cluster');
0019 end
0020
0021 vx_i = spm_XYZreg('findxyz', pt, xSPM.XYZmm);
0022 if isempty(vx_i)
0023 msgbox('No activated voxel at this location');
0024 return
0025 end
0026 Clusters = spm_clusters(xSPM.XYZ);
0027 cXYZ = xSPM.XYZmm(:, Clusters==Clusters(vx_i));
0028 if isempty(cXYZ), return, end
0029 d = sprintf('%s cluster at [%0.1f %0.1f %0.1f]', xSPM.title, pt);
0030 l = sprintf('%s_%0.0f_%0.0f_%0.0f', xSPM.title, pt);
0031 o = maroi_pointlist(struct('XYZ',cXYZ, 'mat', xSPM.M, ...
0032 'label', l, 'descrip', d));
0033 marsbar('saveroi', o);