Print

Print


Take a look at my peak_nii toolbox in NITRC. It will generate a map of clusters where each cluster has a unique value. Then, you can do something similar to the following:

hdr=spm_vol(clusterimage);
img=spm_read_vols(hdr);
mimg=spm_read_vols(spm_vol(AALimage));
if ~all(size(img)==size(mimg))
     disp('Images are not the same size')
     error()
end
for ii=1:max(img(:))
       for jj=1:max(mimg(:))
            oimg=zeros(size(img));
            oimg(img==ii && mimg==jj)=1;
            hdr.fname=['Cluster_' num2str(ii) '_AALRegion_' num2str(jj) '.nii'];
            spm_write_vol(hdr,img)
     end
end

Now you have a file for each cluster split by anatomical region.


Best Regards, 
Donald McLaren, PhD


On Sun, Oct 25, 2015 at 1:39 PM, Aser A <[log in to unmask]> wrote:
Hi all,

In SPM I can save all clusters as binary. However I would like to save all clusters into individual maps.

However I may come across big clusters that overlap over two regions. So I thought to do something like: multiplying the "all binary map clusters" by the AAL.nii atlas. This will generate a map that has clusters with assigned values according to the labelling of the AAL. However I am not sure how I can then extract these masked clusters with the AAL into individual clusters ?

Or in other words, if I have several ROIS with different values (1,2,3..etc) in one map how can I separate them into individual maps?

Many thanks