SELECT CONNECTIONS FOR DYNAMICS MOVIE current threshold -> select Npairs strongest effective connectivity [Input] Zact : current time series [Nv Nt] Econ : Effective connectivity matrix (non diagnal part of MAR matrix) [Nv Nv] Npairs : number of effective connectivity for display current_threshold : threshold for current vertex [Output] parcel_to_list, parcel_from_list : vertex indicies of pairs 2016/04/22 O.Yamashita 2022/09/21 Y.Takeda changed Npairs if the number of connectivity < Npairs Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [parcel_to_list,parcel_from_list] = dmri_select_pairs_for_movie(Zact, Econ, Npairs, current_threshold) 0002 % SELECT CONNECTIONS FOR DYNAMICS MOVIE 0003 % 0004 % current threshold -> select Npairs strongest effective connectivity 0005 % 0006 % [Input] 0007 % Zact : current time series [Nv Nt] 0008 % Econ : Effective connectivity matrix (non diagnal part of MAR matrix) [Nv Nv] 0009 % Npairs : number of effective connectivity for display 0010 % current_threshold : threshold for current vertex 0011 % 0012 % [Output] 0013 % parcel_to_list, parcel_from_list : vertex indicies of pairs 0014 % 0015 % 2016/04/22 O.Yamashita 0016 % 2022/09/21 Y.Takeda changed Npairs if the number of connectivity < Npairs 0017 % 0018 % Copyright (C) 2011, ATR All Rights Reserved. 0019 % License : New BSD License(see VBMEG_LICENSE.txt) 0020 0021 if nargin < 4 0022 current_threshold = 0.1; 0023 end 0024 if nargin < 3 0025 Npairs = 100; 0026 end 0027 0028 Nvact = size(Zact,1); 0029 0030 % Current vertices over threshold (select larger amplitude vertices) 0031 ix_act = find(sum(abs(Zact(:,:)) > current_threshold *max(abs(Zact(:))),2)); 0032 0033 % Nparis strongest effective connectivity 0034 tmp = Econ(ix_act, ix_act); 0035 [sorttmp, jx] = sort(abs(tmp(:)), 1, 'descend'); 0036 0037 % Change Npairs if the number of connectivity < Npairs 0038 if sum(sorttmp>0) < Npairs 0039 Npairs = sum(sorttmp>0); 0040 disp(['The number of effective connectivity for display was changed to ' num2str(Npairs) '.']) 0041 end 0042 0043 [I, J]=ind2sub(size(tmp), jx(1:Npairs)); 0044 parcel_to_list = ix_act(I); 0045 parcel_from_list = ix_act(J);