Home > vbmeg > functions > brain > vb_calc_subj_patch.m

vb_calc_subj_patch

PURPOSE ^

Simple case: Find nearest point from 'VL' to 'VLs'

SYNOPSIS ^

function [Vext,FL,FR] = vb_calc_subj_patch(IL,IR,VLs,FLs,VRs,FRs)

DESCRIPTION ^

 Simple case: Find nearest point from 'VL' to 'VLs'
 [IL, ddL,VLs,FLs] = vb_find_no_overlap_divide(VLs, VL, FLs);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    [Vext,FL,FR] = vb_calc_subj_patch(IL,IR,VLs,FLs,VRs,FRs)
0002 % Simple case: Find nearest point from 'VL' to 'VLs'
0003 % [IL, ddL,VLs,FLs] = vb_find_no_overlap_divide(VLs, VL, FLs);
0004 
0005 % Reference: reduced vertex 'VLs' and patch 'FLs'
0006 % Target: brain model vertex 'VL' correspond to 'VLs(IL,:)'
0007 %
0008 % Copyright (C) 2011, ATR All Rights Reserved.
0009 % License : New BSD License(see VBMEG_LICENSE.txt)
0010 
0011 % number of vertex in 'VL'
0012 NL = length(IL);
0013 NR = length(IR);
0014 % number of all vertex in 'VLs'
0015 NLall = size(VLs, 1);
0016 NRall = size(VRs, 1);
0017 % remainning vertex other than 'IL'
0018 IL_extra = vb_setdiff2([1:NLall],IL);
0019 IR_extra = vb_setdiff2([1:NRall],IR);
0020 
0021 NL_extra = length(IL_extra);
0022 NR_extra = length(IR_extra);
0023 
0024 % reorder of extra vertex
0025 Vext = [VLs(IL_extra,:); VRs(IR_extra,:)]/1000;
0026 Nall = size(Vext,1) + NL + NR;
0027 
0028 if Nall ~= (NLall + NRall),
0029     error('dimension error')
0030 end
0031 
0032 % transform in 'FLs'
0033 % IL -> 1:NL
0034 % IL_extra -> (1:NL_extra) + (NL + NR);
0035 ItransL = zeros(NLall,1);
0036 ItransR = zeros(NRall,1);
0037 
0038 ItransL(IL) = 1:NL;
0039 ItransL(IL_extra) = (1:NL_extra) + (NL + NR);
0040 
0041 ItransR(IR) = (1:NR) + NL;
0042 ItransR(IR_extra) = (1:NR_extra) + (NL + NR + NL_extra);
0043 
0044 FL = ItransL(FLs);
0045 FR = ItransR(FRs);
0046 
0047 ix = find( FL(:,1).*FL(:,2).*FL(:,3) > 0);
0048 FL = FL(ix,:);
0049 
0050 ix = find( FR(:,1).*FR(:,2).*FR(:,3) > 0);
0051 FR = FR(ix,:);
0052

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