Home > GVSToolbox > 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 
0025 % % % scale eye tracks(using default value ), calculate fixations
0026 % % [ eyePos ] = scaleEyeTrack( eyePos,  [] );
0027 % % [ saccadeVec startSacPos endSacPos ] = codeSaccades( eyePos);
0028 
0029 
0030 numFixation = size(endSacPos,2);
0031 numSamples = length( saccadeVec );
0032 latency = numSamples;
0033 
0034 for i1 = 1:numFixation  
0035     dist = calc2Dist( endSacPos(:,i1), aoiCenter); % 2-norm
0036     [minDist minIdx] = min( dist);    
0037     if minDist < maxDist && sum(minIdx == AOIsOfInterest)
0038          latency = find(  saccadeVec == i1 );
0039          latency = latency(end);  %/numSamples; % look at end of saccade
0040          break;
0041     end       
0042 
0043 end
0044 
0045 
0046 
0047     
0048

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