receive a demand to mark trigger [usage] vb_mark_trigger( ... msrmnt_file, target_list, to_read_swt, output_file, auto_info) [input] msrmnt_file : <required> : MAT file which includes next information : : - data (Nchannel x Nsample) <must> : - base channel list <must> : - sample_frequency <if needed> : e.g. EEG-MAT (.eeg.mat), MEG-MAT (.meg.mat) target_list : <optional> [[]] : list of used channel label : "base channel list" must have these channels to_read_swt : <optional> [false] : switch that "target_list" is whether to read or not : true or false : error if "to_read_swt" is true and "target_channel_list" is empty output_file : <optional> ['./trigger_list.mat'] auto_info : <optional> <<struct>> [[]] : information for auto marking : - auto_detect : get trigger label by auto-detect : : true or false [false] : : (highest priority) : - trigger_channel : trigger channel label of "base channel list" : - trigger_file : MAT file which includes trigger information : - how : how to get triggers : : 'FULL' or 'SEMI' or 'FILE' or 'MANUAL' : : this field shoud be set in this function [output] none [note] See alse vb_do_mark_trigger [history] 2007-01-10 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function vb_mark_trigger( ... 0002 msrmnt_file, target_list, to_read_swt, output_file, auto_info) 0003 % receive a demand to mark trigger 0004 % 0005 % [usage] 0006 % vb_mark_trigger( ... 0007 % msrmnt_file, target_list, to_read_swt, output_file, auto_info) 0008 % 0009 % [input] 0010 % msrmnt_file : <required> 0011 % : MAT file which includes next information : 0012 % : - data (Nchannel x Nsample) <must> 0013 % : - base channel list <must> 0014 % : - sample_frequency <if needed> 0015 % : e.g. EEG-MAT (.eeg.mat), MEG-MAT (.meg.mat) 0016 % target_list : <optional> [[]] 0017 % : list of used channel label 0018 % : "base channel list" must have these channels 0019 % to_read_swt : <optional> [false] 0020 % : switch that "target_list" is whether to read or not 0021 % : true or false 0022 % : error if "to_read_swt" is true and "target_channel_list" is empty 0023 % output_file : <optional> ['./trigger_list.mat'] 0024 % auto_info : <optional> <<struct>> [[]] 0025 % : information for auto marking 0026 % : - auto_detect : get trigger label by auto-detect 0027 % : : true or false [false] 0028 % : : (highest priority) 0029 % : - trigger_channel : trigger channel label of "base channel list" 0030 % : - trigger_file : MAT file which includes trigger information 0031 % : - how : how to get triggers 0032 % : : 'FULL' or 'SEMI' or 'FILE' or 'MANUAL' 0033 % : : this field shoud be set in this function 0034 % 0035 % [output] 0036 % none 0037 % 0038 % [note] 0039 % See alse 0040 % vb_do_mark_trigger 0041 % 0042 % [history] 0043 % 2007-01-10 (Sako) initial version 0044 % 0045 % Copyright (C) 2011, ATR All Rights Reserved. 0046 % License : New BSD License(see VBMEG_LICENSE.txt) 0047 0048 vb_define_device; 0049 0050 % --- CHECK ARGUMENTS --- % 0051 if ~exist('msrmnt_file', 'var'), msrmnt_file = []; end; 0052 if ~exist('target_list', 'var'), target_list = []; end; 0053 if ~exist('to_read_swt', 'var'), to_read_swt = []; end; 0054 if ~exist('output_file', 'var'), output_file = []; end; 0055 if ~exist('auto_info', 'var'), auto_info = []; end; 0056 0057 [msrmnt_file, target_list, to_read_swt, output_file, auto_info] = ... 0058 inner_check_arguments( ... 0059 msrmnt_file, target_list, to_read_swt, output_file, auto_info); 0060 0061 % --- MAIN PROCEDURE --------------------------------------------------------- % 0062 % 0063 % === 0064 % switch auto_info.how 0065 % case TRIGGER_HOW_FULL 0066 % [bit_list] = msrmnt_get_valid_trigger_bit_list(msrmnt_file); 0067 % otherwise 0068 % % nothing to do here 0069 % end 0070 0071 my_spec = vb_util_make_mark_trigger_spec(msrmnt_file, ... 0072 target_list, to_read_swt, output_file, auto_info); 0073 0074 vb_do_mark_trigger(my_spec); 0075 0076 % === 0077 % my_spec = vb_util_make_mark_trigger_spec( ... 0078 % msrmnt_file, target_list, to_read_swt, output_file, auto_info); 0079 % 0080 % mark_trigger(my_spec); 0081 % 0082 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0083 0084 0085 % --- INNER FUNCTION --------------------------------------------------------- % 0086 % 0087 % --- inner_check_arguments() 0088 % 0089 function [msrmnt_file,target_list,to_read_swt,output_file,auto_info] = ... 0090 inner_check_arguments( ... 0091 msrmnt_file, target_list, to_read_swt, output_file, auto_info) 0092 0093 vb_define_device; 0094 0095 if isempty(msrmnt_file) 0096 error('msrmnt_file is a required parameter'); 0097 end 0098 0099 % if isempty(target_list) do nothing 0100 0101 if isempty(to_read_swt) 0102 to_read_swt = false; 0103 end 0104 0105 if isempty(output_file) 0106 output_file = ['.' filesep 'trigger_list.mat']; 0107 end 0108 if isempty(auto_info) 0109 auto_info.auto_detect = false; 0110 end 0111 % 0112 % --- end of inner_check_argument() 0113 0114 %%% END OF FILE %%%