This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/projects/project_eyetracker/solution/load_eye_tracking_data.m

21 lines
864 B
Matlab

function [frame_index, gaze_x, gaze_y, marker, eye_found] = load_eye_tracking_data(filename)
% [frame_index, gaze_x, gaze_y, marker, eye_found] = load_eye_tracking_data(filename)
%
% Loads the eyetracking data stored in the specified file. Raises an error,
% if the file was not found.
%
% Arguments:
% filename: string, the path to the data file
%
% Returns:
% frame_index: vector, the recorded frame numbers
% gaze_x, gaze_y: vector, the recorded x and y eye positions
% marker: vector, the recorded event marker
% eye_found: vector, 1, or zero values indicating whether or not
% the eye was actually detected by the tracker.
if exist(filename, "file") ~= 2
error("file %s does not exist or is no mat file", filename);
end
load(filename, "gaze_x", "gaze_y", "frame_index", "marker", "eye_found")