Home > functions > brain > vb_reduce_neighbor_data.m

vb_reduce_neighbor_data

PURPOSE ^

Generate the neighbor information of subregion (Vindx) from that of whole brain

SYNOPSIS ^

function [nextIXnew, nextDDnew]=vb_reduce_neighbor_data(Vindx,nextIX,nextDD)

DESCRIPTION ^

  Generate the neighbor information of subregion (Vindx) from that of whole brain 
   [nextIXnew, nextDDnew]=vb_reduce_neighbor_data(Vindx,nextIX,nextDD)
 ---- Input
 Vindx     : Vertex indices of subregion as whole brain indices
 nextIX{i} : Neighbor index list for the point i
 nextDD{i} : Distance from the point i

 ---- Table [[ old indices  (whole brain) -> new indices (subregion) ]] 
 Itrans(i)=0 : old index = i is not included in the new index set
 Itrans(i)=j : old index = i is correspond to new index = j 
 jx = Itrans(ix) : Transform old index ix to new index jx

 Ver 1.0 written by M. Sato  2003-3-15

 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 [nextIXnew, nextDDnew]=vb_reduce_neighbor_data(Vindx,nextIX,nextDD)
0002 %  Generate the neighbor information of subregion (Vindx) from that of whole brain
0003 %   [nextIXnew, nextDDnew]=vb_reduce_neighbor_data(Vindx,nextIX,nextDD)
0004 % ---- Input
0005 % Vindx     : Vertex indices of subregion as whole brain indices
0006 % nextIX{i} : Neighbor index list for the point i
0007 % nextDD{i} : Distance from the point i
0008 %
0009 % ---- Table [[ old indices  (whole brain) -> new indices (subregion) ]]
0010 % Itrans(i)=0 : old index = i is not included in the new index set
0011 % Itrans(i)=j : old index = i is correspond to new index = j
0012 % jx = Itrans(ix) : Transform old index ix to new index jx
0013 %
0014 % Ver 1.0 written by M. Sato  2003-3-15
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 Nvertex  = length(Vindx);
0020 Nall     = size(nextDD,1);
0021 
0022 nextIXnew  = cell(Nvertex,1);
0023 nextDDnew  = cell(Nvertex,1);
0024 
0025 Itrans          = zeros(Nall,1);
0026 Itrans(Vindx) = 1:Nvertex;
0027 
0028 for i=1:Nvertex,
0029     ix       = Vindx(i);
0030     
0031     inext  = nextIX{ix};
0032     nextdd = nextDD{ix};
0033     
0034     jnext  = Itrans(inext);
0035     indx   = find( jnext ~= 0 );
0036     
0037     nextIXnew{i} = jnext(indx);
0038     nextDDnew{i} = nextdd(indx);
0039 end;

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005