Home > src > calcLatencyRelAOISacDist.m

calcLatencyRelAOISacDist

PURPOSE ^

get latency until relevant AOI is saccade target

SYNOPSIS ^

function latency =calcLatencyRelAOISacDist( sacStruct, aoiCenter, maxDist, AOIsOfInterest )

DESCRIPTION ^

 get latency until relevant AOI is saccade target
 
 Syntax: latency =calcLatencyRelAOISac( 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 is saccade target
0002 %
0003 % Syntax: latency =calcLatencyRelAOISac( 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 =calcLatencyRelAOISacDist( sacStruct, aoiCenter, maxDist, AOIsOfInterest ) 
0017 
0018 
0019 
0020 saccadeVec = sacStruct.saccadeVec;
0021 % % startSacPos = sacStruct.startSacPos;
0022 endSacPos = sacStruct.endSacPos;
0023 
0024 numFixation = size(endSacPos,2);
0025 numSamples = length( saccadeVec );
0026 latency = numSamples;
0027 
0028 for i1 = 1:numFixation  
0029     dist = calc2Dist( endSacPos(:,i1), aoiCenter); % 2-norm
0030     [minDist minIdx] = min( dist);    
0031     if minDist < maxDist && sum(minIdx == AOIsOfInterest)
0032          latency = find(  saccadeVec == i1 );
0033          latency = latency(end);  %/numSamples; % look at end of saccade
0034          break;
0035     end       
0036 
0037 end
0038 
0039 
0040 
0041     
0042

Generated on Wed 20-Jan-2016 11:50:43 by m2html © 2005