Home > vbmeg > demo > test_scripts > sbi > load_sbi_sensor.m

load_sbi_sensor

PURPOSE ^

Load MEG sensor coordinate

SYNOPSIS ^

function [pick,Qpick,Wsensor,Vcenter] = load_sbi_sensor(megfile)

DESCRIPTION ^

 Load MEG sensor coordinate

 Usage:
 [pick, Qpick, CoilWeight, Vcenter] = load_sbi_sensor(megfile);

 [IN]
    megfile : meg-mat file
 [OUT]
    pick(1:n,1:3)     : corresponding to pick(n, 1:3) in SBI-sensor format. 
                        (position of detector coils)
        (n+1:2n, 1:3) : corresponding to pick(n, 4:6) in SBI-sensor format. 
                        (position of conpensation detector coils) 
    Qpick(1:2n, 1:3)  : corresponding to pick(n, 4:6) in SBI-sensor format.
                        (direction of coils)
    CoilWeight        : (m,n) n-th coil weight for m-th sensor channel
                  basis(channel,dipole) = sensor_weight * basis(coil,dipole)
    Vcenter           : % origin of sphere model [m]

 ---- SBI-sensor format

 - pick(n, 1:3): 検出コイル位置, 
 - pick(n, 4:6): 補償コイル位置, 
 - pick(n, 7:9): コイル方向
 - Vcenter     : 球モデル中心座標 (SBI header file に書かれている)

 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 [pick,Qpick,Wsensor,Vcenter] = load_sbi_sensor(megfile)
0002 % Load MEG sensor coordinate
0003 %
0004 % Usage:
0005 % [pick, Qpick, CoilWeight, Vcenter] = load_sbi_sensor(megfile);
0006 %
0007 % [IN]
0008 %    megfile : meg-mat file
0009 % [OUT]
0010 %    pick(1:n,1:3)     : corresponding to pick(n, 1:3) in SBI-sensor format.
0011 %                        (position of detector coils)
0012 %        (n+1:2n, 1:3) : corresponding to pick(n, 4:6) in SBI-sensor format.
0013 %                        (position of conpensation detector coils)
0014 %    Qpick(1:2n, 1:3)  : corresponding to pick(n, 4:6) in SBI-sensor format.
0015 %                        (direction of coils)
0016 %    CoilWeight        : (m,n) n-th coil weight for m-th sensor channel
0017 %                  basis(channel,dipole) = sensor_weight * basis(coil,dipole)
0018 %    Vcenter           : % origin of sphere model [m]
0019 %
0020 % ---- SBI-sensor format
0021 %
0022 % - pick(n, 1:3): 検出コイル位置,
0023 % - pick(n, 4:6): 補償コイル位置,
0024 % - pick(n, 7:9): コイル方向
0025 % - Vcenter     : 球モデル中心座標 (SBI header file に書かれている)
0026 %
0027 % Copyright (C) 2011, ATR All Rights Reserved.
0028 % License : New BSD License(see VBMEG_LICENSE.txt)
0029 
0030 
0031 fprintf('MEG file: %s\n', megfile);
0032 
0033 MEGinfo = vb_load_meg_info([megfile]);
0034 load([megfile],'pick');
0035 
0036 if isfield(MEGinfo,'Vcenter'),
0037     Vcenter = MEGinfo.Vcenter;
0038 else
0039     load([megfile],'Vcenter');
0040 end
0041 
0042 Nchannel = size(pick,1);
0043 Ncoil    = 2*Nchannel;
0044 
0045 pick1 = [ pick(:,1:3)];    % センサー位置1
0046 pick2 = [ pick(:,4:6)];    % センサー位置2
0047 Qpick = [ pick(:,7:9)];    % センサー方向
0048 
0049 pick  = [pick1; pick2];
0050 Qpick = [Qpick; Qpick];
0051 
0052 n_channel = 1:Nchannel;
0053 n_channel = [n_channel , n_channel];
0054 n_weight  = [ones(1,Nchannel) , - ones(1,Nchannel)];
0055 
0056 % Coil -> Channel matrix
0057 Wsensor = sparse( n_channel, [1:Ncoil], n_weight, Nchannel, Ncoil);
0058 
0059 % channel output from coil leadfield
0060 % basis(channel,dipole) = Wsensor * basis(coil,dipole)
0061 
0062 return

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