-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathge_edf2info.m
More file actions
25 lines (24 loc) · 931 Bytes
/
ge_edf2info.m
File metadata and controls
25 lines (24 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function [subjectName, runName, runDate, runTime] = ge_edf2info(EDF_filename)
% [subjectName, runName, runDate, runTime] = function ge_edf2info(EDF_filename)
%
% Convert EDF filename to useful information. Use full EDF name with extension.
%
% Based on the clinical study of mindfulness. Input filenames have three parts
% separated by DASHES. Viz.
%
% 1006-session2-02.11.2015.20.02.38.edf
%
% Returns: subjectName ('1006'); runName ('session2'); runDate ('2015.11.02');
% & runTime ('20.02'). Note that runDate is corrected to a more
% standard format, and time is cut to HH.MM!
%
% MDT 2015.11.12
noEnding = regexprep(EDF_filename, '\.edf$','');
itemList = strsplit(noEnding, '-');
subjectName = itemList{1};
runName = itemList{2};
dateTime = itemList{3};
dte = strsplit(dateTime, '.');
runDate = [dte{3} '.' dte{2} '.' dte{1}];
runTime = [dte{4} '.' dte{5}];
end