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