help > RE: CONN and ROIs mask
Jun 10, 2017  05:06 AM | Hiroyuki Akama - Tokyo Institute of Technology
RE: CONN and ROIs mask
Please try the following with SPM12 to get all the ROI binary masks from 'atlas.nii' of CONN (please change the full paths).

%%%
inputatlas='C:\Users\owner\Documents\spm12\toolbox\conn\rois\atlas.nii,1';
outputdir='C:\Users\owner\Documents\spm12\toolbox\conn\mask\';
atlaslist='C:\Users\owner\Documents\spm12\toolbox\conn\rois\atlas.txt';
addpath 'C:\Users\owner\Documents\spm12\compat'
fid = fopen(atlaslist,'r');
tline = fgetl(fid);
r=1;
atlascell=cell(1,132);
while ischar(tline)
atlascell{r}=sprintf(tline,'%s\n');
tline = fgetl(fid);
r=r+1;
end
fclose(fid);
for i=1:r-1
outputmask=strcat(outputdir,'atlasmask_', num2str(i),'_',atlascell{i}, '.nii');
exp=strcat('i1==',num2str(i));
[outputmask,structinfo] = spm_imcalc_ui(inputatlas, outputmask, exp);
end
%%%

Hiroyuki AKAMA
Associate Professor,
Institute of Liberal Arts / School of Life Science and Technology
Tokyo Institute of Technology,
W9-10, O-okayama, Meguro-ku, Tokyo-152-8552
Japan

Threaded View

TitleAuthorDate
njoud aldusary Jun 9, 2017
RE: CONN and ROIs mask
Hiroyuki Akama Jun 10, 2017