Dear Ping,
there might/should be simpler ways to do this but the following SPM12
script should split a binary image (of your cluster) into a series of
binary images of the intersection regions from the Neuromorphometrics
atlas (but you could use any other atlas such as AAL):
VM = spm_vol('cluster.nii');
[DM,XYZmm] = spm_read_vols(VM);
idx = find(DM(:)~=0);
XYZmm = XYZmm(:,idx);
xA = spm_atlas('load','Neuromorphometrics');
for i=1:size(XYZmm,2)
labels{i} = spm_atlas('query',xA,XYZmm(:,i));
end
ulabels = unique(labels);
for i=1:numel(ulabels)
V = VM;
V.fname = spm_file(V.fname,...
'suffix',['_' strrep(ulabels{i},' ','_')]);
D = zeros(size(DM));
j = ismember(labels,ulabels{i});
D(idx(j)) = 1;
spm_write_vol(V,D);
end
Best regards,
Guillaume.
On 06/01/16 05:26, yang ping wrote:
> Dear Donald and experts,
>
> Since my group Tmap show a big cluster which contained part of SPL,
> part of IPL and part of Postcentral, thus I want to separate these 3
> ROIs from the cluster. I used the peak_nii.m to get the peaks within
> this cluster, and I got 3 peaks which represent SPL, IPL and Postcentral
> respectively. But the coordinate of the peak of Postcentral is at the
> edge of original cluster. If I used this coordinate to make a sphere
> ROI, it will exceed the original cluster. In other word, my cluster
> contain a small region of Postcentral, how can I choose the center/
> gravity of the this region instead of the peak at the edge.
>
> Is there any other best way to separate different ROIs from a cluster.
> Can I used the mask of Postcentral from AAL template to overlap the
> original cluster, and get the ROI?
>
> best regards
> Ping
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|