Home > vbmeg > functions > brain > vb_cortex_area_index.m

vb_cortex_area_index

PURPOSE ^

Find left/right cortex indices of brain model 'V' of VBMEG.

SYNOPSIS ^

function [cortexL, cortexR] = vb_cortex_area_index(Vinfo,Vindex,IndxL,IndxR)

DESCRIPTION ^

 Find left/right cortex indices of brain model 'V' of VBMEG.
 [Input]
    Vinfo.NdipoleL0 : The number of vertices of original left brain model.
         .NdipoleR0 : The number of vertices of origianl right brain model.
         .NdipoleL  : The number of vertices of VBMEG left brain.
         .NdipoleR  : The number of vertices of VBMEG right brain.
    Vindex.cortexL  : Indices representing Cortex in original left brain model.
          .cortexR  : Indices representing Cortex in original right brain model.
    IndxL           : Indices of original left brain model corresponding to 
                      the left brain model of VBMEG.
    IndxR           : Indices of original right brain model corresponding to 
                      the right brain model of VBMEG.
 [Output]
    cortexL : Indices of Cortex in brain model 'V' of VBMEG.
    cortexR : Indices of Cortex in brain model 'V' of VBMEG.

 [Note]
    The left and right brain models are managed separately.

 [History]
    2017-03-15 M.Sato

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    [cortexL, cortexR] = vb_cortex_area_index(Vinfo,Vindex,IndxL,IndxR)
0002 % Find left/right cortex indices of brain model 'V' of VBMEG.
0003 % [Input]
0004 %    Vinfo.NdipoleL0 : The number of vertices of original left brain model.
0005 %         .NdipoleR0 : The number of vertices of origianl right brain model.
0006 %         .NdipoleL  : The number of vertices of VBMEG left brain.
0007 %         .NdipoleR  : The number of vertices of VBMEG right brain.
0008 %    Vindex.cortexL  : Indices representing Cortex in original left brain model.
0009 %          .cortexR  : Indices representing Cortex in original right brain model.
0010 %    IndxL           : Indices of original left brain model corresponding to
0011 %                      the left brain model of VBMEG.
0012 %    IndxR           : Indices of original right brain model corresponding to
0013 %                      the right brain model of VBMEG.
0014 % [Output]
0015 %    cortexL : Indices of Cortex in brain model 'V' of VBMEG.
0016 %    cortexR : Indices of Cortex in brain model 'V' of VBMEG.
0017 %
0018 % [Note]
0019 %    The left and right brain models are managed separately.
0020 %
0021 % [History]
0022 %    2017-03-15 M.Sato
0023 
0024 
0025 % Cortex flag of original surface
0026 flgL = zeros(Vinfo.NdipoleL0,1);
0027 flgR = zeros(Vinfo.NdipoleR0,1);
0028 
0029 % Set Cortex area
0030 flgL(Vindex.cortexL) = 1;
0031 flgR(Vindex.cortexR) = 1;
0032 
0033 % Transform table from Original surface to Reduced surface
0034 tblL = zeros(Vinfo.NdipoleL0,1);
0035 tblR = zeros(Vinfo.NdipoleR0,1);
0036 
0037 % Set selected reduced area
0038 tblL(IndxL) = 1:Vinfo.NdipoleL;
0039 tblR(IndxR) = 1:Vinfo.NdipoleR;
0040 
0041 % Get cortex area in Reduced surface
0042 ixL  = find( tblL .* flgL > 0);
0043 ixR  = find( tblR .* flgR > 0);
0044 
0045 % Cortex index in Reduced surface
0046 cortexL = tblL(ixL);
0047 cortexR = tblR(ixR) + Vinfo.NdipoleL;

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