Permalink
Cannot retrieve contributors at this time
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?
NMR_OPTIMA_BIDS/OPTIMA_convert_ANALYZER_BIDS.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
62 lines (48 sloc)
2.3 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{{'faces'},{'Analyzer'}} | |
filename = [BIDS.input.data_dir(1).PatientID{3},'_faces']; | |
cmd_str = sprintf('cp %s.eeg %s/physio/sub-%s_task-hariri_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]); |