From 1cf1a6d3766c5cfec0af6cadc30e63179c520400 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 11 Aug 2020 17:30:57 +0200 Subject: [PATCH 1/4] update eyetrackers --- .gitignore | 1 + eyelink_command.m | 70 +++++++++++++++++++++++++++++++++++++++++++++++ initEnv.m | 6 ++-- lib/CPP_BIDS | 2 +- lib/CPP_PTB | 2 +- 5 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 eyelink_command.m diff --git a/.gitignore b/.gitignore index 5c59f40..dd30e97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *DS_Store *.m~ +*.asv *octave-workspace # exclude content of logfiles folders diff --git a/eyelink_command.m b/eyelink_command.m new file mode 100644 index 0000000..a9bed19 --- /dev/null +++ b/eyelink_command.m @@ -0,0 +1,70 @@ +%EYETRACKER + if use_eyelink + + el=EyelinkInitDefaults(window); + + % Initialization of the connection with the Eyelink Gazetracker. + if (Eyelink('initialize') ~= 0) + error('could not init connection to Eyelink'); + return; + end + + % Open file to record data to + status=Eyelink('Openfile',edfFile); + if status~=0 + status + error('openfile error') + end + + % Pass the screen resolution to EyeLink + [width, height]=Screen('WindowSize', screenNumber); + Eyelink('command','screen_pixel_coords = %ld %ld %ld %ld', 0, 0, width-1, height-1); + Eyelink('message', 'DISPLAY_COORDS %ld %ld %ld %ld', 0, 0, width-1, height-1); + + % Set calibration type. + Eyelink('command', 'calibration_type = HV5'); + + % Get EyeLink version + [v, vs]=Eyelink('GetTrackerVersion'); + fprintf(fidTime,'Running experiment on a %s tracker.\n', vs ); + + % Set event and sample filters (i.e. what will be recorded in the output file) + Eyelink('command', 'file_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,INPUT'); + Eyelink('command', 'file_sample_data = LEFT,RIGHT,GAZE,HREF,AREA,GAZERES,STATUS,INPUT'); + % set link data (used for gaze cursor) + Eyelink('command', 'link_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,FIXUPDATE,INPUT'); + Eyelink('command', 'link_sample_data = LEFT,RIGHT,GAZE,GAZERES,AREA,STATUS,INPUT'); + + % Change camera setup options + % set pupil Tracking model in camera setup screen + % no = centroid. yes = ellipse + Eyelink('command', 'use_ellipse_fitter = no'); + % set sample rate in camera setup screen + Eyelink('command', 'sample_rate = %d',1000); + + % Calibrate the eye tracker + EyelinkDoTrackerSetup(el); + % start recording eye position + Eyelink('StartRecording'); + % record a few samples before we actually start displaying + WaitSecs(0.1); + % mark zero-plot time in data file + Eyelink('Message', 'SYNCTIME'); + TimeEyelink = GetSecs; + fprintf(fidTime, '%f;%s\n', TimeEyelink, 'Start_Eyelink'); + end + + + % To add message in your file + if use_eyelink Eyelink('Message','PRE-TEST'); end; + + % End with eyelink + if use_eyelink + Eyelink('stoprecording'); + status=Eyelink('closefile'); + if status ~=0 + sprintf('closefile error, status: %d',status) + end + end + + \ No newline at end of file diff --git a/initEnv.m b/initEnv.m index e135df6..c59cc15 100644 --- a/initEnv.m +++ b/initEnv.m @@ -15,7 +15,7 @@ function initEnv octaveVersion = '4.0.3'; - matlabVersion = '9.2.0'; + matlabVersion = '9.1.0'; if isOctave @@ -77,7 +77,7 @@ persistent cacheval % speeds up repeated calls if isempty (cacheval) - cacheval = (exist ("OCTAVE_VERSION", "builtin") > 0); + cacheval = (exist ('OCTAVE_VERSION', 'builtin') > 0); end retval = cacheval; @@ -86,7 +86,7 @@ function addDependencies() pth = fileparts(mfilename('fullpath')); - addpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src')); + addpath(genpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src'))); addpath(fullfile(pth, 'lib', 'CPP_PTB')); addpath(genpath(fullfile(pth, 'lib', 'CPP_PTB', 'src'))); addpath(fullfile(pth, 'subfun')); diff --git a/lib/CPP_BIDS b/lib/CPP_BIDS index c23210f..a17e12a 160000 --- a/lib/CPP_BIDS +++ b/lib/CPP_BIDS @@ -1 +1 @@ -Subproject commit c23210f5b35faa1505ca2cc35c92c3168564f98a +Subproject commit a17e12a53c0063e36fb017b7a545d605e2c2ef8e diff --git a/lib/CPP_PTB b/lib/CPP_PTB index 56b44dd..a8bc6b5 160000 --- a/lib/CPP_PTB +++ b/lib/CPP_PTB @@ -1 +1 @@ -Subproject commit 56b44dde23db03cd9d77165231bbf74e9388930e +Subproject commit a8bc6b5a1457ad78b496fa89037c07f0e548e0c8 From 6129415911e3c207626550e978b622e450e886f2 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 11 Aug 2020 18:09:57 +0200 Subject: [PATCH 2/4] update submodules --- lib/CPP_BIDS | 2 +- lib/CPP_PTB | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CPP_BIDS b/lib/CPP_BIDS index a17e12a..c23210f 160000 --- a/lib/CPP_BIDS +++ b/lib/CPP_BIDS @@ -1 +1 @@ -Subproject commit a17e12a53c0063e36fb017b7a545d605e2c2ef8e +Subproject commit c23210f5b35faa1505ca2cc35c92c3168564f98a diff --git a/lib/CPP_PTB b/lib/CPP_PTB index a8bc6b5..d7a1113 160000 --- a/lib/CPP_PTB +++ b/lib/CPP_PTB @@ -1 +1 @@ -Subproject commit a8bc6b5a1457ad78b496fa89037c07f0e548e0c8 +Subproject commit d7a11134b5af851b5dce7f5cfa826351057b5c56 From 117aabc2d93849d334e75dee225ec0a1f2d54e20 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 11 Aug 2020 18:40:41 +0200 Subject: [PATCH 3/4] update PTB submodule for eyetracking changes --- lib/CPP_PTB | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CPP_PTB b/lib/CPP_PTB index d7a1113..2e4500f 160000 --- a/lib/CPP_PTB +++ b/lib/CPP_PTB @@ -1 +1 @@ -Subproject commit d7a11134b5af851b5dce7f5cfa826351057b5c56 +Subproject commit 2e4500f78ae3c9620ec080f6d2838bdc63f7ef40 From f5e8700ced03dfc9cd152fa0dae700664304c22f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 11 Aug 2020 18:44:56 +0200 Subject: [PATCH 4/4] remove eyelink command file and lint submodule --- eyelink_command.m | 70 ----------------------------------------------- lib/CPP_PTB | 2 +- 2 files changed, 1 insertion(+), 71 deletions(-) delete mode 100644 eyelink_command.m diff --git a/eyelink_command.m b/eyelink_command.m deleted file mode 100644 index a9bed19..0000000 --- a/eyelink_command.m +++ /dev/null @@ -1,70 +0,0 @@ -%EYETRACKER - if use_eyelink - - el=EyelinkInitDefaults(window); - - % Initialization of the connection with the Eyelink Gazetracker. - if (Eyelink('initialize') ~= 0) - error('could not init connection to Eyelink'); - return; - end - - % Open file to record data to - status=Eyelink('Openfile',edfFile); - if status~=0 - status - error('openfile error') - end - - % Pass the screen resolution to EyeLink - [width, height]=Screen('WindowSize', screenNumber); - Eyelink('command','screen_pixel_coords = %ld %ld %ld %ld', 0, 0, width-1, height-1); - Eyelink('message', 'DISPLAY_COORDS %ld %ld %ld %ld', 0, 0, width-1, height-1); - - % Set calibration type. - Eyelink('command', 'calibration_type = HV5'); - - % Get EyeLink version - [v, vs]=Eyelink('GetTrackerVersion'); - fprintf(fidTime,'Running experiment on a %s tracker.\n', vs ); - - % Set event and sample filters (i.e. what will be recorded in the output file) - Eyelink('command', 'file_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,INPUT'); - Eyelink('command', 'file_sample_data = LEFT,RIGHT,GAZE,HREF,AREA,GAZERES,STATUS,INPUT'); - % set link data (used for gaze cursor) - Eyelink('command', 'link_event_filter = LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON,FIXUPDATE,INPUT'); - Eyelink('command', 'link_sample_data = LEFT,RIGHT,GAZE,GAZERES,AREA,STATUS,INPUT'); - - % Change camera setup options - % set pupil Tracking model in camera setup screen - % no = centroid. yes = ellipse - Eyelink('command', 'use_ellipse_fitter = no'); - % set sample rate in camera setup screen - Eyelink('command', 'sample_rate = %d',1000); - - % Calibrate the eye tracker - EyelinkDoTrackerSetup(el); - % start recording eye position - Eyelink('StartRecording'); - % record a few samples before we actually start displaying - WaitSecs(0.1); - % mark zero-plot time in data file - Eyelink('Message', 'SYNCTIME'); - TimeEyelink = GetSecs; - fprintf(fidTime, '%f;%s\n', TimeEyelink, 'Start_Eyelink'); - end - - - % To add message in your file - if use_eyelink Eyelink('Message','PRE-TEST'); end; - - % End with eyelink - if use_eyelink - Eyelink('stoprecording'); - status=Eyelink('closefile'); - if status ~=0 - sprintf('closefile error, status: %d',status) - end - end - - \ No newline at end of file diff --git a/lib/CPP_PTB b/lib/CPP_PTB index 2e4500f..8c25300 160000 --- a/lib/CPP_PTB +++ b/lib/CPP_PTB @@ -1 +1 @@ -Subproject commit 2e4500f78ae3c9620ec080f6d2838bdc63f7ef40 +Subproject commit 8c253007d4ce30c9c1a5f97dbbe9b0a93c59d0ca