Commit 53d1046c authored by Tyler Collins's avatar Tyler Collins
Browse files

Updated gitignore for a typical project hosted on a remote.

parent 9987d75b
...@@ -5,9 +5,16 @@ octave-workspace ...@@ -5,9 +5,16 @@ octave-workspace
# derivatives/lossless/* # derivatives/lossless/*
# But keep the pipeline code. # But keep the pipeline code.
# !derivatives/lossless/code/* # !derivatives/lossless/code/*
derivatives/lossless/log
code/eeg_init
code/misc
# Specifically hide the staging script
derivatives/lossless/code/scripts/staging
# BIDS ignores: # BIDS ignores:
sourcedata/* sourcedata/*
sub-* sub-*
participants.tsv participants.tsv
dataset_description.json dataset_description.json
grp_*
function eeg_init(inbdffiles,outsetfile) function eeg_init(EEG,infname)
%loop through inbdffiles disp(['current file: ', infname(1:end-1)])
for i=1:length(inbdffiles);
%import bdf file %parse infname.
ALLEEG(i) = pop_biosig(inbdffiles{i}, 'channels', 1:128 ); [p,n]=fileparts(infname);
%subject ID
subids_ind=strfind(lower(n),'ec_t')+6;
subide_ind=strfind(lower(n),'ec_t')+8;
subid=n(subids_ind:subide_ind);
if isempty(str2num(subid));
ecs_ind=strfind(lower(n),'ec');
if strcmp(lower(n(ecs_ind+7)),'t');
subid=n(ecs_ind+3:ecs_ind+5);
elseif strcmp(lower(n(ecs_ind+6)),'t');
subid=n(ecs_ind+2:ecs_ind+4);
elseif strcmp(lower(n(ecs_ind+3)),'p');
subid=n(ecs_ind+5:ecs_ind+7);
end
%resample to 512 if isempty(str2num(subid));
ALLEEG(i) = pop_resample( ALLEEG(i), 512); disp('COULD NOT FIND THE SUBJECT ID.');
return;
end
end end
%merge files %session ID
EEG = pop_mergeset( ALLEEG, 1:length(ALLEEG), 0); sesids_ind=strfind(n,'_t')+2;
sesid=n(sesids_ind);
%load average BUCANL BioSemi head channel coordinates if isempty(str2num(sesid));
EEG=pop_chanedit(EEG, 'load',{'sourcedata/misc/BioSemi_BUCANL_EEGLAB.sfp' 'filetype' 'autodetect'}); disp('COULD NOT FIND THE SESSION ID.');
return;
end
%rename events if strcmp(sesid,'1');
for i=1:length(EEG.event); agelab='m06';
if isnumeric(EEG.event(i).type); tasklab='t1task';
EEG.event(i).type=num2str(EEG.event(i).type); elseif strcmp(sesid,'2');
end agelab='m12';
if strcmp(EEG.event(i).type,'11'); tasklab='t2task';
EEG.event(i).type='house-upright-f1'; elseif strcmp(sesid,'3');
elseif strcmp(EEG.event(i).type,'12'); agelab='m18';
EEG.event(i).type='house-upright-f2'; tasklab='t3task';
elseif strcmp(EEG.event(i).type,'13'); end
EEG.event(i).type='house-upright-f3';
elseif strcmp(EEG.event(i).type,'14'); outfpath=['sub-s',subid,'/ses-',agelab,'/eeg/'];
EEG.event(i).type='house-upright-f4'; disp(['outpath: ', outfpath]);
elseif strcmp(EEG.event(i).type,'15'); disp(['current session: ' sesid]);
EEG.event(i).type='house-upright-f5';
elseif strcmp(EEG.event(i).type,'16');
EEG.event(i).type='house-upright-f6'; EEG = pop_readegi(infname(1:end-1), [],[],'auto');
elseif strcmp(EEG.event(i).type,'21');
EEG.event(i).type='house-inverted-f1'; %ADD Cz TO DATA ARRAY.
elseif strcmp(EEG.event(i).type,'22'); EEG.data(129,:)=zeros(size(EEG.data(1,:)));
EEG.event(i).type='house-inverted-f2'; EEG.nbchan=129;
elseif strcmp(EEG.event(i).type,'23'); EEG.chanlocs(129)=EEG.chanlocs(128);
EEG.event(i).type='house-inverted-f3'; EEG.chanlocs(129).labels=EEG.chaninfo.nodatchans(4).labels;
elseif strcmp(EEG.event(i).type,'24'); EEG.chanlocs(129).Y=EEG.chaninfo.nodatchans(4).Y;
EEG.event(i).type='house-inverted-f4'; EEG.chanlocs(129).X=EEG.chaninfo.nodatchans(4).X;
elseif strcmp(EEG.event(i).type,'25'); EEG.chanlocs(129).Z=EEG.chaninfo.nodatchans(4).Z;
EEG.event(i).type='house-inverted-f5'; EEG.chanlocs(129).sph_theta=EEG.chaninfo.nodatchans(4).sph_theta;
elseif strcmp(EEG.event(i).type,'26'); EEG.chanlocs(129).sph_phi=EEG.chaninfo.nodatchans(4).sph_phi;
EEG.event(i).type='house-inverted-f6'; EEG.chanlocs(129).sph_radius=EEG.chaninfo.nodatchans(4).sph_radius;
elseif strcmp(EEG.event(i).type,'31'); EEG.chanlocs(129).theta=EEG.chaninfo.nodatchans(4).theta;
EEG.event(i).type='face-upright-f1'; EEG.chanlocs(129).radius=EEG.chaninfo.nodatchans(4).radius;
elseif strcmp(EEG.event(i).type,'32'); EEG.chanlocs(129).type='EEG';
EEG.event(i).type='face-upright-f2'; EEG.chaninfo.nodatchans=EEG.chaninfo.nodatchans(1:3);
elseif strcmp(EEG.event(i).type,'33');
EEG.event(i).type='face-upright-f3'; EEG = pop_chanedit(EEG, 'load',{'sourcedata/misc/GSN129.sfp' 'filetype' 'autodetect'});
elseif strcmp(EEG.event(i).type,'34');
EEG.event(i).type='face-upright-f4'; if ~isempty(EEG.event);
elseif strcmp(EEG.event(i).type,'35'); for i=1:length(EEG.event);
EEG.event(i).type='face-upright-f5'; if strcmp(EEG.event(i).type,'epoc');
elseif strcmp(EEG.event(i).type,'36'); EEG.event(i).type='boundary';
EEG.event(i).type='face-upright-f6'; end
elseif strcmp(EEG.event(i).type,'41');
EEG.event(i).type='face-inverted-f1';
elseif strcmp(EEG.event(i).type,'42');
EEG.event(i).type='face-inverted-f2';
elseif strcmp(EEG.event(i).type,'43');
EEG.event(i).type='face-inverted-f3';
elseif strcmp(EEG.event(i).type,'44');
EEG.event(i).type='face-inverted-f4';
elseif strcmp(EEG.event(i).type,'45');
EEG.event(i).type='face-inverted-f5';
elseif strcmp(EEG.event(i).type,'46');
EEG.event(i).type='face-inverted-f6';
elseif strcmp(EEG.event(i).type,'51');
EEG.event(i).type='checker-f1';
elseif strcmp(EEG.event(i).type,'52');
EEG.event(i).type='checker-f2';
elseif strcmp(EEG.event(i).type,'53');
EEG.event(i).type='checker-f3';
elseif strcmp(EEG.event(i).type,'54');
EEG.event(i).type='checker-f4';
elseif strcmp(EEG.event(i).type,'55');
EEG.event(i).type='checker-f5';
elseif strcmp(EEG.event(i).type,'56');
EEG.event(i).type='checker-f6';
elseif strcmp(EEG.event(i).type,'211');
EEG.event(i).type='face-upright';
elseif strcmp(EEG.event(i).type,'212');
EEG.event(i).type='face-inverted';
elseif strcmp(EEG.event(i).type,'213');
EEG.event(i).type='house-upright';
elseif strcmp(EEG.event(i).type,'214');
EEG.event(i).type='house-inverted';
elseif strcmp(EEG.event(i).type,'215');
EEG.event(i).type='checker-left';
elseif strcmp(EEG.event(i).type,'216');
EEG.event(i).type='checker-right';
elseif strcmp(EEG.event(i).type,'201');
EEG.event(i).type='press-left';
elseif strcmp(EEG.event(i).type,'204');
EEG.event(i).type='press-right';
elseif strcmp(EEG.event(i).type,'boundary');
EEG.event(i).duration=0;
else
EEG.event(i).type=['e-',num2str(EEG.event(i).type)];
end end
end end
%save output set file % CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
EEG = pop_saveset( EEG, 'filename',outsetfile); if ~exist(outfpath);
disp(['Making directory ', outfpath]);
eval(['mkdir ' outfpath]);
end
outfname=['sub-s',subid,'_ses-',agelab,'_task-',tasklab,'_eeg.set'];
if strcmp(n(1:2),'p0');
outfname = ['sub-s',subid,'_ses-',agelab,'_task-',tasklab,'_eeg_',n(1:3),'.set'];
end
if strcmp(n(end-5:end-3),'eeg');
outfname = ['sub-s',subid,'_ses-',agelab,'_task-',tasklab,'_eeg_p',n(end-1:end),'.set'];
end
disp(outfname);
%save output set file
EEG = pop_saveset( EEG, 'filename',[outfpath,'/',outfname]);
end
diary 'sourcedata/eeg/sub-s01.log'; [x,y] = system('find . -type f -name *.raw');
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY filenames = strsplit(y,'./');
system('mkdir -p sub-s01/eeg'); filenames = filenames(2:end);
eeg_init({'sourcedata/eeg/IC_trn_P01_F_1.bdf', ... for i=1:length(filenames);
'sourcedata/eeg/IC_trn_P01_F_2.bdf', ... eeg_init(EEG,filenames{i});
'sourcedata/eeg/IC_trn_P01_f_3.bdf', ... end
'sourcedata/eeg/IC_trn_P01_f_4.bdf', ... \ No newline at end of file
'sourcedata/eeg/IC_trn_P01_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P01_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P01_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P01_O_4.bdf'}, ...
'sub-s01/eeg/sub-s01_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s02.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s02/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P02_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P02_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P02_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P02_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_4.bdf'}, ...
'sub-s02/eeg/sub-s02_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s03.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s03/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P03_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P03_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P03_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P03_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_4.bdf'}, ...
'sub-s03/eeg/sub-s03_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s04.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s04/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P04_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P04_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P04_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P04_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_4.bdf'}, ...
'sub-s04/eeg/sub-s04_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s05.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s05/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P05_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P05_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P05_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P05_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_4.bdf'}, ...
'sub-s05/eeg/sub-s05_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s06.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s06/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P06_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P06_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P06_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P06_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_4.bdf'}, ...
'sub-s06/eeg/sub-s06_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s07.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s07/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P07_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P07_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P07_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P07_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_4.bdf'}, ...
'sub-s07/eeg/sub-s07_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s08.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s08/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P08_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P08_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P08_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P08_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_4.bdf'}, ...
'sub-s08/eeg/sub-s08_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s09.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s09/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P09_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P09_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P09_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P09_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_4.bdf'}, ...
'sub-s09/eeg/sub-s09_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s10.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s10/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P10_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P10_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P10_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P10_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_4.bdf'}, ...
'sub-s10/eeg/sub-s10_task-faceFO_eeg.set');
\ No newline at end of file
File mode changed from 100644 to 100755
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment