0001 function calculate_connectivity(p)
0002
0003
0004
0005
0006
0007 disp(mfilename);
0008
0009
0010 dmri_root = fullfile(p.proj_root, p.dmri_dirname);
0011 parcel_dir = fullfile(dmri_root, p.parcels_dirname);
0012 parcels_file = fullfile(parcel_dir, p.parcels_file);
0013 anat_matrix_file = fullfile(dmri_root, p.fiber_track_dirname, p.anat_matrix_file);
0014
0015
0016 dmri_file = fullfile(dmri_root, p.connectivity_dirname, p.connectivity_file);
0017
0018
0019 dmri_connect_parm_calc(parcels_file, parcel_dir, anat_matrix_file, dmri_file);
0020
0021
0022 load(dmri_file, 'membershipmat')
0023 Nroi = size(membershipmat, 1);
0024 Area = cell(Nroi, 1);
0025 for roi = 1:Nroi
0026 ix = find(membershipmat(roi, :) == 1);
0027 Area{roi}.key = num2str(roi);
0028 Area{roi}.Iextract = ix(:);
0029 end
0030 save_file = fullfile(p.proj_root, p.brain_dirname, [p.struct_name, '_dmri.area.mat']);
0031 save(save_file, 'Area')