Skip to content
Permalink
02f25a58e6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
62 lines (48 sloc) 2.3 KB
function convert_ANALYZER_BIDS(BIDS, biomax_table)
%
% copies the ANALYZER files into BIDS format
%
%
% file history:
% created M. Czisch 26.2.2018
% last M. Czisch 27.3.2018
number_of_days = size(BIDS.input.data_dir,2);
if number_of_days > 1 % to consider possible missing day 2
fprintf('converting Analyzer files\n');
cmd_str = sprintf('mkdir %s/physio', BIDS.output.dir); system(cmd_str);
logfilename = sprintf('%s/physio/logfile_%s_analyzer_conversion.txt', BIDS.output.dir, BIDS.input.data_dir(1).PatientID{3});
cmd_str = sprintf('date >> %s', logfilename);
system(cmd_str);
fid = fopen(logfilename,'a');
cd([BIDS.input.dir]);
cd('ANALYZER');
fprintf(fid,'%s\n',cmd_str);
% work on faces
if biomax_table{{'rest1'},{'Analyzer'}}
filename = [BIDS.input.data_dir(1).PatientID{3},'_faces'];
cmd_str = sprintf('cp %s.eeg %s/physio/sub-%s_task-rest1_eeg.eeg',...
filename, BIDS.output.dir, BIDS.input.data_dir(1).PatientID{3});
system(cmd_str); fprintf(fid,'%s\n',cmd_str);
cmd_str = sprintf('cp %s.vhdr %s/physio/sub-%s_task-hariri_eeg.vhdr',...
filename, BIDS.output.dir, BIDS.input.data_dir(1).PatientID{3});
system(cmd_str); fprintf(fid,'%s\n',cmd_str);
cmd_str = sprintf('cp %s.vmrk %s/physio/sub-%s_task-hariri_eeg.vmrk',...
filename, BIDS.output.dir, BIDS.input.data_dir(1).PatientID{3});
system(cmd_str); fprintf(fid,'%s\n',cmd_str);
end
% work on IST
if biomax_table{{'IST'},{'Analyzer'}}
filename = [BIDS.input.data_dir(1).PatientID{3},'_ist'];
cmd_str = sprintf('cp %s.eeg %s/physio/sub-%s_task-IST_eeg.eeg',...
filename, BIDS.output.dir, BIDS.input.data_dir(1).PatientID{3});
system(cmd_str); fprintf(fid,'%s\n',cmd_str);
cmd_str = sprintf('cp %s.vhdr %s/physio/sub-%s_task-IST_eeg.vhdr',...
filename, BIDS.output.dir, BIDS.input.data_dir(1).PatientID{3});
system(cmd_str); fprintf(fid,'%s\n',cmd_str);
cmd_str = sprintf('cp %s.vmrk %s/physio/sub-%s_task-IST_eeg.vmrk',...
filename, BIDS.output.dir, BIDS.input.data_dir(1).PatientID{3});
system(cmd_str); fprintf(fid,'%s\n',cmd_str);
end
fclose(fid);
end
cd([BIDS.input.dir]);