Load leadfileld matrix. [syntax] [basis,Norient]=vb_load_basis(basisfile) [input] basisfile : <<string>> Leadfield file (.basis.mat) patch_norm: <optional> <<bool>> If true, leadfield is multiplied by patch area. brainfile : <optional> <<string>> Brain file, necessary if patch_norm is ON. [output] basis : <<matrix>> Leadfield matrix. basis( Norient * Nvertex , Npick) basis( n, k ) : k-th sensor magnetic field for dipole current at n-th dipole. Norient: <<int>> Number of independent current orientation. 2010-11-15 Taku Yoshioka Comment modified. 2022-04-27 Y. Takeda Added option for patch_norm = ON Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [basis,Norient]=vb_load_basis(basisfile,patch_norm,brainfile); 0002 % Load leadfileld matrix. 0003 % 0004 % [syntax] 0005 % [basis,Norient]=vb_load_basis(basisfile) 0006 % 0007 % [input] 0008 % basisfile : <<string>> Leadfield file (.basis.mat) 0009 % patch_norm: <optional> <<bool>> If true, leadfield is multiplied by patch area. 0010 % brainfile : <optional> <<string>> Brain file, necessary if patch_norm is ON. 0011 % 0012 % [output] 0013 % basis : <<matrix>> Leadfield matrix. 0014 % basis( Norient * Nvertex , Npick) 0015 % basis( n, k ) : k-th sensor magnetic field for dipole current 0016 % at n-th dipole. 0017 % Norient: <<int>> Number of independent current orientation. 0018 % 0019 % 2010-11-15 Taku Yoshioka 0020 % Comment modified. 0021 % 2022-04-27 Y. Takeda 0022 % Added option for patch_norm = ON 0023 % 0024 % Copyright (C) 2011, ATR All Rights Reserved. 0025 % License : New BSD License(see VBMEG_LICENSE.txt) 0026 0027 0028 s = load(basisfile); 0029 0030 % extra dipole basis 0031 if isfield(s, 'extra_basis_parm') 0032 Norient = 3; 0033 basis = s.basis; 0034 return; 0035 else 0036 % basis 0037 Norient = s.basis_parm.Basis_mode; 0038 0039 if exist('patch_norm', 'var') & patch_norm==ON, 0040 [tmp1,tmp2,tmp3,tmp4,xxA] = vb_load_cortex(brainfile, 'subj'); 0041 S = repmat(xxA, Norient, size(s.basis, 2)); 0042 basis = s.basis.*S; 0043 else 0044 basis = s.basis; 0045 end 0046 end 0047