return refference magnetometer data which is stored on megfile [usage] [refmg] = megfile_get_keeping_data_ref(megfile) [input] megfile : <required> <<file>> MEG-MAT file [output] ref_data : refference magnetometer data which is stored in refmg field : [Nchannel x Nsample x Ntrial] [note] If megfile is old, it may not have 'refmg' field. Then return empty. This function does not return data selected in sample or trial [history] 2008-02-19 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [ref_data] = vb_megfile_get_internal_data_ref(megfile) 0002 % return refference magnetometer data which is stored on megfile 0003 % [usage] 0004 % [refmg] = megfile_get_keeping_data_ref(megfile) 0005 % [input] 0006 % megfile : <required> <<file>> MEG-MAT file 0007 % [output] 0008 % ref_data : refference magnetometer data which is stored in refmg field 0009 % : [Nchannel x Nsample x Ntrial] 0010 % [note] 0011 % If megfile is old, it may not have 'refmg' field. Then return empty. 0012 % This function does not return data selected in sample or trial 0013 % [history] 0014 % 2008-02-19 (Sako) initial version 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('megfile', 'var'), megfile = []; end 0021 [megfile] = inner_check_arguments(megfile); 0022 0023 % --- MAIN PROCEDURE --------------------------------------------------------- % 0024 % 0025 load(megfile, 'refmg'); 0026 0027 % - for old fashioned 0028 if ~exist('refmg', 'var') 0029 refmg = inner_exstract_from_eeg(megfile); 0030 end 0031 0032 ref_data = refmg; 0033 return; 0034 % 0035 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0036 0037 % --- INNER FUNCTIONS -------------------------------------------------------- % 0038 % 0039 % --- inner_check_arguments() 0040 % 0041 function [megfile] = inner_check_arguments(megfile) 0042 func_ = mfilename; 0043 0044 if isempty(megfile) 0045 error('(%s)megfile is a required parameter', func_); 0046 end 0047 0048 if exist(megfile, 'file') ~= 2 0049 error('(%s)cannot find megfile : %s', func_, megfile); 0050 end 0051 return; 0052 % 0053 % --- end of inner_check_arguments() 0054 0055 % --- inner_extract_from_eeg() 0056 % 0057 function [refmg] = inner_exstract_from_eeg(megfile) 0058 % no support 0059 refmg = []; 0060 return; 0061 % 0062 % --- end of inner_extract_from_eeg() 0063 % 0064 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0065 0066 %%% END OF FILE %%%