0001 function [channel_arrays,group_names] = arrays(array_flag,bad_chan);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 if strcmp(array_flag,'oned')
0014 [xelec,yelec,zelec] = electrodes(129);
0015 twod_dist = twod_pos(xelec,yelec,zelec,9.2);
0016 ch_pair_indices;
0017 channel_arrays = [18 23 27 34 40 46 50 58 65 71;19 24 28 35 41 47 51 59 66 72;20 25 29 36 42 48 52 60 67 0; 12 21 30 37 43 53 61 0 0 0; 16 11 6 129 55 62 68 73 0 0; 5 119 112 105 94 87 79 0 0 0; 4 124 118 111 104 99 93 86 78 0; 10 3 123 117 110 103 98 92 85 77; 15 9 2 122 116 109 102 97 91 84];
0018 group_names = ['L1';'L2';'L3';'L4'; 'M0';'R4';'R3';'R2';'R1'];
0019 elseif strcmp(array_flag,'quadrant')
0020
0021 channel_arrays = [1 2 3 4 5 8 9 10 14 15 121 122 123 124 119 113 107 116 117 118 110 111 112 104 105 106;81 88 94 99 103 80 87 93 98 102 79 86 92 97 101 78 85 91 96 77 84 90 83 0 0 0; 32 38 43 48 47 46 50 51 52 53 54 57 58 59 60 61 64 65 66 67 70 71 72 75 0 0; 22 18 23 19 26 27 24 20 12 33 39 34 28 25 21 7 35 29 30 31 36 37 40 41 42 0];
0022 group_names = ['RA'; 'RP'; 'LP'; 'LA'];
0023
0024 elseif strcmp(array_flag,'hemisphere')
0025 channel_arrays = [1 2 3 4 5 8 9 10 14 15 121 122 123 124 119 113 107 116 117 118 110 111 112 104 105 106 81 88 94 99 103 80 87 93 98 102 79 86 92 97 101 78 85 91 96 77 84 90 83; 32 38 43 48 47 46 50 51 52 53 54 57 58 59 60 61 64 65 66 67 70 71 72 75 22 18 23 19 26 27 24 20 12 33 39 34 28 25 21 7 35 29 30 31 36 37 40 41 42];
0026 group_names = ['R'; 'L'];
0027
0028 elseif strcmp(array_flag, 'all')
0029 channel_arrays = [1 2 3 4 5 8 9 10 14 15 121 122 123 124 119 113 107 116 117 118 110 111 112 104 105 106 81 88 94 99 103 80 87 93 98 102 79 86 92 97 101 78 85 91 96 77 84 90 83 32 38 43 48 47 46 50 51 52 53 54 57 58 59 60 61 64 65 66 67 70 71 72 75 22 18 23 19 26 27 24 20 12 33 39 34 28 25 21 7 35 29 30 31 36 37 40 41 42];
0030 group_names = 'A';
0031 elseif strcmp(array_flag, 'frontback')
0032 channel_arrays2 = [1 2 3 4 5 8 9 10 14 15 121 122 123 124 119 113 107 116 117 118 110 111 112 104 105 106;81 88 94 99 103 80 87 93 98 102 79 86 92 97 101 78 85 91 96 77 84 90 83 0 0 0; 32 38 43 48 47 46 50 51 52 53 54 57 58 59 60 61 64 65 66 67 70 71 72 75 0 0; 22 18 23 19 26 27 24 20 12 33 39 34 28 25 21 7 35 29 30 31 36 37 40 41 42 0];
0033 group_names = ['AN'; 'PO'];
0034 channel_arrays = [channel_arrays2(1,:) channel_arrays2(4,:); channel_arrays2(2,:) channel_arrays2(3,:)];
0035 elseif strcmp(array_flag, 'aug_oned')
0036 channel_arrays = [19 24 28 35 41 47 51 59 66 72 20 25 29 36 42 48 52 60 67 0 0 0; 12 21 30 37 43 53 61 16 11 6 129 55 62 68 73 5 119 112 105 94 87 79; 4 124 118 111 104 99 93 86 78 10 3 123 117 110 103 98 92 85 77 0 0 0];
0037 group_names = ['L';'M';'R'];
0038 else
0039 error('unknown array');
0040
0041 end;
0042
0043 for i = 1:size(channel_arrays,1)
0044 temp = zeros(1,size(find(channel_arrays(i,:)),2));
0045 temp = channel_arrays(i,find(channel_arrays(i,:)));
0046 mask = zeros(1,129);
0047 mask(temp) = ones(1,size(temp,2));
0048 mask(bad_chan) = zeros(1,size(bad_chan,2));
0049 temp2 = zeros(1,size(find(mask),2));
0050 temp2 = find(mask);
0051 channel_arrays(i,:) = zeros(1,size(channel_arrays,2));
0052 channel_arrays(i,1:size(temp2,2)) = temp2;
0053 end;
0054
0055
0056