Hi Jon,
if you saved your thresholded image as 'allclusters.img', you can use
the following code to write out images corresponding to each cluster:
v = spm_vol('allclusters.img');
vv = spm_read_vols(v);
[l,num] = spm_bwlabel(double(vv > 0),18);
for i=1:num
v.fname = sprintf('cluster%04d.img',i);
v.pinfo = [1 0]';
v.dt = [spm_type('uint8') spm_platform('bigend')];
v = spm_create_vol(v);
spm_write_vol(v,l==i);
end
All the best,
Guillaume.
Jon Brock wrote:
> Hi,
>
> It is possible to save, as binary images, seperate clusters arising from a
> between-groups analysis. I can see how to save the thresholded image (all
> three clusters), and also increasing the extent threshold to include only
> the largest cluster, but I wondered if there is a way to seperate the
> clusters and save them individually.
>
> Many thanks
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|