-
Notifications
You must be signed in to change notification settings - Fork 4
/
prepro_egg_path2data.m
66 lines (51 loc) · 2.18 KB
/
prepro_egg_path2data.m
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function [output] = prepro_egg_path2data(subject,fileType)
%{
This funcion get the full path of different kind of files, e.g. brainamp markers, for a particular
subject. This function is called by prepro_egg_loadData
input:
subject = string, e.g. '01' '02' '03'
filtype= 'brainamp', 'brainampMarkers' 'fmri' , 'brainampWOIRM', 'brainampMarkersWOIRM'
example call:
pathtBrainAmp = getFilesPath('08','brainamp')
Output: string containing path to data
Commented IR 27/06/2017
%}
%%
subjectFolder= global_path2subject(subject);
% Check which kind of file to retrieve
brainamp=strcmp(fileType,'brainamp');
brainampMarkers=strcmp(fileType,'brainampMarkers');
brainampWOIRM=strcmp(fileType,'brainampWORIM');
brainampMarkersWOIRM=strcmp(fileType,'brainampMarkersWOIRM');
fmri=strcmp(fileType,'fmri');
if brainamp==1
brainampDir = strcat(subjectFolder,'brainamp',filesep,'with MRI',filesep);
files= dir( fullfile( brainampDir,'*.vhdr')); %# list all *.vhdr files
filename = {files.name}';%'# file names
output = char(strcat(brainampDir,filename));
end
if brainampMarkers==1
brainampDir = strcat(subjectFolder,'brainamp',filesep,'with MRI',filesep);
files= dir( fullfile( brainampDir,'*.vhdr')); %# list all *.vhdr header files
filename = {files.name}';%'# file names
output = char(strcat(brainampDir,filename));
end
if brainampWOIRM==1
brainampDir = strcat(subjectFolder,'brainamp',filesep,'without MRI',filesep);
files= dir( fullfile( brainampDir,'*.vhdr')); %# list all *.vhdr files
filename = {files.name}';%'# file names
output = char(strcat(brainampDir,filename));
end
if brainampMarkersWOIRM==1
brainampDir = strcat(subjectFolder,'brainamp',filesep,'without MRI',filesep);
files= dir( fullfile( brainampDir,'*.vhdr')); %# list all *.vhdr header files
filename = {files.name}';%'# file names
output = char(strcat(brainampDir,filename));
end
if fmri==1
fmriDir=strcat(subjectFolder,'fMRI',filesep,'acquisition1',filesep,'RestingState');
files= dir( fullfile( fmriDir,'swaf*.img')); %# list all swaf files
filenames = {files.name}';%'# file names
output = filenames;
end
end