return coordinates of sensor positions [usage] [sensorpos] = vb_eegfile_get_sensor_position(eegfile, active_swt) [input] eegfile : <required> <<file>> EEG-MAT file active_swt : <optional> <<boolean>> [false] active filter switch : true) return only active : false) return all the channels [output] sensorpos : 3D-coordinates of sensor position [Nchannel x 3] [note] @see vb_eeginfo_get_sensor_position [history] 2007-07-17 (Sako) initial version 2008-04-15 (Sako) added active_swt Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [sensorpos] = vb_eegfile_get_sensor_position(eegfile, active_swt) 0002 % return coordinates of sensor positions 0003 % [usage] 0004 % [sensorpos] = vb_eegfile_get_sensor_position(eegfile, active_swt) 0005 % [input] 0006 % eegfile : <required> <<file>> EEG-MAT file 0007 % active_swt : <optional> <<boolean>> [false] active filter switch 0008 % : true) return only active 0009 % : false) return all the channels 0010 % [output] 0011 % sensorpos : 3D-coordinates of sensor position [Nchannel x 3] 0012 % [note] 0013 % @see vb_eeginfo_get_sensor_position 0014 % [history] 0015 % 2007-07-17 (Sako) initial version 0016 % 2008-04-15 (Sako) added active_swt 0017 % 0018 % Copyright (C) 2011, ATR All Rights Reserved. 0019 % License : New BSD License(see VBMEG_LICENSE.txt) 0020 0021 % --- CHECK ARGUMENTS 0022 if ~exist('eegfile', 'var'), eegfile = []; end 0023 if ~exist('active_swt', 'var'), active_swt = []; end 0024 [eegfile, active_swt] = inner_check_arguments(eegfile, active_swt); 0025 0026 % --- MAIN PROCEDURE --------------------------------------------------------- % 0027 % 0028 EEGinfo = vb_load_measurement_info(eegfile); 0029 [sensorpos] = vb_eeginfo_get_sensor_position(EEGinfo, active_swt); 0030 return; 0031 % 0032 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0033 0034 % --- INNER FUNCTIONS -------------------------------------------------------- % 0035 % 0036 % --- inner_check_arguments() 0037 % 0038 function [eegfile, active_swt] = inner_check_arguments(eegfile, active_swt) 0039 func_ = mfilename; 0040 if isempty(eegfile) 0041 error('(%s)eegfile is a required parameter', func_); 0042 end 0043 0044 if exist(eegfile, 'file') ~= 2 0045 error('(%s)cannot find eegfile : %s', func_, eegfile); 0046 end 0047 0048 if isempty(active_swt) 0049 active_swt = false; 0050 end 0051 return; 0052 % 0053 % --- end of inner_check_arguments() 0054 % 0055 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0056 0057 %%% END OF FILE %%%