Home > vbmeg > functions > tool_box > atlas2vb_dir > vb_fill_atlas_label.m

vb_fill_atlas_label

PURPOSE ^

Fill label referring neighbor point label along cortex

SYNOPSIS ^

function Vlabel = vb_fill_atlas_label(brainfile, Vlabel, ix, Rlimit)

DESCRIPTION ^

 Fill label referring neighbor point label along cortex
  Vlabel = fill_label(brainfile, Vlabel, ix, Rlimit)

  Vlabel : label for each vertex point
  ix     : unlabeld vertex index
  Rlimit : max radius referring neighbor point
  brainfile : brain file name

 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    Vlabel = vb_fill_atlas_label(brainfile, Vlabel, ix, Rlimit)
0002 % Fill label referring neighbor point label along cortex
0003 %  Vlabel = fill_label(brainfile, Vlabel, ix, Rlimit)
0004 %
0005 %  Vlabel : label for each vertex point
0006 %  ix     : unlabeld vertex index
0007 %  Rlimit : max radius referring neighbor point
0008 %  brainfile : brain file name
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 [nextDD,nextIX] = vb_load_cortex_neighbour(brainfile);
0014 
0015 NV  = length(Vlabel);
0016 flg = zeros(NV,1);
0017 
0018 flg(ix) = 1;
0019 Vlabel(ix) = 0;
0020 N = length(ix);
0021 
0022 Nmax = 2*N;
0023 cnt  = 0;
0024 
0025 while N > 0
0026     for n=1:N
0027         j  = ix(n);
0028         dd = nextDD{j};
0029         jj = nextIX{j};
0030         val = Vlabel(jj);
0031         
0032         jx = find( val > 0 );
0033         [dmin, jmin] = min( dd(jx) );
0034         
0035         if dmin < Rlimit
0036             Vlabel(j) = val(jx(jmin));
0037             flg(j)=0;
0038         end
0039     end
0040     
0041     ix = find( flg > 0 );
0042     N = length(ix);
0043     cnt = cnt + 1;
0044     if cnt > Nmax, break; end
0045 end
0046

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