MEGinfo getter for acquisition condition information [usage] [acq_cond] = vb_meginfo_get_acqcond(meg_info) [input] meg_info : <required> <<struct>> MEG header information [output] acq_cond : acquisition condition information [note] return value is MEGinfo.device_info.acq_info.condition in the latest standard format. [history] 2011-05-26 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [acq_cond] = vb_meginfo_get_acqcond(meg_info) 0002 % MEGinfo getter for acquisition condition information 0003 % 0004 % [usage] 0005 % [acq_cond] = vb_meginfo_get_acqcond(meg_info) 0006 % 0007 % [input] 0008 % meg_info : <required> <<struct>> MEG header information 0009 % 0010 % [output] 0011 % acq_cond : acquisition condition information 0012 % 0013 % [note] 0014 % return value is MEGinfo.device_info.acq_info.condition 0015 % in the latest standard format. 0016 % 0017 % [history] 0018 % 2011-05-26 (Sako) initial version 0019 % 0020 % Copyright (C) 2011, ATR All Rights Reserved. 0021 % License : New BSD License(see VBMEG_LICENSE.txt) 0022 0023 % --- CHECK ARGUMENTS --- % 0024 if ~exist('meg_info', 'var'), meg_info = []; end 0025 [meg_info] = inner_check_arguments(meg_info); 0026 0027 % --- MAIN PROCEDURE --------------------------------------------------------- % 0028 % 0029 acq_cond = []; 0030 if isfield(meg_info, 'device_info') 0031 if isfield(meg_info.device_info, 'acq_info') 0032 if isfield(meg_info.device_info.acq_info, 'condition') 0033 acq_cond = meg_info.device_info.acq_info.condition; 0034 else 0035 % warning('device_info.acq_info does not have ''condition'' field\n'); 0036 end 0037 else 0038 % warning('device_info does not have ''acq_info'' field\n'); 0039 end 0040 else 0041 if isfield(meg_info, 'acq_info') 0042 if isfield(meg_info.acq_info, 'condition') 0043 bit_len = meg_info.acq_info.condition; 0044 else 0045 % warning('acq_info does not have ''condition'' field\n'); 0046 end 0047 else 0048 % warning('meg_info does not have ''acq_info'' field\n'); 0049 end 0050 end 0051 return; 0052 % 0053 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0054 0055 0056 % --- INNER FUNCTIONS -------------------------------------------------------- % 0057 % 0058 % --- inner_check_arguments() 0059 % 0060 function [meg_info] = inner_check_arguments(meg_info) 0061 func_ = mfilename; 0062 if isempty(meg_info) 0063 error('(%s)meg_info is a required parameter', func_); 0064 end 0065 return; 0066 % 0067 % --- end of inner_check_arguments() 0068 % 0069 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0070 0071 % --- END OF FILE --- %