Home > functions > common > boundary > vb_separate_LR_cortex.m

vb_separate_LR_cortex

PURPOSE ^

SYNOPSIS ^

function [V,F,xx] = vb_separate_LR_cortex(vert,face)

DESCRIPTION ^

 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    [V,F,xx] = vb_separate_LR_cortex(vert,face)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 [Fall, Vall] = vb_separate_surf(face,vert);
0007 % Vall{n} : vertex of n-th connected surface
0008 % Fall{n} : patch index of n-th connected surface
0009 
0010 V1 = Vall{1};
0011 V2 = Vall{2};
0012 F1 = Fall{1};
0013 F2 = Fall{2};
0014 
0015 % normal vector
0016 [xx1 ,F1] = vb_out_normal_vect(V1,F1);
0017 [xx2 ,F2] = vb_out_normal_vect(V2,F2);
0018 
0019 N1 = size(V1,1);
0020 N2 = size(V2,1);
0021 
0022 x1 = mean(V1);
0023 x2 = mean(V2);
0024 
0025 if x1(1) < x2(1),
0026     % V1 is left
0027     V  = [V1 ; V2];
0028     xx = [xx1; xx2];
0029     
0030     F.F3L = F1;
0031     F.F3R = F2 + N1;
0032     F.F3  = [F1 ; F2 + N1];
0033     F.NdipoleL = N1;
0034 else
0035     % V2 is left
0036     V  = [V2 ; V1];
0037     xx = [xx2; xx1];
0038     
0039     F.F3L = F2;
0040     F.F3R = F1 + N2;
0041     F.F3  = [F2 ; F1 + N2];
0042     F.NdipoleL = N2;
0043 end

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