return acq_info from MEGinfo [usage] [acq_info] = vb_meginfo_get_acqinfo(meg_info) [input] meg_info : <required> <<struct>> MEGinfo struct [output] acq_info : acq_info struct obtained from MEGinfo [note] The new format was defind. (2011-05) [history] 2011-05-26 (Sako) initial version
0001 function [acq_info] = vb_meginfo_get_acqinfo(meg_info) 0002 % return acq_info from MEGinfo 0003 % [usage] 0004 % [acq_info] = vb_meginfo_get_acqinfo(meg_info) 0005 % [input] 0006 % meg_info : <required> <<struct>> MEGinfo struct 0007 % [output] 0008 % acq_info : acq_info struct obtained from MEGinfo 0009 % [note] 0010 % The new format was defind. (2011-05) 0011 % [history] 0012 % 2011-05-26 (Sako) initial version 0013 0014 % --- CHECK ARGUMENTS --- % 0015 if ~exist('meg_info', 'var'), meg_info = []; end 0016 [meg_info] = inner_check_arguments(meg_info); 0017 0018 % --- MAIN PROCEDURE --------------------------------------------------------- % 0019 % 0020 acq_info = []; 0021 0022 if isfield(meg_info, 'device_info') 0023 if isfield(meg_info.device_info, 'acq_info') 0024 acq_info = meg_info.device_info.acq_info; 0025 else 0026 % warning('device_info does not have ''acq_info'' field\n'); 0027 end 0028 else 0029 % --- compatible with old style 0030 if isfield(meg_info, 'acq_info') 0031 acq_info = meg_info.acq_info; 0032 else 0033 % warning('meg_info does not have ''acq_info'' field\n'); 0034 end 0035 end 0036 return; 0037 % 0038 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0039 0040 % --- INNER FUNCTIONS -------------------------------------------------------- % 0041 % 0042 % --- inner_check_arguments() 0043 % 0044 function [meg_info] = inner_check_arguments(meg_info) 0045 func_ = mfilename; 0046 if isempty(meg_info) 0047 error('(%s) meg_info is a required parameter', func_); 0048 end 0049 return; 0050 % 0051 % --- end of inner_check_arguments() 0052 % 0053 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0054 0055 % --- END OF FILE --- %