Home > vbmeg > functions > tool_box > dmri_processor > functions > util > make_symmetry_matrix.m

make_symmetry_matrix

PURPOSE ^

Symmetrize connection strength matrix and fiber length matrix

SYNOPSIS ^

function [c_streng_s, f_leng_s] = make_symmetry_matrix(c_streng, f_leng)

DESCRIPTION ^

 Symmetrize connection strength matrix and fiber length matrix

 2012/08/03 M.Fukushima
 2012/10/02 M.Fukushima

 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 [c_streng_s, f_leng_s] = make_symmetry_matrix(c_streng, f_leng)
0002 % Symmetrize connection strength matrix and fiber length matrix
0003 %
0004 % 2012/08/03 M.Fukushima
0005 % 2012/10/02 M.Fukushima
0006 %
0007 % Copyright (C) 2011, ATR All Rights Reserved.
0008 % License : New BSD License(see VBMEG_LICENSE.txt)
0009 
0010 Nvact = size(c_streng,1);
0011 c_streng_s = c_streng;
0012 f_leng_s  = f_leng;
0013 
0014 for ii = 1:Nvact
0015   for jj = (ii+1):Nvact
0016     if c_streng(ii,jj)||c_streng(jj,ii)
0017 %       if c_streng(ii,jj)==0
0018 %         c_streng_s(ii,jj) = c_streng(jj,ii);
0019 %         f_leng_s(ii,jj)  = f_leng(jj,ii);
0020 %       elseif c_streng(jj,ii)==0
0021 %         c_streng_s(jj,ii) = c_streng(ii,jj);
0022 %         f_leng_s(jj,ii)  = f_leng(ii,jj);
0023 %       else
0024         mean_c_streng = 0.5*(c_streng(ii,jj) + c_streng(jj,ii));
0025         c_streng_s(ii,jj) = max(c_streng(ii,jj),c_streng(jj,ii));
0026         c_streng_s(jj,ii) = max(c_streng(ii,jj),c_streng(jj,ii));
0027         weighed_mean_f_leng = ...
0028           (c_streng(ii,jj)*f_leng(ii,jj) + c_streng(jj,ii)*f_leng(jj,ii))...
0029             /(2*mean_c_streng);
0030         f_leng_s(ii,jj) = weighed_mean_f_leng;
0031         f_leng_s(jj,ii) = weighed_mean_f_leng;
0032 %       end
0033     end
0034   end
0035 end
0036 
0037

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