convert the fixation or saccade sequence to a representation in terms of relevant and irrelevant AOIs Syntax: sequence = calcIrrRelSeq( AOISequence, relAOIs ) Inputs: AOISequence: matrix (numAOI x number in sequence) with an indicator (1) for in each column corresponding to the AOI of interest. If no AOI, it will be all 0; relAOIs: index of AOIs which we are interested in Outputs: sequence: matrix ( 2 x numSeq ) where each column corresponds to an AOI visit. first row is 1 if relevant, 2nd is 1 of irrelevant, and both are 0 if no AOIs visited.
0001 % convert the fixation or saccade sequence to a representation in terms of relevant and irrelevant AOIs 0002 % 0003 % Syntax: sequence = calcIrrRelSeq( AOISequence, relAOIs ) 0004 % 0005 % Inputs: 0006 % AOISequence: matrix (numAOI x number in sequence) with an indicator (1) for 0007 % in each column corresponding to the AOI of interest. If no 0008 % AOI, it will be all 0; 0009 % 0010 % relAOIs: index of AOIs which we are interested in 0011 % 0012 % Outputs: 0013 % sequence: matrix ( 2 x numSeq ) where each column corresponds to an AOI 0014 % visit. first row is 1 if relevant, 2nd is 1 of irrelevant, and 0015 % both are 0 if no AOIs visited. 0016 % 0017 0018 function sequence =calcIrrRelSeq( AOISequence, relAOIs ) 0019 0020 0021 numInSeq = size(AOISequence,2); 0022 sequence = zeros( 2, numInSeq ); 0023 0024 for i1 = 1:numInSeq 0025 % if an AOI look found, check if relevant or irrelevant 0026 if sum( AOISequence(:,i1)) 0027 aoiIdx = find(AOISequence(:,i1) ==1 ); 0028 if sum( aoiIdx == relAOIs ) 0029 sequence( 1,i1) = 1; 0030 else 0031 sequence( 2,i1) = 1; 0032 end 0033 end 0034 end 0035 0036