Home > vbmeg > functions > common > loadfunc > subdirectory > vb_load_cortex_neighbour.m

vb_load_cortex_neighbour

PURPOSE ^

Load neighbour data of the brain file.

SYNOPSIS ^

function [nextDD,nextIX] = vb_load_cortex_neighbour(brainfile, coord_type)

DESCRIPTION ^

 Load neighbour data of the brain file. 
 ---
 function [nextDD,nextIX] = vb_load_cortex_neighbour(brainfile) 

 --- Input
 brainfile: .brain.mat file
 --- Optional input
 coord_type : load data specification 
              = 'std' : standard brain (nextIX, nextDD, xx).  (Default)
                        If the specified brainfile is V1 format, 
                          Individual brain data is loaded.
              = 'subj': Individual brain (subj.nextIX, nextDD).
 --- Output
 nextDD{n}   : Distance to neighbour points at n-th vertex
 nextIX{n}   : Indices of neighbour points at n-th vertex

 --- History
 2005-08-19 Taku Yoshioka
 2017-03-15 rhayashi       Added coord_type
 ---

 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 [nextDD,nextIX] = vb_load_cortex_neighbour(brainfile, coord_type) 
0002 % Load neighbour data of the brain file.
0003 % ---
0004 % function [nextDD,nextIX] = vb_load_cortex_neighbour(brainfile)
0005 %
0006 % --- Input
0007 % brainfile: .brain.mat file
0008 % --- Optional input
0009 % coord_type : load data specification
0010 %              = 'std' : standard brain (nextIX, nextDD, xx).  (Default)
0011 %                        If the specified brainfile is V1 format,
0012 %                          Individual brain data is loaded.
0013 %              = 'subj': Individual brain (subj.nextIX, nextDD).
0014 % --- Output
0015 % nextDD{n}   : Distance to neighbour points at n-th vertex
0016 % nextIX{n}   : Indices of neighbour points at n-th vertex
0017 %
0018 % --- History
0019 % 2005-08-19 Taku Yoshioka
0020 % 2017-03-15 rhayashi       Added coord_type
0021 % ---
0022 %
0023 % Copyright (C) 2011, ATR All Rights Reserved.
0024 % License : New BSD License(see VBMEG_LICENSE.txt)
0025 
0026 if ~exist('coord_type', 'var')
0027     coord_type = 'std';
0028 end
0029 
0030 switch(lower(coord_type))
0031     case 'std'
0032         load(brainfile,'nextDD','nextIX');
0033     case 'subj'
0034         warning('off', 'MATLAB:load:variableNotFound');
0035         load(brainfile, 'subj');
0036         warning('on',  'MATLAB:load:variableNotFound');
0037         if exist('subj', 'var')
0038             % V2.x format
0039             if ~isfield(subj, 'nextDD')
0040                 % V2.0 format
0041                 load(brainfile, 'nextDD', 'nextIX');
0042             else
0043                 % V2.1 format
0044                 nextDD = subj.nextDD;
0045                 nextIX = subj.nextIX;
0046             end
0047         else
0048             % V1 format
0049             load(brainfile,'nextDD','nextIX');
0050         end
0051     otherwise
0052         error('Unknown coord_type is specified.');
0053 end

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