0001 function [data] = vb_trial_extractor_input_multi_pattern(data)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if ~exist('data', 'var')
0017 error('data is a required parameter.');
0018 end
0019
0020
0021
0022
0023 H = data.H;
0024
0025
0026 ex_ch_list = get(H.trigger_channel_listbox, 'String');
0027 if isempty(ex_ch_list), return; end
0028 sl_ch_list = ex_ch_list(get(H.trigger_channel_listbox, 'Value'));
0029 if ~iscellstr(sl_ch_list)
0030 sl_ch_list = {sl_ch_list};
0031 end
0032 Nch_sl = size(sl_ch_list, 1);
0033
0034
0035
0036 table_ix = [];
0037 table_ex_ch_list = data.multi_channel_pattern(:,1);
0038 for k=1:Nch_sl
0039
0040 table_ix = [table_ix; strmatch(sl_ch_list{k}, table_ex_ch_list, 'exact')];
0041 end
0042
0043 if ~isempty(table_ix)
0044 flag_list = [data.multi_channel_pattern{:,2}]';
0045
0046 table_ix_flag_on = find(flag_list == 1);
0047 if isempty(table_ix_flag_on)
0048 flag_on_ch = [];
0049 else
0050 flag_on_ch = table_ex_ch_list(table_ix_flag_on);
0051 end
0052 [flag_on_ch, cancel] = vb_te_channel_selector_new(sl_ch_list, flag_on_ch);
0053 end
0054
0055 if cancel == false
0056 for k=1:length(table_ix)
0057 if ~isempty(flag_on_ch) && ...
0058 ~isempty(strmatch(table_ex_ch_list{table_ix(k)}, flag_on_ch, 'exact'))
0059 data.multi_channel_pattern{table_ix(k), 2} = 1;
0060 else
0061 data.multi_channel_pattern{table_ix(k), 2} = 0;
0062 end
0063 end
0064 end
0065
0066
0067
0068
0069 if nargout ~= 1
0070 error('function caller should receive this object.');
0071 end