41 lines
1.3 KiB
Matlab
41 lines
1.3 KiB
Matlab
classdef PDSubject
|
|
properties
|
|
index
|
|
sessions
|
|
settings
|
|
name
|
|
date
|
|
time
|
|
covariates
|
|
end
|
|
methods
|
|
|
|
function[obj] = PDSubject(varargin)
|
|
if nargin ==0
|
|
display('Select data for this subject:');
|
|
|
|
files = cellstr(uigetfile({'*.ASC;*.asc', 'Converted Eyelink text files (*.ASC)';...
|
|
'*.EDF;*.edf', 'Original Eyelink data files (*.EDF)'}, ...
|
|
'Select data for this subject', 'MultiSelect', 'on'));
|
|
|
|
for i = 1:length(files)
|
|
session = PDSession(files{i});
|
|
obj.sessions = session;
|
|
end
|
|
end
|
|
|
|
if nargin == 1
|
|
display(sprintf('Selecting sessions based on all files in: %s', varargin{1}));
|
|
obj.sessions = obj.findAllfiles(varargin{1});
|
|
if ~isempty(obj.index)
|
|
obj.name = sprintf('Subject %d', obj.index );
|
|
else
|
|
[folder topmostfolder] = fileparts(varargin{1});
|
|
obj.name = topmostfolder;
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
|
|
end |