Home > GVSToolbox > calcLatencyRelAOIFixDist.m

calcLatencyRelAOIFixDist

PURPOSE ^

get latency until relevant AOI fixated

SYNOPSIS ^

function latency =calcLatencyRelAOIFixDist( fixStruct, aoiCenter, maxDist, AOIsOfInterest )

DESCRIPTION ^

 get latency until relevant AOI fixated
 
 Syntax: latency =calcLatencyRelAOIFix( eyePos, aoiCenter, maxDist, AOIsOfInterest ) 
 
 Inputs:
  eyePos: vector  of complex (x+i*y) coordinates.  -1-i1  to identify
         missing data.  They are in range [ 0 ,1 ]
  aoiCenter: coordinates of AOI in image scale, returned by 'returnAOICenters.m'
  maxDist: returned by  'returnAOICenters.m'
  AOIsOfInterest: index of AOIs which we are interested in
 
 Outputs:
  latency: value between 0 and length of eye track,

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % get latency until relevant AOI fixated
0002 %
0003 % Syntax: latency =calcLatencyRelAOIFix( eyePos, aoiCenter, maxDist, AOIsOfInterest )
0004 %
0005 % Inputs:
0006 %  eyePos: vector  of complex (x+i*y) coordinates.  -1-i1  to identify
0007 %         missing data.  They are in range [ 0 ,1 ]
0008 %  aoiCenter: coordinates of AOI in image scale, returned by 'returnAOICenters.m'
0009 %  maxDist: returned by  'returnAOICenters.m'
0010 %  AOIsOfInterest: index of AOIs which we are interested in
0011 %
0012 % Outputs:
0013 %  latency: value between 0 and length of eye track,
0014 %
0015 
0016 function latency =calcLatencyRelAOIFixDist( fixStruct, aoiCenter, maxDist, AOIsOfInterest ) 
0017 
0018 
0019 fixPosVector = fixStruct.fixPosVector;
0020 fixationVector = fixStruct.fixationVector;
0021 
0022 
0023 % % % initialize some paramters
0024 % % fixationWinSize = 6;
0025 % % fixationThreshold = 15;
0026 % %
0027 % % % scale eye tracks(using default value ), calculate fixations
0028 % % [ eyePos ] = scaleEyeTrack( eyePos,  [] );
0029 % % [ fixationVector P ]  = codeFixations( eyePos, fixationWinSize, fixationThreshold );
0030 
0031 
0032 numFixation = size(fixPosVector,2);
0033 numSamples = length( fixationVector );
0034 latency = numSamples;
0035 
0036 for i1 = 1:numFixation  
0037     dist = calc2Dist( fixPosVector(:,i1), aoiCenter); % 2-norm
0038     [minDist minIdx] = min( dist);    
0039     if minDist < maxDist && sum(minIdx == AOIsOfInterest)
0040          latency = find(  fixationVector == i1 );
0041          latency = latency(1); %/numSamples; % look at beginning of fixation
0042          break;
0043     end       
0044 
0045 end
0046 
0047 
0048 
0049     
0050

Generated on Tue 01-Jul-2014 12:35:04 by m2html © 2005