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

readSBI_sensor

PURPOSE ^

[chname,okix] = readSBI_sensor(sqddat,sysid)

SYNOPSIS ^

function [okix,chname,chname0] = readSBI_sensor(sqddat,sysid)

DESCRIPTION ^

[chname,okix] = readSBI_sensor(sqddat,sysid)
 Input: sqddat  % SBIroot directory
        sysid   % System ID  ex. 1000987
                    coordinate transfomation using marker and positioning coil
 Output: 
   okix   : Active sensor index
   chname{ch}     % active sensor name
   chname0{ch}     % all sensor name


 2004-7-22  M.Sato
 2005-11-10  M.Sato
 2005-11-15  Y.Fujiwara

 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 [okix,chname,chname0] = readSBI_sensor(sqddat,sysid)
0002 %[chname,okix] = readSBI_sensor(sqddat,sysid)
0003 % Input: sqddat  % SBIroot directory
0004 %        sysid   % System ID  ex. 1000987
0005 %                    coordinate transfomation using marker and positioning coil
0006 % Output:
0007 %   okix   : Active sensor index
0008 %   chname{ch}     % active sensor name
0009 %   chname0{ch}     % all sensor name
0010 %
0011 %
0012 % 2004-7-22  M.Sato
0013 % 2005-11-10  M.Sato
0014 % 2005-11-15  Y.Fujiwara
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 ier=0;
0020 
0021 %
0022 % --- read SBI header
0023 %
0024 % file info.
0025 fname=sprintf('%shead%s%s.hd',sqddat,filesep,sysid);
0026 fid=fopen(fname,'r','l');
0027 
0028 if fid==-1, disp('XXX Error : Cannot open head file !!\n'); ier=1; return; end
0029 
0030 H_file=meg_hread('file',fid);
0031 
0032 % condition
0033 H_meg    = meg_hread('meg',fid,H_file.i_meg_begin);
0034 nch0    = H_meg.i_nch;
0035 
0036 % all sensors
0037 kind0=[]; lock0=[]; chname0=[];
0038 
0039 for i=1:nch0
0040     H_meg_ch      = meg_hread('meg_ch',fid, ...
0041                        H_file.i_meg_ch_begin+H_file.i_meg_ch_size*(i-1));
0042     kind0(i)      = H_meg_ch.i_pick_type; 
0043     lock0(i)      = H_meg_ch.i_meg_lock;
0044     chname0{i}      = H_meg_ch.c_ch_name;
0045 end
0046 
0047 %
0048 % ---  select active coils and data
0049 %
0050 okix=find(kind0==1 & lock0==0);
0051 
0052 % number of active gardiometers
0053 nch=size(okix,2);  
0054 
0055 chname = cell(1,nch);
0056 for i=1:nch
0057 %    chname{i}=chname0{i};
0058     chname{i}=chname0{okix(i)};
0059 end

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