Skip to content

Commit 1cf1a6d

Browse files
committed
update eyetrackers
1 parent 4120833 commit 1cf1a6d

File tree

5 files changed

+76
-5
lines changed

5 files changed

+76
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*DS_Store
22

33
*.m~
4+
*.asv
45
*octave-workspace
56

67
# exclude content of logfiles folders

eyelink_command.m

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
%EYETRACKER
2+
if use_eyelink
3+
4+
el=EyelinkInitDefaults(window);
5+
6+
% Initialization of the connection with the Eyelink Gazetracker.
7+
if (Eyelink('initialize') ~= 0)
8+
error('could not init connection to Eyelink');
9+
return;
10+
end
11+
12+
% Open file to record data to
13+
status=Eyelink('Openfile',edfFile);
14+
if status~=0
15+
status
16+
error('openfile error')
17+
end
18+
19+
% Pass the screen resolution to EyeLink
20+
[width, height]=Screen('WindowSize', screenNumber);
21+
Eyelink('command','screen_pixel_coords = %ld %ld %ld %ld', 0, 0, width-1, height-1);
22+
Eyelink('message', 'DISPLAY_COORDS %ld %ld %ld %ld', 0, 0, width-1, height-1);
23+
24+
% Set calibration type.
25+
Eyelink('command', 'calibration_type = HV5');
26+
27+
% Get EyeLink version
28+
[v, vs]=Eyelink('GetTrackerVersion');
29+
fprintf(fidTime,'Running experiment on a %s tracker.\n', vs );
30+
31+
% Set event and sample filters (i.e. what will be recorded in the output file)
32+
Eyelink('command', 'file_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,INPUT');
33+
Eyelink('command', 'file_sample_data = LEFT,RIGHT,GAZE,HREF,AREA,GAZERES,STATUS,INPUT');
34+
% set link data (used for gaze cursor)
35+
Eyelink('command', 'link_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,FIXUPDATE,INPUT');
36+
Eyelink('command', 'link_sample_data = LEFT,RIGHT,GAZE,GAZERES,AREA,STATUS,INPUT');
37+
38+
% Change camera setup options
39+
% set pupil Tracking model in camera setup screen
40+
% no = centroid. yes = ellipse
41+
Eyelink('command', 'use_ellipse_fitter = no');
42+
% set sample rate in camera setup screen
43+
Eyelink('command', 'sample_rate = %d',1000);
44+
45+
% Calibrate the eye tracker
46+
EyelinkDoTrackerSetup(el);
47+
% start recording eye position
48+
Eyelink('StartRecording');
49+
% record a few samples before we actually start displaying
50+
WaitSecs(0.1);
51+
% mark zero-plot time in data file
52+
Eyelink('Message', 'SYNCTIME');
53+
TimeEyelink = GetSecs;
54+
fprintf(fidTime, '%f;%s\n', TimeEyelink, 'Start_Eyelink');
55+
end
56+
57+
58+
% To add message in your file
59+
if use_eyelink Eyelink('Message','PRE-TEST'); end;
60+
61+
% End with eyelink
62+
if use_eyelink
63+
Eyelink('stoprecording');
64+
status=Eyelink('closefile');
65+
if status ~=0
66+
sprintf('closefile error, status: %d',status)
67+
end
68+
end
69+
70+

initEnv.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
function initEnv
1616

1717
octaveVersion = '4.0.3';
18-
matlabVersion = '9.2.0';
18+
matlabVersion = '9.1.0';
1919

2020
if isOctave
2121

@@ -77,7 +77,7 @@
7777
persistent cacheval % speeds up repeated calls
7878

7979
if isempty (cacheval)
80-
cacheval = (exist ("OCTAVE_VERSION", "builtin") > 0);
80+
cacheval = (exist ('OCTAVE_VERSION', 'builtin') > 0);
8181
end
8282

8383
retval = cacheval;
@@ -86,7 +86,7 @@
8686
function addDependencies()
8787

8888
pth = fileparts(mfilename('fullpath'));
89-
addpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src'));
89+
addpath(genpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src')));
9090
addpath(fullfile(pth, 'lib', 'CPP_PTB'));
9191
addpath(genpath(fullfile(pth, 'lib', 'CPP_PTB', 'src')));
9292
addpath(fullfile(pth, 'subfun'));

0 commit comments

Comments
 (0)