--- Input sys_dir : MEG data dir sys_id : MEG system ID eeg_info : MEG header info --- Optional Input param.time_win = [Tstart Tend]: [ms] param.trials = trial index to extract --- Output: eeg_info : structure with following field .nch, % number of EEG channel .nsamp, % sampling number of measurement .nrept, % repeat number .sampf, % sampling frequency .ch_name % channel name .ad_factor % AD multiplicative factor to convert EEG data to [V] eeg( Nchannel, Tsample, Nrepeat) % measured fields [T] Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [eeg_info, eeg] = readSBI_eeg(sys_dir,sys_id,param) 0002 % --- Input 0003 % sys_dir : MEG data dir 0004 % sys_id : MEG system ID 0005 % eeg_info : MEG header info 0006 % --- Optional Input 0007 % param.time_win = [Tstart Tend]: [ms] 0008 % param.trials = trial index to extract 0009 % 0010 % --- Output: 0011 % eeg_info : structure with following field 0012 % .nch, % number of EEG channel 0013 % .nsamp, % sampling number of measurement 0014 % .nrept, % repeat number 0015 % .sampf, % sampling frequency 0016 % .ch_name % channel name 0017 % .ad_factor % AD multiplicative factor to convert EEG data to [V] 0018 % 0019 % eeg( Nchannel, Tsample, Nrepeat) % measured fields [T] 0020 % 0021 % Copyright (C) 2011, ATR All Rights Reserved. 0022 % License : New BSD License(see VBMEG_LICENSE.txt) 0023 0024 % 2005-12-22 M. Sato 0025 0026 if ~exist('param','var'), param = []; end; 0027 0028 % 0029 % Read header info 0030 % 0031 eeg_info = read_sbi_eeg_header(sys_dir,sys_id); 0032 0033 if isempty(eeg_info), 0034 eeg = 0; 0035 return; 0036 end; 0037 0038 % 0039 % Read EEG data 0040 % 0041 eeg = read_sbi_eeg_data(sys_dir, sys_id, eeg_info, param); 0042 0043 % 0044 % AD conversion 0045 % 0046 eeg = eeg * eeg_info.ad_factor; 0047