Home > vbmeg > demo > tutorial_for_vbmeg2 > advanced > calculate_connectivity.m

calculate_connectivity

PURPOSE ^

Calculate connectivity matrix from the result of fiber tracking

SYNOPSIS ^

function calculate_connectivity(p)

DESCRIPTION ^

 Calculate connectivity matrix from the result of fiber tracking

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function calculate_connectivity(p)
0002 % Calculate connectivity matrix from the result of fiber tracking
0003 %
0004 % Copyright (C) 2011, ATR All Rights Reserved.
0005 % License : New BSD License(see VBMEG_LICENSE.txt)
0006 
0007 disp(mfilename);
0008 
0009 % Set input files
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 % Set output file
0016 dmri_file = fullfile(dmri_root, p.connectivity_dirname, p.connectivity_file);
0017 
0018 % Calculate connectiviy matrix
0019 dmri_connect_parm_calc(parcels_file, parcel_dir, anat_matrix_file, dmri_file);
0020 
0021 % Make area.mat file
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')

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005