Browse Source

run FASTER

kosciessa 2 years ago
parent
commit
749a5edc7e
91 changed files with 497 additions and 696 deletions
  1. 0 1
      code/a3_ica/a3_ica_prepare.m
  2. 0 278
      code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123.m
  3. 0 22
      code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_START.sh
  4. 0 30
      code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_START_rerun.sh
  5. 0 307
      code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_noTardis.m
  6. 0 21
      code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_prepare.sh
  7. 249 0
      code/a6_automatic_artifact_correction/a6_automatic_artifact_correction.m
  8. 22 0
      code/a6_automatic_artifact_correction/a6_automatic_artifact_correction_START.sh
  9. 13 0
      code/a6_automatic_artifact_correction/a6_automatic_artifact_correction_prepare.m
  10. 11 0
      code/a6_automatic_artifact_correction/a6_automatic_artifact_correction_prepare.sh
  11. 1 1
      code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_run.sh
  12. 7 5
      code/a6_automatic_artifact_correction/mccExcludedFiles.log
  13. 116 0
      code/a6_automatic_artifact_correction/readme.txt
  14. 1 0
      code/a6_automatic_artifact_correction/requiredMCRProducts.txt
  15. 1 0
      data/outputs/history/sub-001_task-xxxx_ArtCorr.txt
  16. 1 1
      data/outputs/history/sub-001_task-xxxx_config.mat
  17. 1 0
      data/outputs/history/sub-002_task-xxxx_ArtCorr.txt
  18. 1 1
      data/outputs/history/sub-002_task-xxxx_config.mat
  19. 1 0
      data/outputs/history/sub-003_task-xxxx_ArtCorr.txt
  20. 1 1
      data/outputs/history/sub-003_task-xxxx_config.mat
  21. 1 0
      data/outputs/history/sub-004_task-xxxx_ArtCorr.txt
  22. 1 1
      data/outputs/history/sub-004_task-xxxx_config.mat
  23. 1 0
      data/outputs/history/sub-005_task-xxxx_ArtCorr.txt
  24. 1 1
      data/outputs/history/sub-005_task-xxxx_config.mat
  25. 1 0
      data/outputs/history/sub-006_task-xxxx_ArtCorr.txt
  26. 1 1
      data/outputs/history/sub-006_task-xxxx_config.mat
  27. 1 0
      data/outputs/history/sub-007_task-xxxx_ArtCorr.txt
  28. 1 1
      data/outputs/history/sub-007_task-xxxx_config.mat
  29. 1 0
      data/outputs/history/sub-008_task-xxxx_ArtCorr.txt
  30. 1 1
      data/outputs/history/sub-008_task-xxxx_config.mat
  31. 1 0
      data/outputs/history/sub-009_task-xxxx_ArtCorr.txt
  32. 1 1
      data/outputs/history/sub-009_task-xxxx_config.mat
  33. 1 0
      data/outputs/history/sub-010_task-xxxx_ArtCorr.txt
  34. 1 1
      data/outputs/history/sub-010_task-xxxx_config.mat
  35. 1 0
      data/outputs/history/sub-011_task-xxxx_ArtCorr.txt
  36. 1 1
      data/outputs/history/sub-011_task-xxxx_config.mat
  37. 1 0
      data/outputs/history/sub-012_task-xxxx_ArtCorr.txt
  38. 1 1
      data/outputs/history/sub-012_task-xxxx_config.mat
  39. 1 0
      data/outputs/history/sub-013_task-xxxx_ArtCorr.txt
  40. 1 1
      data/outputs/history/sub-013_task-xxxx_config.mat
  41. 1 0
      data/outputs/history/sub-014_task-xxxx_ArtCorr.txt
  42. 1 1
      data/outputs/history/sub-014_task-xxxx_config.mat
  43. 1 0
      data/outputs/history/sub-015_task-xxxx_ArtCorr.txt
  44. 1 1
      data/outputs/history/sub-015_task-xxxx_config.mat
  45. 1 0
      data/outputs/history/sub-016_task-xxxx_ArtCorr.txt
  46. 1 1
      data/outputs/history/sub-016_task-xxxx_config.mat
  47. 1 0
      data/outputs/history/sub-017_task-xxxx_ArtCorr.txt
  48. 1 1
      data/outputs/history/sub-017_task-xxxx_config.mat
  49. 1 0
      data/outputs/history/sub-018_task-xxxx_ArtCorr.txt
  50. 1 1
      data/outputs/history/sub-018_task-xxxx_config.mat
  51. 1 0
      data/outputs/history/sub-019_task-xxxx_ArtCorr.txt
  52. 1 1
      data/outputs/history/sub-019_task-xxxx_config.mat
  53. 1 0
      data/outputs/history/sub-020_task-xxxx_ArtCorr.txt
  54. 1 1
      data/outputs/history/sub-020_task-xxxx_config.mat
  55. 1 0
      data/outputs/history/sub-021_task-xxxx_ArtCorr.txt
  56. 1 0
      data/outputs/history/sub-022_task-xxxx_ArtCorr.txt
  57. 1 1
      data/outputs/history/sub-022_task-xxxx_config.mat
  58. 1 0
      data/outputs/history/sub-023_task-xxxx_ArtCorr.txt
  59. 1 1
      data/outputs/history/sub-023_task-xxxx_config.mat
  60. 1 0
      data/outputs/history/sub-024_task-xxxx_ArtCorr.txt
  61. 1 1
      data/outputs/history/sub-024_task-xxxx_config.mat
  62. 1 0
      data/outputs/history/sub-025_task-xxxx_ArtCorr.txt
  63. 1 1
      data/outputs/history/sub-025_task-xxxx_config.mat
  64. 1 0
      data/outputs/history/sub-026_task-xxxx_ArtCorr.txt
  65. 1 1
      data/outputs/history/sub-026_task-xxxx_config.mat
  66. 1 0
      data/outputs/history/sub-027_task-xxxx_ArtCorr.txt
  67. 1 1
      data/outputs/history/sub-027_task-xxxx_config.mat
  68. 1 0
      data/outputs/history/sub-028_task-xxxx_ArtCorr.txt
  69. 1 1
      data/outputs/history/sub-028_task-xxxx_config.mat
  70. 1 0
      data/outputs/history/sub-029_task-xxxx_ArtCorr.txt
  71. 1 1
      data/outputs/history/sub-029_task-xxxx_config.mat
  72. 1 0
      data/outputs/history/sub-030_task-xxxx_ArtCorr.txt
  73. 1 1
      data/outputs/history/sub-030_task-xxxx_config.mat
  74. 1 0
      data/outputs/history/sub-031_task-xxxx_ArtCorr.txt
  75. 1 1
      data/outputs/history/sub-031_task-xxxx_config.mat
  76. 1 0
      data/outputs/history/sub-032_task-xxxx_ArtCorr.txt
  77. 1 1
      data/outputs/history/sub-032_task-xxxx_config.mat
  78. 1 0
      tools/helpers/MWB_artfdetec_freq.m
  79. 1 0
      tools/helpers/MWB_artfdetec_kurt.m
  80. 1 0
      tools/helpers/MWB_iterative_outlierdetection.m
  81. 1 0
      tools/helpers/THG_FASTER_1_channel_artifacts_20140302.m
  82. 1 0
      tools/helpers/THG_FASTER_2_epoch_artifacts_20140302.m
  83. 1 0
      tools/helpers/THG_FASTER_3_ICA_artifacts_20140305.m
  84. 1 0
      tools/helpers/THG_FASTER_4_channel_x_epoch_artifacts_20140302.m
  85. 1 0
      tools/helpers/THG_automatic_artifact_correction_trials_20170922.m
  86. 1 0
      tools/helpers/cm_MWB_channel_x_epoch_artifacts_20170922.m
  87. 1 0
      tools/helpers/cm_heuristic_hurst_exponent_20140302.m
  88. 1 0
      tools/helpers/cm_inv_fisher_Z_20130605.m
  89. 1 0
      tools/helpers/cm_nanzscore_20140302.m
  90. 1 0
      tools/helpers/cm_outlier2nan_20140311.m
  91. 1 0
      tools/helpers/testboxplot.m

+ 0 - 1
code/a3_ica/a3_ica_prepare.m

@@ -11,7 +11,6 @@ ft_compile_mex(true)
 %% compile function and append dependencies
 
 addpath(fullfile('..','..', 'tools', 'helpers'))
-%addpath(fullfile('..','..', 'tools', 'eeglab14_1_1b', 'functions', 'sigprocfunc'))
 
 mcc -m a3_ica.m 
 

+ 0 - 278
code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123.m

@@ -1,278 +0,0 @@
-function H_STSW_automatic_artifact_correction_180123(id)
-
-%% H_SS_automatic_artifact_correction_20170922
-
-%% initialize
-
-%restoredefaultpath;
-%clear all; close all; pack; clc;
-
-%% pathdef
-
-if ismac
-%     pn.study        = '/Volumes/LNDG/Projects/StateSwitch/';
-%     pn.eeg_root     = [pn.study, 'dynamic/data/eeg/task/A_preproc/SA_preproc_study_YA/'];
-    pn.eeg_root     = '/Users/kosciessa/Desktop/mountpoint_tardis_LNDG/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/';
-    pn.dynamic_In   = [pn.eeg_root, 'B_data/B_EEG_ET_ByRun/'];
-    pn.triggerTiming= [pn.eeg_root, 'C_figures/D_TriggerTiming/'];
-    pn.EEG          = [pn.eeg_root, 'B_data/C_EEG_FT/']; mkdir(pn.EEG);
-    pn.History      = [pn.eeg_root, 'B_data/D_History/']; mkdir(pn.History);
-    pn.logs         = [pn.eeg_root, 'Y_logs/H_ArtCorr/'];
-    % add ConMemEEG tools
-    pn.MWBtools     = [pn.eeg_root, 'T_tools/fnct_MWB/'];           addpath(genpath(pn.MWBtools));
-    pn.THGtools     = [pn.eeg_root, 'T_tools/fnct_THG/'];           addpath(genpath(pn.THGtools));
-    pn.commontools  = [pn.eeg_root, 'T_tools/fnct_common/'];        addpath(genpath(pn.commontools));
-    pn.fnct_JQK     = [pn.eeg_root, 'T_tools/fnct_JQK/'];           addpath(genpath(pn.fnct_JQK));
-    pn.FT           = [pn.eeg_root, 'T_tools/fieldtrip-20170904/']; addpath(pn.FT); ft_defaults;
-    pn.helper       = [pn.eeg_root, 'A_scripts/helper/'];           addpath(pn.helper);
-else
-    pn.root         = '/home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/';
-    pn.EEG          = [pn.root, 'B_data/C_EEG_FT/'];
-    pn.History      = [pn.root, 'B_data/D_History/'];
-    pn.triggerTiming= [pn.root, 'C_figures/D_TriggerTiming/'];
-    pn.logs         = [pn.root, 'Y_logs/H_ArtCorr/'];
-end
-
-%% define Condition & IDs for preprocessing
-
-condEEG = 'dynamic';
-
-%% define IDs for segmentation
-
-% N = 47;
-IDs = {'1117';'1118';'1120';'1124';'1126';'1131';'1132';'1135';'1136';'1138';'1144';'1151';'1158';'1160';'1163';'1164';'1167';'1169';'1172';'1173';'1178';'1182';'1215';'1216';'1219';'1221';'1223';'1227';'1228';'1233';'1234';'1237';'1239';'1240';'1243';'1245';'1247';'1250';'1252';'1257';'1261';'1265';'1266';'1268';'1270';'1276';'1281'};
-
-id = str2num(id);
-
-%%  loop IDs
-
-ID_unavailable = cell(length(IDs),1);
-%for id = 1:length(IDs)
-    try
-        display(['processing ID ' num2str(IDs{id})]);
-        for iRun = 1:4
-        
-            % load data
-            load([pn.EEG, IDs{id}, '_r',num2str(iRun), '_', condEEG, '_EEG_Rlm_Fhl_rdSeg'],'data_EEG');
-            
-            dataICA = load([pn.EEG, IDs{id}, '_', condEEG, '_EEG_Rlm_Fhl_Ica'],'data');
-
-            data = data_EEG; clear data_EEG;
-            data.elec = dataICA.data.elec;
-            data.chanlocs = dataICA.data.chanlocs; clear dataICA;
-            
-           %% ------------------ ARTIFACT DETECTION - PREPARATION ----------------- %%
-
-            % load config
-
-            load([pn.History, IDs{id}, '_r',num2str(iRun), '_', condEEG, '_config'],'config')
-            
-            config.elec = data.elec;
-
-            %% ICA (from weights)
-
-            % ica config
-            cfg.method           = 'runica';
-            cfg.channel          = {'all','-ECG','-A2'};
-            cfg.trials           = 'all';
-            cfg.numcomponent     = 'all';
-            cfg.demean           = 'yes';
-            cfg.runica.extended  = 1;
-
-            % ICA solution
-            cfg.unmixing     = config.ica1.unmixing;
-            cfg.topolabel    = config.ica1.topolabel;
-
-            % components
-            comp = ft_componentanalysis(cfg,data);
-
-            % clear cfg
-            clear cfg data
-
-            %% remove components
-
-            % get IC labels
-            iclabels = config.ica1.iclabels.manual;
-
-            % cfg for rejecting components (reject: blinks, eye movements,
-            % ecg, ref); JQK: added artifacts and emg
-            cfg.component = sortrows([iclabels.bli(:); iclabels.mov(:); iclabels.hrt(:); iclabels.ref(:); iclabels.art(:); iclabels.emg(:)])';
-            cfg.demean    = 'yes';
-
-            % reject components
-            data = ft_rejectcomponent(cfg,comp);
-
-            % clear cfg
-            clear cfg comp
-
-            %% remove eye & reference channels
-
-            cfg.channel     = {'all','-IOR','-LHEOG','-RHEOG','-A1'};
-            cfg.demean      = 'yes';
-
-            % remove channels
-            tmpdat = ft_preprocessing(cfg,data);
-
-            % clear cfg & data variable
-            clear cfg data
-
-
-            %% ------------------------- ARTIFACT DETECTION ------------------------ %%
-
-            % open log file
-            fid = fopen([pn.logs, 'log_' IDs{id}, '_r',num2str(iRun), '_' condEEG '_ArtCorr.txt'],'a');
-
-            % write log
-          % fprintf(fid,['*********************  ' BLOCK '  *********************\n']);                         % Undefined function or variable 'BLOCK'. but see: %% H_prep_data_for_analysis_20141218
-
-            fprintf(fid,['*********************   BLOCK   *********************\n']);
-            fprintf(fid,['function: H_SS_automatic_artifact_correction_20170922.m \n\n']);                
-            fprintf(fid,['eeg file = ' config.data_file '\n\n']);
-
-            n_trl = length(tmpdat.trial);
-
-            %%  get artifact contaminated channels by kurtosis, low & high frequency artifacts
-
-            cfg.criterion = 3;
-            cfg.recursive = 'no';
-
-            [index0 parm0 zval0] = cm_MWB_channel_x_epoch_artifacts_20170922(cfg,tmpdat);
-
-            % write log
-            tmp_log = '';
-            for j = 1:length(index0.c)
-                tmp_log = [tmp_log num2str(index0.c(j)) ' '];
-            end; clear j
-            tmp_log = [tmp_log(1:end-1) '\n'];
-            fprintf(fid,'(1) automatic bad channel detection:\n');
-            fprintf(fid,['MWB:          channel(s) ' tmp_log]);
-
-            % clear cfg
-            clear cfg tmp_log
-
-            %%  get artifact contaminated channels by FASTER
-
-            cfg.criterion = 3;
-            cfg.recursive = 'no';
-
-            [index1 parm1 zval1] = THG_FASTER_1_channel_artifacts_20140302(cfg,tmpdat);
-
-            % write log
-            tmp_log = '';
-            for j = 1:length(index1)
-                tmp_log = [tmp_log num2str(index1(j)) ' '];
-            end; clear j
-            tmp_log = [tmp_log(1:end-1) '\n'];
-            fprintf(fid,['FASTER:      channel(s) ' tmp_log]);
-
-            % clear cfg
-            clear cfg tmp_log
-
-            %%  interpolate artifact contaminated channels
-
-            % collect bad channels
-            badchan = unique([index0.c; index1]);
-
-            fprintf(fid,['--> ' num2str(length(badchan)) ' channels interpolated\n\n']);
-            
-            cfg.method     = 'spline';
-            cfg.badchannel = tmpdat.label(badchan);
-            cfg.trials     = 'all';
-            cfg.lambda     = 1e-5; 
-            cfg.order      = 4; 
-            cfg.elec       = config.elec;
-
-            % interpolate
-            tmpdat = ft_channelrepair(cfg,tmpdat);
-
-            % clear cfg
-            clear cfg
-
-            %% equalize duration of trials to the trial with fewest samples
-            
-            for indTrial = 1:64
-                TrialLength(indTrial) = size(tmpdat.trial{indTrial},2);
-            end
-            [val, idx] = min(TrialLength);
-            for indTrial = 1:64
-                tmpdat.trial{indTrial} = tmpdat.trial{indTrial}(:,1:val);
-                tmpdat.time{indTrial} = tmpdat.time{idx};
-            end
-            
-            %%  get artifact contaminated epochs & exclude epochs
-            % includes: - THG_MWB_channel_x_epoch_artifacts_20140311
-            %           - THG_FASTER_2_epoch_artifacts_20140302
-            % recursive epoch exclusion!
-
-            [tmpdat index] = THG_automatic_artifact_correction_trials_20170922(tmpdat);
-
-            % write log
-            fprintf(fid,'(2) automatic recursive bad epoch detection:\n');
-            fprintf(fid,['MWB & FASTER: ' num2str(n_trl-length(index)) ' bad epoch(s) detected\n\n']);
-
-            %%  get channel x epoch artifacts
-
-            % cfg
-            cfg.criterion = 3;
-            cfg.recursive = 'yes';
-
-            [index3 parm3 zval3] = THG_FASTER_4_channel_x_epoch_artifacts_20140302(cfg,tmpdat);
-
-            % write log
-            fprintf(fid,'(3) automatic single epoch/channel detection:\n');
-            fprintf(fid,['FASTER:       ' num2str(sum(sum(index3))) ' channel(s) x trial(s) detected\n\n']);
-
-            % clear cfg
-            clear cfg
-
-            %%  collect and save detected artifacts & artifact correction infos
-
-            % include ArtDect.parameters
-
-            % bad channels
-            ArtDect.channels = badchan;
-
-            % bad trials
-            tmp  = zeros(n_trl,1); tmp(index,1) = 1;
-            badtrl = find(tmp==0);
-            ArtDect.trials  = badtrl; 
-            clear tmp
-
-            % bad single epoch(s)/channel(s) - after exclusion of bad epochs
-            ArtDect.channels_x_trials = index3;
-
-            % overview
-            ind = [1:n_trl];
-            ind(badtrl) = [];
-            tmp = ones(length(tmpdat.label),n_trl);
-            tmp(:,ind) = index3;
-            tmp(badchan,:) = 1;
-            ArtDect.channels_x_trials_all = tmp;
-            clear tmp
-
-            % save version
-            ArtDect.version = 'JQK 20180123';
-
-            % add to config
-            config.ArtDect = ArtDect;
-
-            % save config
-            save([pn.History, IDs{id}, '_r',num2str(iRun), '_', condEEG, '_config'],'config')
-            
-            %%  finalize log
-
-            % log
-            fprintf(fid,'Artifact detection completed.\n');
-            fprintf(fid,['Information saved to: ' IDs{id} '_config.mat\n\n']);
-            fclose(fid);
-        end % run
-    catch ME
-        warning('Error occured. Please check.');
-        rethrow(ME)
-        fprintf('\n ID not availble! Skip! \n')
-        ID_unavailable{id,1} = (IDs{id});
-    end
-    
-%end; clear id
-
-end

+ 0 - 22
code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_START.sh

@@ -1,22 +0,0 @@
-#!/bin/bash
-
-# call the BOSC analysis by session and participant
-cd /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/A_scripts/H_STSW_automatic_artifact_correction/
-
-IDs=(1117 1118 1120 1124 1125 1126 1131 1132 1135 1136 1151 1160 1164 1167 1169 1172 1173 1178 1182 1214 1215 1216 1219 1223 1227 1228 1233 1234 1237 1239 1240 1243 1245 1247 1250 1252 1257 1261 1265 1266 1268 1270 1276 1281 2142 2253 2254 2255)
-
-mkdir /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/Y_logs/H_ArtCorr
-
-for i in $(seq 1 ${#IDs[@]}); do
-	echo "#PBS -N STSW_eeg_artCor_${i}" 									> job
-	echo "#PBS -l walltime=04:00:00" 										>> job
-	echo "#PBS -l mem=8gb" 													>> job
-	echo "#PBS -j oe" 														>> job
-	echo "#PBS -o /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/Y_logs/H_ArtCorr" >> job
-	echo "#PBS -m n" 														>> job
-	echo "#PBS -d ." 														>> job
-	echo "./H_STSW_automatic_artifact_correction_180123_run.sh /opt/matlab/R2016b $i " 	>> job
-	qsub job
-	rm job
-done
-done

+ 0 - 30
code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_START_rerun.sh

@@ -1,30 +0,0 @@
-#!/bin/bash
-
-# call the BOSC analysis by session and participant
-cd /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/A_scripts/H_STSW_automatic_artifact_correction/
-
-IDs=(1117 1118 1120 1124 1125 1126 1131 1132 1135 1136 1151 1160 1164 1167 1169 1172 1173 1178 1182 1214 1215 1216 1219 1223 1227 1228 1233 1234 1237 1239 1240 1243 1245 1247 1250 1252 1257 1261 1265 1266 1268 1270 1276 1281 2142 2253 2254 2255)
-
-mkdir /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/Y_logs/H_ArtCorr
-
-	echo "#PBS -N STSW_eeg_artCor_27" 									> job
-	echo "#PBS -l walltime=04:00:00" 										>> job
-	echo "#PBS -l mem=8gb" 													>> job
-	echo "#PBS -j oe" 														>> job
-	echo "#PBS -o /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/Y_logs/H_ArtCorr" >> job
-	echo "#PBS -m n" 														>> job
-	echo "#PBS -d ." 														>> job
-	echo "./H_STSW_automatic_artifact_correction_180123_run.sh /opt/matlab/R2016b 27 " 	>> job
-	qsub job
-	rm job
-
-	echo "#PBS -N STSW_eeg_artCor_29" 									> job
-	echo "#PBS -l walltime=04:00:00" 										>> job
-	echo "#PBS -l mem=8gb" 													>> job
-	echo "#PBS -j oe" 														>> job
-	echo "#PBS -o /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/Y_logs/H_ArtCorr" >> job
-	echo "#PBS -m n" 														>> job
-	echo "#PBS -d ." 														>> job
-	echo "./H_STSW_automatic_artifact_correction_180123_run.sh /opt/matlab/R2016b 29 " 	>> job
-	qsub job
-	rm job

+ 0 - 307
code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_noTardis.m

@@ -1,307 +0,0 @@
-function H_STSW_automatic_artifact_correction_180123_noTardis()
-
-%% H_SS_automatic_artifact_correction_20170922
-
-% 180326 | instead of equalizing to smallest amount of samples, interpolate
-%           for the same timing across subjects. Note that this does not
-%           counteract any natural jitter in the paradigm and should only
-%           equalize the size of matrices (fill with zeros! at ends).
-%           Artefact detection does NOT currently work with potential NaN
-%           values that would naturally arise from the interpolation.
-
-%% initialize
-
-%restoredefaultpath;
-%clear all; close all; pack; clc;
-
-%% pathdef
-
-if ismac
-    pn.study        = '/Volumes/LNDG/Projects/StateSwitch/';
-    pn.eeg_root     = [pn.study, 'dynamic/data/eeg/task/A_preproc/SA_preproc_study/'];
-    pn.dynamic_In   = [pn.eeg_root, 'B_data/B_EEG_ET_ByRun/'];
-    pn.triggerTiming= [pn.eeg_root, 'C_figures/D_TriggerTiming/'];
-    pn.EEG          = [pn.eeg_root, 'B_data/C_EEG_FT/']; mkdir(pn.EEG);
-    pn.History      = [pn.eeg_root, 'B_data/D_History/']; mkdir(pn.History);
-    pn.logs         = [pn.eeg_root, 'Y_logs/H_ArtCorr/'];
-    % add ConMemEEG tools
-    pn.MWBtools     = [pn.eeg_root, 'T_tools/fnct_MWB/'];           addpath(genpath(pn.MWBtools));
-    pn.THGtools     = [pn.eeg_root, 'T_tools/fnct_THG/'];           addpath(genpath(pn.THGtools));
-    pn.commontools  = [pn.eeg_root, 'T_tools/fnct_common/'];        addpath(genpath(pn.commontools));
-    pn.fnct_JQK     = [pn.eeg_root, 'T_tools/fnct_JQK/'];           addpath(genpath(pn.fnct_JQK));
-    pn.FT           = [pn.eeg_root, 'T_tools/fieldtrip-20170904/']; addpath(pn.FT); ft_defaults;
-    pn.helper       = [pn.eeg_root, 'A_scripts/helper/'];           addpath(pn.helper);
-else
-    pn.root         = '/home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study/';
-    pn.EEG          = [pn.root, 'B_data/C_EEG_FT/'];
-    pn.History      = [pn.root, 'B_data/D_History/'];
-    pn.triggerTiming= [pn.root, 'C_figures/D_TriggerTiming/'];
-    pn.logs         = [pn.root, 'Y_logs/H_ArtCorr/'];
-end
-
-%% define Condition & IDs for preprocessing
-
-condEEG = 'dynamic';
-
-%% define IDs for segmentation
-
-% N = 47 YAs + 53 OAs;
-IDs = {'1117';'1118';'1120';'1124';'1126';'1131';'1132';'1135';'1136';'1138';...
-    '1144';'1151';'1158';'1160';'1163';'1164';'1167';'1169';'1172';'1173';...
-    '1178';'1182';'1215';'1216';'1219';'1221';'1223';'1227';'1228';'1233';...
-    '1234';'1237';'1239';'1240';'1243';'1245';'1247';'1250';'1252';'1257';...
-    '1261';'1265';'1266';'1268';'1270';'1276';'1281';...
-    '2104';'2107';'2108';'2112';'2118';'2120';'2121';'2123';'2125';'2129';...
-    '2130';'2131';'2132';'2133';'2134';'2135';'2139';'2140';'2145';'2147';...
-    '2149';'2157';'2160';'2201';'2202';'2203';'2205';'2206';'2209';'2210';...
-    '2211';'2213';'2214';'2215';'2216';'2217';'2219';'2222';'2224';'2226';...
-    '2227';'2236';'2237';'2238';'2241';'2244';'2246';'2248';'2250';'2251';...
-    '2252';'2258';'2261'};
-
-%%  loop IDs
-
-ID_unavailable = cell(length(IDs),1);
-for id = 1:length(IDs)
-    try
-        display(['processing ID ' num2str(IDs{id})]);
-        for iRun = 1:4
-        
-            % load config
-            load([pn.History, IDs{id}, '_r',num2str(iRun), '_', condEEG, '_config'],'config')
-            
-            if ~isfield(config, 'ArtDect')
-            
-                % load data
-                load([pn.EEG, IDs{id}, '_r',num2str(iRun), '_', condEEG, '_EEG_Rlm_Fhl_rdSeg'],'data_EEG');
-
-                dataICA = load([pn.EEG, IDs{id}, '_', condEEG, '_EEG_Rlm_Fhl_Ica'],'data');
-
-                data = data_EEG; clear data_EEG;
-                data.elec = dataICA.data.elec;
-                data.chanlocs = dataICA.data.chanlocs; clear dataICA;
-
-               %% ------------------ ARTIFACT DETECTION - PREPARATION ----------------- %%
-
-                config.elec = data.elec;
-
-                %% ICA (from weights)
-
-                % ica config
-                cfg.method           = 'runica';
-                cfg.channel          = {'all','-ECG','-A2'};
-                cfg.trials           = 'all';
-                cfg.numcomponent     = 'all';
-                cfg.demean           = 'yes';
-                cfg.runica.extended  = 1;
-
-                % ICA solution
-                cfg.unmixing     = config.ica1.unmixing;
-                cfg.topolabel    = config.ica1.topolabel;
-
-                % components
-                comp = ft_componentanalysis(cfg,data);
-
-                % clear cfg
-                clear cfg data
-
-                %% remove components
-
-                % get IC labels
-                iclabels = config.ica1.iclabels.manual;
-
-                % cfg for rejecting components (reject: blinks, eye movements,
-                % ecg, ref); JQK: added artifacts and emg
-                cfg.component = sortrows([iclabels.bli(:); iclabels.mov(:); iclabels.hrt(:); iclabels.ref(:); iclabels.art(:); iclabels.emg(:)])';
-                cfg.demean    = 'yes';
-
-                % reject components
-                data = ft_rejectcomponent(cfg,comp);
-
-                % clear cfg
-                clear cfg comp
-
-                %% remove eye & reference channels
-
-                cfg.channel     = {'all','-IOR','-LHEOG','-RHEOG','-A1'};
-                cfg.demean      = 'yes';
-
-                % remove channels
-                tmpdat = ft_preprocessing(cfg,data);
-
-                % clear cfg & data variable
-                clear cfg data
-
-
-                %% ------------------------- ARTIFACT DETECTION ------------------------ %%
-
-                % open log file
-                fid = fopen([pn.logs, 'log_' IDs{id}, '_r',num2str(iRun), '_' condEEG '_ArtCorr.txt'],'a');
-
-                % write log
-              % fprintf(fid,['*********************  ' BLOCK '  *********************\n']);                         % Undefined function or variable 'BLOCK'. but see: %% H_prep_data_for_analysis_20141218
-
-                fprintf(fid,['*********************   BLOCK   *********************\n']);
-                fprintf(fid,['function: H_SS_automatic_artifact_correction_20170922.m \n\n']);                
-                fprintf(fid,['eeg file = ' config.data_file '\n\n']);
-
-                n_trl = length(tmpdat.trial);
-
-                %%  get artifact contaminated channels by kurtosis, low & high frequency artifacts
-
-                cfg.criterion = 3;
-                cfg.recursive = 'no';
-
-                [index0 parm0 zval0] = cm_MWB_channel_x_epoch_artifacts_20170922(cfg,tmpdat);
-
-                % write log
-                tmp_log = '';
-                for j = 1:length(index0.c)
-                    tmp_log = [tmp_log num2str(index0.c(j)) ' '];
-                end; clear j
-                tmp_log = [tmp_log(1:end-1) '\n'];
-                fprintf(fid,'(1) automatic bad channel detection:\n');
-                fprintf(fid,['MWB:          channel(s) ' tmp_log]);
-
-                % clear cfg
-                clear cfg tmp_log
-
-                %%  get artifact contaminated channels by FASTER
-
-                cfg.criterion = 3;
-                cfg.recursive = 'no';
-
-                [index1 parm1 zval1] = THG_FASTER_1_channel_artifacts_20140302(cfg,tmpdat);
-
-                % write log
-                tmp_log = '';
-                for j = 1:length(index1)
-                    tmp_log = [tmp_log num2str(index1(j)) ' '];
-                end; clear j
-                tmp_log = [tmp_log(1:end-1) '\n'];
-                fprintf(fid,['FASTER:      channel(s) ' tmp_log]);
-
-                % clear cfg
-                clear cfg tmp_log
-
-                %%  interpolate artifact contaminated channels
-
-                % collect bad channels
-                badchan = unique([index0.c; index1]);
-
-                fprintf(fid,['--> ' num2str(length(badchan)) ' channels interpolated\n\n']);
-
-                cfg.method     = 'spline';
-                cfg.badchannel = tmpdat.label(badchan);
-                cfg.trials     = 'all';
-                cfg.lambda     = 1e-5; 
-                cfg.order      = 4; 
-                cfg.elec       = config.elec;
-
-                % interpolate
-                tmpdat = ft_channelrepair(cfg,tmpdat);
-
-                % clear cfg
-                clear cfg
-
-                %% interpolate data to requested time (necessary due to acquisition jitter)
-                
-                % 2160 has only 62 trials, i.e. the first two trials were
-                % not recorded.
-                
-                timeRequested = -1.5:1/500:9.566;
-                
-                for indTrial = 1:size(tmpdat.trial,2)
-                    recTime = tmpdat.time{indTrial};
-                    recData = tmpdat.trial{indTrial};
-                    for indChannel = 1:size(recData,1)
-                        interpData(indChannel,:) = interp1(recTime,recData(indChannel,:),timeRequested,'linear');
-                    end
-                    interpData(isnan(interpData)) = 0;
-                    tmpdat.trial{indTrial} = interpData;
-                    tmpdat.time{indTrial} = timeRequested;
-                end
-                
-                %figure; plot(timeRequested,interpData, 'k'); hold on; plot(recTime,recData(1,:), 'r')
-                
-                %%  get artifact contaminated epochs & exclude epochs
-                % includes: - THG_MWB_channel_x_epoch_artifacts_20140311
-                %           - THG_FASTER_2_epoch_artifacts_20140302
-                % recursive epoch exclusion!
-
-                [tmpdat index] = THG_automatic_artifact_correction_trials_20170922(tmpdat);
-
-                % write log
-                fprintf(fid,'(2) automatic recursive bad epoch detection:\n');
-                fprintf(fid,['MWB & FASTER: ' num2str(n_trl-length(index)) ' bad epoch(s) detected\n\n']);
-
-                %%  get channel x epoch artifacts
-
-                % cfg
-                cfg.criterion = 3;
-                cfg.recursive = 'yes';
-
-                [index3 parm3 zval3] = THG_FASTER_4_channel_x_epoch_artifacts_20140302(cfg,tmpdat);
-
-                % write log
-                fprintf(fid,'(3) automatic single epoch/channel detection:\n');
-                fprintf(fid,['FASTER:       ' num2str(sum(sum(index3))) ' channel(s) x trial(s) detected\n\n']);
-
-                % clear cfg
-                clear cfg
-
-                %%  collect and save detected artifacts & artifact correction infos
-
-                % include ArtDect.parameters
-
-                % bad channels
-                ArtDect.channels = badchan;
-
-                % bad trials
-                tmp  = zeros(n_trl,1); tmp(index,1) = 1;
-                badtrl = find(tmp==0);
-                ArtDect.trials  = badtrl; 
-                clear tmp
-
-                % bad single epoch(s)/channel(s) - after exclusion of bad epochs
-                ArtDect.channels_x_trials = index3;
-
-                % overview
-                ind = [1:n_trl];
-                ind(badtrl) = [];
-                tmp = ones(length(tmpdat.label),n_trl);
-                tmp(:,ind) = index3;
-                tmp(badchan,:) = 1;
-                ArtDect.channels_x_trials_all = tmp;
-                clear tmp
-
-                % save version
-                ArtDect.version = 'JQK 20180123';
-
-                % add to config
-                config.ArtDect = ArtDect;
-
-                % save config
-                save([pn.History, IDs{id}, '_r',num2str(iRun), '_', condEEG, '_config'],'config')
-
-                %%  finalize log
-
-                % log
-                fprintf(fid,'Artifact detection completed.\n');
-                fprintf(fid,['Information saved to: ' IDs{id} '_config.mat\n\n']);
-                fclose(fid);
-                
-                
-            else
-                disp([IDs{id}, ' Run ',num2str(iRun), ' has already run through automatic artifact detection']);
-            end % if data was not processed yet
-        end % run
-    catch ME
-        warning('Error occured. Please check.');
-        rethrow(ME)
-        fprintf('\n ID not availble! Skip! \n')
-        ID_unavailable{id,1} = (IDs{id});
-    end
-    
-end; clear id
-
-end

+ 0 - 21
code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_prepare.sh

@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# This script prepares tardis by compiling the necessary function in MATLAB.
-
-#ssh tardis # access tardis
-
-# check and choose matlab version
-#module avail matlab
-module load matlab/R2016b
-
-# compile functions
-
-matlab
-%% add fieldtrip toolbox
-addpath('/home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/T_tools/fieldtrip-20170904/')
-ft_defaults()
-ft_compile_mex(true)
-%% go to analysis directory containing .m-file
-cd('/home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/A_scripts/H_STSW_automatic_artifact_correction/')
-%% compile function and append dependencies
-mcc -m H_STSW_automatic_artifact_correction_180123.m -a /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/T_tools/fnct_common -a /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/T_tools/fnct_THG -a /home/mpib/LNDG/StateSwitch/WIP_eeg/SA_preproc_study_YA/T_tools/fnct_MWB/MWB_ArtfDetec

+ 249 - 0
code/a6_automatic_artifact_correction/a6_automatic_artifact_correction.m

@@ -0,0 +1,249 @@
+function a6_automatic_artifact_correction(id, rootpath)
+
+if ismac % run if function is not pre-compiled
+    id = '1'; % test for example subject
+    currentFile = mfilename('fullpath');
+    [pathstr,~,~] = fileparts(currentFile);
+    cd(fullfile(pathstr,'..', '..'))
+    rootpath = pwd;
+end
+
+% inputs
+pn.eeg_BIDS = fullfile(rootpath, 'data', 'inputs', 'rawdata', 'eeg_BIDS');
+pn.channel_locations = fullfile(rootpath, 'data', 'inputs', 'rawdata', 'channel_locations');
+pn.events = fullfile(rootpath, 'data', 'inputs', 'rawdata', 'events');
+pn.tools = fullfile(rootpath, 'tools');
+% outputs
+pn.eeg_ft = fullfile(rootpath, 'data', 'outputs', 'eeg');
+pn.history = fullfile(rootpath, 'data', 'outputs', 'history');
+
+if ismac % run if function is not pre-compiled
+     addpath(fullfile(pn.tools, 'fieldtrip')); ft_defaults;
+     addpath(fullfile(pn.tools, 'helpers'));
+end
+
+% N = 33
+IDs = tdfread(fullfile(pn.eeg_BIDS, 'participants.tsv'));
+IDs = cellstr(IDs.participant_id);
+
+id = str2num(id);
+
+display(['processing ID ' num2str(IDs{id})]);
+
+%% load data
+
+load(fullfile(pn.eeg_ft, [IDs{id}, '_task-xxxx_eeg_seg.mat']),'data_eeg', 'events');
+
+% remove M2 (collinear with M1 due to avg. mastoid REF: mean(M1,M2)=0)
+cfg_preproc               = [];
+cfg_preproc.channel       = {'all', '-M2'};
+data_eeg = ft_preprocessing(cfg_preproc, data_eeg);
+
+data_ica = load(fullfile(pn.eeg_ft, [IDs{id}, '_task-xxxx_eeg_ica.mat']),'data');
+
+data = data_eeg; clear data_eeg;
+data.elec = data_ica.data.elec;
+data.chanlocs = data_ica.data.chanlocs; clear data_ica;
+
+%% ------------------ ARTIFACT DETECTION - PREPARATION ----------------- %%
+
+% load config
+
+load(fullfile(pn.history, [IDs{id}, '_task-xxxx_config.mat']),'config');
+
+config.elec = data.elec;
+
+%% ICA (from weights)
+
+% ica config
+cfg.method           = 'runica';
+cfg.channel          = {'all'}; % additional channels should be excluded already...
+cfg.trials           = 'all';
+cfg.numcomponent     = 'all';
+cfg.demean           = 'yes';
+cfg.runica.extended  = 1;
+
+% ICA solution
+cfg.unmixing     = config.ica1.unmixing;
+cfg.topolabel    = config.ica1.topolabel;
+
+% components
+comp = ft_componentanalysis(cfg,data);
+
+% clear cfg
+clear cfg data
+
+%% remove components
+
+% get IC labels
+iclabels = config.ica1.iclabels.manual;
+
+% cfg for rejecting components (reject: blinks, eye movements,
+% ecg, ref); JQK: added artifacts and emg
+cfg.component = sortrows([iclabels.bli(:); iclabels.mov(:); iclabels.hrt(:); iclabels.ref(:); iclabels.art(:); iclabels.emg(:)])';
+cfg.demean    = 'yes';
+
+% reject components
+data = ft_rejectcomponent(cfg,comp);
+
+% clear cfg
+clear cfg comp
+
+%% remove eye & reference channels
+
+cfg.channel     = {'all','-IO1','-IO2','-M1','-VEOG','-HEOG'};
+cfg.demean      = 'yes';
+
+% remove channels
+tmpdat = ft_preprocessing(cfg,data);
+
+% clear cfg & data variable
+clear cfg data
+
+%% ------------------------- ARTIFACT DETECTION ------------------------ %%
+
+% open log file
+fid = fopen(fullfile(pn.history, [IDs{id}, '_task-xxxx_ArtCorr.txt']),'a');
+
+fprintf(fid,['*********************   BLOCK   *********************\n']);
+fprintf(fid,['function: a6_automatic_artifact_correction.m \n\n']);                
+fprintf(fid,['eeg file = ' config.data_file '\n\n']);
+
+n_trl = length(tmpdat.trial);
+
+%%  get artifact contaminated channels by kurtosis, low & high frequency artifacts
+
+cfg.criterion = 3;
+cfg.recursive = 'no';
+
+[index0 parm0 zval0] = cm_MWB_channel_x_epoch_artifacts_20170922(cfg,tmpdat);
+
+% write log
+tmp_log = '';
+for j = 1:length(index0.c)
+    tmp_log = [tmp_log num2str(index0.c(j)) ' '];
+end; clear j
+tmp_log = [tmp_log(1:end-1) '\n'];
+fprintf(fid,'(1) automatic bad channel detection:\n');
+fprintf(fid,['MWB:          channel(s) ' tmp_log]);
+
+% clear cfg
+clear cfg tmp_log
+
+%%  get artifact contaminated channels by FASTER
+
+cfg.criterion = 3;
+cfg.recursive = 'no';
+
+[index1 parm1 zval1] = THG_FASTER_1_channel_artifacts_20140302(cfg,tmpdat);
+
+% write log
+tmp_log = '';
+for j = 1:length(index1)
+    tmp_log = [tmp_log num2str(index1(j)) ' '];
+end; clear j
+tmp_log = [tmp_log(1:end-1) '\n'];
+fprintf(fid,['FASTER:      channel(s) ' tmp_log]);
+
+% clear cfg
+clear cfg tmp_log
+
+%%  interpolate artifact contaminated channels
+
+% collect bad channels
+badchan = unique([index0.c; index1]);
+
+fprintf(fid,['--> ' num2str(length(badchan)) ' channels interpolated\n\n']);
+
+cfg.method     = 'spline';
+cfg.badchannel = tmpdat.label(badchan);
+cfg.trials     = 'all';
+cfg.lambda     = 1e-5; 
+cfg.order      = 4; 
+cfg.elec       = config.elec;
+
+% interpolate
+tmpdat = ft_channelrepair(cfg,tmpdat);
+
+% clear cfg
+clear cfg
+
+%% equalize duration of trials to the trial with fewest samples
+
+for indTrial = 1:numel(tmpdat.trial)
+    TrialLength(indTrial) = size(tmpdat.trial{indTrial},2);
+end
+[val, idx] = min(TrialLength);
+for indTrial = 1:numel(tmpdat.trial)
+    tmpdat.trial{indTrial} = tmpdat.trial{indTrial}(:,1:val);
+    tmpdat.time{indTrial} = tmpdat.time{idx};
+end
+
+%%  get artifact contaminated epochs & exclude epochs
+% includes: - THG_MWB_channel_x_epoch_artifacts_20140311
+%           - THG_FASTER_2_epoch_artifacts_20140302
+% recursive epoch exclusion!
+
+[tmpdat index] = THG_automatic_artifact_correction_trials_20170922(tmpdat);
+
+% write log
+fprintf(fid,'(2) automatic recursive bad epoch detection:\n');
+fprintf(fid,['MWB & FASTER: ' num2str(n_trl-length(index)) ' bad epoch(s) detected\n\n']);
+
+%%  get channel x epoch artifacts
+
+% cfg
+cfg.criterion = 3;
+cfg.recursive = 'yes';
+
+[index3 parm3 zval3] = THG_FASTER_4_channel_x_epoch_artifacts_20140302(cfg,tmpdat);
+
+% write log
+fprintf(fid,'(3) automatic single epoch/channel detection:\n');
+fprintf(fid,['FASTER:       ' num2str(sum(sum(index3))) ' channel(s) x trial(s) detected\n\n']);
+
+% clear cfg
+clear cfg
+
+%%  collect and save detected artifacts & artifact correction infos
+
+% include ArtDect.parameters
+
+% bad channels
+ArtDect.channels = badchan;
+
+% bad trials
+tmp  = zeros(n_trl,1); tmp(index,1) = 1;
+badtrl = find(tmp==0);
+ArtDect.trials  = badtrl; 
+clear tmp
+
+% bad single epoch(s)/channel(s) - after exclusion of bad epochs
+ArtDect.channels_x_trials = index3;
+
+% overview
+ind = [1:n_trl];
+ind(badtrl) = [];
+tmp = ones(length(tmpdat.label),n_trl);
+tmp(:,ind) = index3;
+tmp(badchan,:) = 1;
+ArtDect.channels_x_trials_all = tmp;
+clear tmp
+
+% save version
+ArtDect.version = 'JQK 20180123';
+
+% add to config
+config.ArtDect = ArtDect;
+
+% save config
+save(fullfile(pn.history, [IDs{id}, '_task-xxxx_config.mat']),'config');
+
+%%  finalize log
+
+% log
+fprintf(fid,'Artifact detection completed.\n');
+fprintf(fid,['Information saved to: ' IDs{id} '_config.mat\n\n']);
+fclose(fid);
+
+end

+ 22 - 0
code/a6_automatic_artifact_correction/a6_automatic_artifact_correction_START.sh

@@ -0,0 +1,22 @@
+#!/bin/bash
+
+fun_name="a6_automatic_artifact_correction"
+job_name="eegmp_art"
+
+mkdir ./logs
+
+rootpath="$(pwd)/../.."
+rootpath=$(builtin cd $rootpath; pwd)
+
+for subj in $(seq 1 33); do
+	echo "#!/bin/bash"                    			> job.slurm
+	echo "#SBATCH --job-name ${job_name}_${subj}" 	>> job.slurm
+	echo "#SBATCH --cpus-per-task 4"				>> job.slurm
+	echo "#SBATCH --mem 8gb" 						>> job.slurm
+	echo "#SBATCH --time 01:00:00" 					>> job.slurm
+	echo "#SBATCH --output ./logs/${job_name}_${subj}.out"			>> job.slurm
+	echo "#SBATCH --workdir ." 										>> job.slurm
+	echo "./${fun_name}_run.sh /opt/matlab/R2016b ${subj} ${rootpath}" 	>> job.slurm
+	sbatch job.slurm
+	rm -f job.slurm
+done

+ 13 - 0
code/a6_automatic_artifact_correction/a6_automatic_artifact_correction_prepare.m

@@ -0,0 +1,13 @@
+function a6_automatic_artifact_correction_prepare()
+
+%% add fieldtrip toolbox
+
+addpath(fullfile('..','..', 'tools', 'fieldtrip'));
+ft_defaults()
+ft_compile_mex(true)
+
+addpath(fullfile('..','..', 'tools', 'helpers'))
+
+mcc -m a6_automatic_artifact_correction.m
+
+exit

+ 11 - 0
code/a6_automatic_artifact_correction/a6_automatic_artifact_correction_prepare.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# This script prepares tardis by compiling the necessary function in MATLAB.
+
+# check [module avail matlab] and choose matlab version
+
+fun_name="a6_automatic_artifact_correction"
+
+module load matlab/R2016b
+matlab -nodesktop -nosplash -r "run ${fun_name}_prepare.m"
+mv run_${fun_name}.sh ${fun_name}_run.sh

+ 1 - 1
code/a6_automatic_artifact_correction/H_STSW_automatic_artifact_correction_180123_run.sh

@@ -27,7 +27,7 @@ else
       args="${args} \"${token}\"" 
       shift
   done
-  eval "\"${exe_dir}/H_STSW_automatic_artifact_correction_180123\"" $args
+  eval "\"${exe_dir}/a6_automatic_artifact_correction\"" $args
 fi
 exit
 

+ 7 - 5
code/a6_automatic_artifact_correction/mccExcludedFiles.log

@@ -1,7 +1,9 @@
 The List of Excluded Files
 Excluded files	 Exclusion Message ID	 Reason For Exclusion	 Exclusion Rule
-/opt/matlab/R2016b/toolbox/local/+matlab/+internal/+toolboxes/addInstalledToolboxesToJavaPath.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/opt/matlab/R2016b/toolbox/local/[+]matlab/[+]internal/[+]toolboxes/
-/opt/matlab/R2016b/toolbox/local/+matlab/+internal/+toolboxes/addInstalledToolboxesToPath.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/opt/matlab/R2016b/toolbox/local/[+]matlab/[+]internal/[+]toolboxes/
-/opt/matlab/R2016b/toolbox/local/+matlab/+internal/+zipAddOns/addInstalledZipAddOnsToPath.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/opt/matlab/R2016b/toolbox/local/[+]matlab/[+]internal/[+]zipAddOns/
-/opt/matlab/R2016b/toolbox/local/pathdef.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/opt/matlab/R2016b/toolbox/local/pathdef[.]m
-/opt/matlab/R2016b/toolbox/matlab/codetools/initdesktoputils.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/opt/matlab/R2016b/toolbox/matlab/codetools/
+/mnt/beegfs/software/archive/matlab/R2016b/toolbox/fuzzy/fuzzy/findcluster.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	
+/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/+matlab/+internal/+toolboxes/addInstalledToolboxesToJavaPath.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/[+]matlab/[+]internal/[+]toolboxes/
+/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/+matlab/+internal/+toolboxes/addInstalledToolboxesToPath.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/[+]matlab/[+]internal/[+]toolboxes/
+/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/+matlab/+internal/+zipAddOns/addInstalledZipAddOnsToPath.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/[+]matlab/[+]internal/[+]zipAddOns/
+/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/pathdef.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/mnt/beegfs/software/archive/matlab/R2016b/toolbox/local/pathdef[.]m
+/mnt/beegfs/software/archive/matlab/R2016b/toolbox/matlab/codetools/@mtree/mtree.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/mnt/beegfs/software/archive/matlab/R2016b/toolbox/matlab/codetools/
+/mnt/beegfs/software/archive/matlab/R2016b/toolbox/matlab/codetools/initdesktoputils.m	MATLAB:depfun:req:ExcludedBy	Cannot be packaged for use in the target environment MCR. Removed from the parts list by license Compiler.	/mnt/beegfs/software/archive/matlab/R2016b/toolbox/matlab/codetools/

+ 116 - 0
code/a6_automatic_artifact_correction/readme.txt

@@ -0,0 +1,116 @@
+MATLAB Compiler
+
+1. Prerequisites for Deployment 
+
+. Verify the MATLAB Runtime is installed and ensure you    
+  have installed version 9.1 (R2016b).   
+
+. If the MATLAB Runtime is not installed, do the following:
+  (1) enter
+  
+      >>mcrinstaller
+      
+      at MATLAB prompt. The MCRINSTALLER command displays the 
+      location of the MATLAB Runtime installer.
+
+  (2) run the MATLAB Runtime installer.
+
+Or download the Linux 64-bit version of the MATLAB Runtime for R2016b 
+from the MathWorks Web site by navigating to
+
+   http://www.mathworks.com/products/compiler/mcr/index.html
+   
+   
+For more information about the MATLAB Runtime and the MATLAB Runtime installer, see 
+Package and Distribute in the MATLAB Compiler documentation  
+in the MathWorks Documentation Center.    
+
+
+2. Files to Deploy and Package
+
+Files to package for Standalone 
+================================
+-a6_automatic_artifact_correction 
+-run_a6_automatic_artifact_correction.sh (shell script for temporarily setting 
+                                          environment variables and executing the 
+                                          application)
+   -to run the shell script, type
+   
+       ./run_a6_automatic_artifact_correction.sh <mcr_directory> <argument_list>
+       
+    at Linux or Mac command prompt. <mcr_directory> is the directory 
+    where version 9.1 of the MATLAB Runtime is installed or the directory where 
+    MATLAB is installed on the machine. <argument_list> is all the 
+    arguments you want to pass to your application. For example, 
+
+    If you have version 9.1 of the MATLAB Runtime installed in 
+    /mathworks/home/application/v91, run the shell script as:
+    
+       ./run_a6_automatic_artifact_correction.sh /mathworks/home/application/v91
+       
+    If you have MATLAB installed in /mathworks/devel/application/matlab, 
+    run the shell script as:
+    
+       ./run_a6_automatic_artifact_correction.sh /mathworks/devel/application/matlab
+-MCRInstaller.zip
+   -if end users are unable to download the MATLAB Runtime using the above  
+    link, include it when building your component by clicking 
+    the "Runtime downloaded from web" link in the Deployment Tool
+-This readme file 
+
+3. Definitions
+
+For information on deployment terminology, go to 
+http://www.mathworks.com/help. Select MATLAB Compiler >   
+Getting Started > About Application Deployment > 
+Deployment Product Terms in the MathWorks Documentation 
+Center.
+
+
+4. Appendix 
+
+A. Linux x86-64 systems:
+In the following directions, replace MCR_ROOT by the directory where the MATLAB Runtime 
+   is installed on the target machine.
+
+(1) Set the environment variable XAPPLRESDIR to this value:
+
+    MCR_ROOT/v91/X11/app-defaults
+
+
+(2) If the environment variable LD_LIBRARY_PATH is undefined, set it to the concatenation 
+   of the following strings:
+
+    MCR_ROOT/v91/runtime/glnxa64:
+    MCR_ROOT/v91/bin/glnxa64:
+    MCR_ROOT/v91/sys/os/glnxa64:
+    MCR_ROOT/v91/sys/opengl/lib/glnxa64
+
+    If it is defined, set it to the concatenation of these strings:
+
+    ${LD_LIBRARY_PATH}: 
+    MCR_ROOT/v91/runtime/glnxa64:
+    MCR_ROOT/v91/bin/glnxa64:
+    MCR_ROOT/v91/sys/os/glnxa64:
+    MCR_ROOT/v91/sys/opengl/lib/glnxa64
+
+   For more detail information about setting the MATLAB Runtime paths, see Package and 
+   Distribute in the MATLAB Compiler documentation in the MathWorks Documentation Center.
+
+
+     
+        NOTE: To make these changes persistent after logout on Linux 
+              or Mac machines, modify the .cshrc file to include this  
+              setenv command.
+        NOTE: The environment variable syntax utilizes forward 
+              slashes (/), delimited by colons (:).  
+        NOTE: When deploying standalone applications, it is possible 
+              to run the shell script file run_a6_automatic_artifact_correction.sh 
+              instead of setting environment variables. See 
+              section 2 "Files to Deploy and Package".    
+
+
+
+
+
+

+ 1 - 0
code/a6_automatic_artifact_correction/requiredMCRProducts.txt

@@ -0,0 +1 @@
+35000	35001	35010	

+ 1 - 0
data/outputs/history/sub-001_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/xG/PF/MD5E-s746--628e5cc7abe632d0ba1d7f8305c52f84.txt/MD5E-s746--628e5cc7abe632d0ba1d7f8305c52f84.txt

+ 1 - 1
data/outputs/history/sub-001_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/FM/KP/MD5E-s133662--3e407cd842ab52736c99271b124e8267.mat/MD5E-s133662--3e407cd842ab52736c99271b124e8267.mat
+../../../.git/annex/objects/V0/5z/MD5E-s145705--3a5c08ccfb65936a7828277689a8303f.mat/MD5E-s145705--3a5c08ccfb65936a7828277689a8303f.mat

+ 1 - 0
data/outputs/history/sub-002_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/0G/zk/MD5E-s747--90a001dda89e4ffebdaa0fcfcad9d9dd.txt/MD5E-s747--90a001dda89e4ffebdaa0fcfcad9d9dd.txt

+ 1 - 1
data/outputs/history/sub-002_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/KM/f4/MD5E-s122120--0a90f590aab7a17b90d903f6e9258711.mat/MD5E-s122120--0a90f590aab7a17b90d903f6e9258711.mat
+../../../.git/annex/objects/P2/g1/MD5E-s134366--9c4358de7e90506793282ab86b2a298d.mat/MD5E-s134366--9c4358de7e90506793282ab86b2a298d.mat

+ 1 - 0
data/outputs/history/sub-003_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/w4/pM/MD5E-s743--6efcb878103a8ad6318239ab35c48450.txt/MD5E-s743--6efcb878103a8ad6318239ab35c48450.txt

+ 1 - 1
data/outputs/history/sub-003_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/zM/9P/MD5E-s154808--1da7ec13b2cdb8c72dace0965107f8b6.mat/MD5E-s154808--1da7ec13b2cdb8c72dace0965107f8b6.mat
+../../../.git/annex/objects/0w/kg/MD5E-s167192--6ff936ae61136ce732f4496eb403b941.mat/MD5E-s167192--6ff936ae61136ce732f4496eb403b941.mat

+ 1 - 0
data/outputs/history/sub-004_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/XK/fZ/MD5E-s740--2c44c1bb44f70cb5c1274827422c75a2.txt/MD5E-s740--2c44c1bb44f70cb5c1274827422c75a2.txt

+ 1 - 1
data/outputs/history/sub-004_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/pX/36/MD5E-s208889--a83994f57ae8e09c2121135d599c68b4.mat/MD5E-s208889--a83994f57ae8e09c2121135d599c68b4.mat
+../../../.git/annex/objects/p2/xg/MD5E-s218417--6fc9b3b8bb22de0e24567c6c6784ddf5.mat/MD5E-s218417--6fc9b3b8bb22de0e24567c6c6784ddf5.mat

+ 1 - 0
data/outputs/history/sub-005_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/vV/kf/MD5E-s739--098e5e1c67994685bb2c456adfb74c41.txt/MD5E-s739--098e5e1c67994685bb2c456adfb74c41.txt

+ 1 - 1
data/outputs/history/sub-005_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/ZM/Fj/MD5E-s234038--ac715e9e4d06fcc34aceadcc0bd60344.mat/MD5E-s234038--ac715e9e4d06fcc34aceadcc0bd60344.mat
+../../../.git/annex/objects/p1/Ww/MD5E-s243320--9cc5f6292010cc28b8db71f0f71fe3ef.mat/MD5E-s243320--9cc5f6292010cc28b8db71f0f71fe3ef.mat

+ 1 - 0
data/outputs/history/sub-006_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/MJ/kV/MD5E-s741--bb52042001dc73e0d32d482917c0140f.txt/MD5E-s741--bb52042001dc73e0d32d482917c0140f.txt

+ 1 - 1
data/outputs/history/sub-006_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/PJ/9V/MD5E-s275349--db214333b7b8339cd7e50361a2abd8be.mat/MD5E-s275349--db214333b7b8339cd7e50361a2abd8be.mat
+../../../.git/annex/objects/Mw/M4/MD5E-s285903--987360dedc1c9f834db4a35c2f443e5b.mat/MD5E-s285903--987360dedc1c9f834db4a35c2f443e5b.mat

+ 1 - 0
data/outputs/history/sub-007_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/vp/W2/MD5E-s739--110fc04274b0130bbc13f394e6611045.txt/MD5E-s739--110fc04274b0130bbc13f394e6611045.txt

+ 1 - 1
data/outputs/history/sub-007_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/4Z/pW/MD5E-s306094--39c845c632f7b6c8d43d5998c61f7641.mat/MD5E-s306094--39c845c632f7b6c8d43d5998c61f7641.mat
+../../../.git/annex/objects/k6/xx/MD5E-s318029--0187ada307dccf133cb2aba1024cb77b.mat/MD5E-s318029--0187ada307dccf133cb2aba1024cb77b.mat

+ 1 - 0
data/outputs/history/sub-008_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/6F/PF/MD5E-s748--9a757ac05531c20717ba43188ed85005.txt/MD5E-s748--9a757ac05531c20717ba43188ed85005.txt

+ 1 - 1
data/outputs/history/sub-008_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/vj/4x/MD5E-s139189--fbedcb23b31671e95a4b09d8c9ff8c9b.mat/MD5E-s139189--fbedcb23b31671e95a4b09d8c9ff8c9b.mat
+../../../.git/annex/objects/q7/gj/MD5E-s149348--1262b21b0500de22fb0351852d0cbb9c.mat/MD5E-s149348--1262b21b0500de22fb0351852d0cbb9c.mat

+ 1 - 0
data/outputs/history/sub-009_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/2v/M8/MD5E-s739--2c49453465c08174dbaf0f89d96d42a2.txt/MD5E-s739--2c49453465c08174dbaf0f89d96d42a2.txt

+ 1 - 1
data/outputs/history/sub-009_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/x6/qg/MD5E-s140405--976019af75658afd43f41fff33da104e.mat/MD5E-s140405--976019af75658afd43f41fff33da104e.mat
+../../../.git/annex/objects/v9/4M/MD5E-s152132--1eb6f3151d89b594a71453c994d472b7.mat/MD5E-s152132--1eb6f3151d89b594a71453c994d472b7.mat

+ 1 - 0
data/outputs/history/sub-010_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/fz/Gg/MD5E-s743--9df4c33b4a93b393da12ec663883f77b.txt/MD5E-s743--9df4c33b4a93b393da12ec663883f77b.txt

+ 1 - 1
data/outputs/history/sub-010_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/W0/5p/MD5E-s166888--a3ce422b493ea462e1a176e845fdff18.mat/MD5E-s166888--a3ce422b493ea462e1a176e845fdff18.mat
+../../../.git/annex/objects/Px/Vx/MD5E-s179187--5e39c84e31d028fd4b0ad57112058262.mat/MD5E-s179187--5e39c84e31d028fd4b0ad57112058262.mat

+ 1 - 0
data/outputs/history/sub-011_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/jV/kF/MD5E-s744--bbccff8f4ac7e6edca9bcb49dcb2c5c8.txt/MD5E-s744--bbccff8f4ac7e6edca9bcb49dcb2c5c8.txt

+ 1 - 1
data/outputs/history/sub-011_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/8W/65/MD5E-s198813--f6524a68970b8b29bf3019a0ffce14d6.mat/MD5E-s198813--f6524a68970b8b29bf3019a0ffce14d6.mat
+../../../.git/annex/objects/41/Mf/MD5E-s211148--9cce3898e490bd28af37214721a3a256.mat/MD5E-s211148--9cce3898e490bd28af37214721a3a256.mat

+ 1 - 0
data/outputs/history/sub-012_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/VG/zx/MD5E-s740--fb7e0ec3bb0a4a5c41b38037cadf3079.txt/MD5E-s740--fb7e0ec3bb0a4a5c41b38037cadf3079.txt

+ 1 - 1
data/outputs/history/sub-012_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/kQ/34/MD5E-s223238--927c5e4440008ddf35b542807a42f0ce.mat/MD5E-s223238--927c5e4440008ddf35b542807a42f0ce.mat
+../../../.git/annex/objects/V7/0Z/MD5E-s232982--60e4ce8485ecaf2d551d62743d0630a3.mat/MD5E-s232982--60e4ce8485ecaf2d551d62743d0630a3.mat

+ 1 - 0
data/outputs/history/sub-013_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/1g/7q/MD5E-s747--debbecb75e09764e05d2fd402e60c179.txt/MD5E-s747--debbecb75e09764e05d2fd402e60c179.txt

+ 1 - 1
data/outputs/history/sub-013_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/V0/x9/MD5E-s239918--b3cbff1f4e1454b1e7a7f3bfa6ff91f7.mat/MD5E-s239918--b3cbff1f4e1454b1e7a7f3bfa6ff91f7.mat
+../../../.git/annex/objects/f3/mz/MD5E-s251056--94bbf635b0fc37cb2ff9ae797908d6b4.mat/MD5E-s251056--94bbf635b0fc37cb2ff9ae797908d6b4.mat

+ 1 - 0
data/outputs/history/sub-014_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/qv/7Z/MD5E-s743--71f52b1c0d1b9fa69a313867990f377a.txt/MD5E-s743--71f52b1c0d1b9fa69a313867990f377a.txt

+ 1 - 1
data/outputs/history/sub-014_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/ww/Wg/MD5E-s255125--7a171f2dd4ff1c0023d2b9afe97b79ce.mat/MD5E-s255125--7a171f2dd4ff1c0023d2b9afe97b79ce.mat
+../../../.git/annex/objects/KP/7Z/MD5E-s265668--65e7e9ac5cf61663a784f7214062c1f0.mat/MD5E-s265668--65e7e9ac5cf61663a784f7214062c1f0.mat

+ 1 - 0
data/outputs/history/sub-015_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/7F/FM/MD5E-s745--d81413a67876d19e854b11aae4e17437.txt/MD5E-s745--d81413a67876d19e854b11aae4e17437.txt

+ 1 - 1
data/outputs/history/sub-015_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/W0/0M/MD5E-s271425--1de417966dc8a087271538fe9bcd7eec.mat/MD5E-s271425--1de417966dc8a087271538fe9bcd7eec.mat
+../../../.git/annex/objects/KV/1g/MD5E-s282036--43603f03521e74e6cf2c954058872b0d.mat/MD5E-s282036--43603f03521e74e6cf2c954058872b0d.mat

+ 1 - 0
data/outputs/history/sub-016_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/z4/6p/MD5E-s748--f5f781848c9d524f34490e904dc2b130.txt/MD5E-s748--f5f781848c9d524f34490e904dc2b130.txt

+ 1 - 1
data/outputs/history/sub-016_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/Gw/zZ/MD5E-s294920--f09b72a974f5bcbc22164e525e3fc737.mat/MD5E-s294920--f09b72a974f5bcbc22164e525e3fc737.mat
+../../../.git/annex/objects/m6/vf/MD5E-s305753--2432c307711faa554829f497082d086d.mat/MD5E-s305753--2432c307711faa554829f497082d086d.mat

+ 1 - 0
data/outputs/history/sub-017_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/kX/v2/MD5E-s746--4fb6ea32458862b0d854594c8427cc9d.txt/MD5E-s746--4fb6ea32458862b0d854594c8427cc9d.txt

+ 1 - 1
data/outputs/history/sub-017_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/GF/zj/MD5E-s314072--2aeec1c250afd6af26500b7bfb7ba49c.mat/MD5E-s314072--2aeec1c250afd6af26500b7bfb7ba49c.mat
+../../../.git/annex/objects/9G/Fm/MD5E-s324128--94ccd529ff9a6d34fdb91702c9198583.mat/MD5E-s324128--94ccd529ff9a6d34fdb91702c9198583.mat

+ 1 - 0
data/outputs/history/sub-018_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/pF/Zq/MD5E-s748--8a9e7bec3b5203f310146f2be7248560.txt/MD5E-s748--8a9e7bec3b5203f310146f2be7248560.txt

+ 1 - 1
data/outputs/history/sub-018_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/k4/0X/MD5E-s343858--8924d0dda58eceec332e471f2f8fca21.mat/MD5E-s343858--8924d0dda58eceec332e471f2f8fca21.mat
+../../../.git/annex/objects/72/qg/MD5E-s354049--57e9017a8d86f7bb00dba7b9d3d73323.mat/MD5E-s354049--57e9017a8d86f7bb00dba7b9d3d73323.mat

+ 1 - 0
data/outputs/history/sub-019_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/7j/fw/MD5E-s751--c3fd57bbf9a71dfe04c40619132ef94d.txt/MD5E-s751--c3fd57bbf9a71dfe04c40619132ef94d.txt

+ 1 - 1
data/outputs/history/sub-019_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/wm/vG/MD5E-s372303--2366032fccc930b1adce5c2b9b778170.mat/MD5E-s372303--2366032fccc930b1adce5c2b9b778170.mat
+../../../.git/annex/objects/5W/2m/MD5E-s383778--151c9f90c2099fe6abd4adbf41cceb49.mat/MD5E-s383778--151c9f90c2099fe6abd4adbf41cceb49.mat

+ 1 - 0
data/outputs/history/sub-020_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/qP/Kq/MD5E-s745--4cd48739daaaf758b71b4061647f09e4.txt/MD5E-s745--4cd48739daaaf758b71b4061647f09e4.txt

+ 1 - 1
data/outputs/history/sub-020_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/1Z/Pf/MD5E-s394995--87f71da49dde2ed419baafa10382c418.mat/MD5E-s394995--87f71da49dde2ed419baafa10382c418.mat
+../../../.git/annex/objects/78/Vw/MD5E-s405170--201af14524047118e7bf2df751bf12e9.mat/MD5E-s405170--201af14524047118e7bf2df751bf12e9.mat

+ 1 - 0
data/outputs/history/sub-021_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/q2/vf/MD5E-s483--8154a6f0758aa93e8ba27995b41e78c4.txt/MD5E-s483--8154a6f0758aa93e8ba27995b41e78c4.txt

+ 1 - 0
data/outputs/history/sub-022_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/w8/6Q/MD5E-s742--612f11f10f70b703ec8f90c1ed4ec720.txt/MD5E-s742--612f11f10f70b703ec8f90c1ed4ec720.txt

+ 1 - 1
data/outputs/history/sub-022_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/8J/4q/MD5E-s140148--d2527e4a3c75c95ff9c859174cb65aa0.mat/MD5E-s140148--d2527e4a3c75c95ff9c859174cb65aa0.mat
+../../../.git/annex/objects/Mm/8X/MD5E-s149021--8ed37e7a2bb27492572509dace45fa95.mat/MD5E-s149021--8ed37e7a2bb27492572509dace45fa95.mat

+ 1 - 0
data/outputs/history/sub-023_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/jV/6v/MD5E-s749--41b8ba0146eadccceffea191d2b40692.txt/MD5E-s749--41b8ba0146eadccceffea191d2b40692.txt

+ 1 - 1
data/outputs/history/sub-023_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/p9/xV/MD5E-s170125--7997c87124ad3fa0d92f4d364386b1c1.mat/MD5E-s170125--7997c87124ad3fa0d92f4d364386b1c1.mat
+../../../.git/annex/objects/GZ/4q/MD5E-s180642--89e8c98f88ff6ff4841624608ccba561.mat/MD5E-s180642--89e8c98f88ff6ff4841624608ccba561.mat

+ 1 - 0
data/outputs/history/sub-024_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/F9/95/MD5E-s744--a5963e461687986ee0be24387aad4fb0.txt/MD5E-s744--a5963e461687986ee0be24387aad4fb0.txt

+ 1 - 1
data/outputs/history/sub-024_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/KF/Q1/MD5E-s194315--7744e51d027b3cd5fd928116db857819.mat/MD5E-s194315--7744e51d027b3cd5fd928116db857819.mat
+../../../.git/annex/objects/K6/38/MD5E-s205707--01f1f70fc624154671b17918475cc2c7.mat/MD5E-s205707--01f1f70fc624154671b17918475cc2c7.mat

+ 1 - 0
data/outputs/history/sub-025_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/z7/80/MD5E-s740--fc4ec96a80174c5e95df737da85a3793.txt/MD5E-s740--fc4ec96a80174c5e95df737da85a3793.txt

+ 1 - 1
data/outputs/history/sub-025_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/5Q/gj/MD5E-s212873--1bace0cf982bda81f0ddc71b52a81d9f.mat/MD5E-s212873--1bace0cf982bda81f0ddc71b52a81d9f.mat
+../../../.git/annex/objects/vq/F3/MD5E-s223111--52f55f65697b5988be5ab87ce10d1e5d.mat/MD5E-s223111--52f55f65697b5988be5ab87ce10d1e5d.mat

+ 1 - 0
data/outputs/history/sub-026_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/7g/9k/MD5E-s750--d353a342797719fa3a977cf8c45f9bc5.txt/MD5E-s750--d353a342797719fa3a977cf8c45f9bc5.txt

+ 1 - 1
data/outputs/history/sub-026_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/Kz/GM/MD5E-s237748--819b7db12cd7cd2865b723b3e560eb88.mat/MD5E-s237748--819b7db12cd7cd2865b723b3e560eb88.mat
+../../../.git/annex/objects/Ww/QQ/MD5E-s249190--962e7a9bba927c6199ab79856222d520.mat/MD5E-s249190--962e7a9bba927c6199ab79856222d520.mat

+ 1 - 0
data/outputs/history/sub-027_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/KK/Xk/MD5E-s742--427615733988923e24c1fe32e7163804.txt/MD5E-s742--427615733988923e24c1fe32e7163804.txt

+ 1 - 1
data/outputs/history/sub-027_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/Gf/MX/MD5E-s263052--fecd1c391c751aad4c40e411b5ea16d6.mat/MD5E-s263052--fecd1c391c751aad4c40e411b5ea16d6.mat
+../../../.git/annex/objects/99/z6/MD5E-s272698--f738c0819165247811b75ea1aeff6f82.mat/MD5E-s272698--f738c0819165247811b75ea1aeff6f82.mat

+ 1 - 0
data/outputs/history/sub-028_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/zK/f9/MD5E-s747--611f7be829b11b7645cc80b5f6915f1b.txt/MD5E-s747--611f7be829b11b7645cc80b5f6915f1b.txt

+ 1 - 1
data/outputs/history/sub-028_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/87/g2/MD5E-s118708--b827ab02b9792c7e658bb8d9f70476c6.mat/MD5E-s118708--b827ab02b9792c7e658bb8d9f70476c6.mat
+../../../.git/annex/objects/5W/P3/MD5E-s130653--7a311ecaeec5e105aa2d8060c580e4ee.mat/MD5E-s130653--7a311ecaeec5e105aa2d8060c580e4ee.mat

+ 1 - 0
data/outputs/history/sub-029_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/0m/2v/MD5E-s743--44fa7959eb103799c0a7238eb16d6195.txt/MD5E-s743--44fa7959eb103799c0a7238eb16d6195.txt

+ 1 - 1
data/outputs/history/sub-029_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/x1/xf/MD5E-s149635--55300cdc23d156271c71aa82ff77a061.mat/MD5E-s149635--55300cdc23d156271c71aa82ff77a061.mat
+../../../.git/annex/objects/Kw/jw/MD5E-s159396--52feb9aec59edcbd2646019c4f971735.mat/MD5E-s159396--52feb9aec59edcbd2646019c4f971735.mat

+ 1 - 0
data/outputs/history/sub-030_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/PM/xk/MD5E-s742--d5215cb7941921b7eadf789f0cfbce39.txt/MD5E-s742--d5215cb7941921b7eadf789f0cfbce39.txt

+ 1 - 1
data/outputs/history/sub-030_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/gK/P0/MD5E-s166576--24fd88e8c5d318bbbfd5dc884ab19d5e.mat/MD5E-s166576--24fd88e8c5d318bbbfd5dc884ab19d5e.mat
+../../../.git/annex/objects/wF/MX/MD5E-s176110--769990c4e109157a8dc503dbe1097328.mat/MD5E-s176110--769990c4e109157a8dc503dbe1097328.mat

+ 1 - 0
data/outputs/history/sub-031_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/7P/Jw/MD5E-s749--a61b41236d8c33306eca162c1b8cc0dc.txt/MD5E-s749--a61b41236d8c33306eca162c1b8cc0dc.txt

+ 1 - 1
data/outputs/history/sub-031_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/Wp/mw/MD5E-s188966--460b128d943605d90fe5c51be183bcb0.mat/MD5E-s188966--460b128d943605d90fe5c51be183bcb0.mat
+../../../.git/annex/objects/2K/K1/MD5E-s200015--34b7cfd3a07e420cf5b914cbf6aeedc6.mat/MD5E-s200015--34b7cfd3a07e420cf5b914cbf6aeedc6.mat

+ 1 - 0
data/outputs/history/sub-032_task-xxxx_ArtCorr.txt

@@ -0,0 +1 @@
+../../../.git/annex/objects/J3/Zq/MD5E-s748--deac0880ceab62ec85035b0f8086cf5c.txt/MD5E-s748--deac0880ceab62ec85035b0f8086cf5c.txt

+ 1 - 1
data/outputs/history/sub-032_task-xxxx_config.mat

@@ -1 +1 @@
-../../../.git/annex/objects/4g/pp/MD5E-s218797--7d115b6c3937b060c5bef7f73237cb62.mat/MD5E-s218797--7d115b6c3937b060c5bef7f73237cb62.mat
+../../../.git/annex/objects/ZQ/k9/MD5E-s230290--a3d7f10c4a0d16e83ed7f227e555a2d7.mat/MD5E-s230290--a3d7f10c4a0d16e83ed7f227e555a2d7.mat

+ 1 - 0
tools/helpers/MWB_artfdetec_freq.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s4279--07a0e8ffe25b1fb9b472e4771052bfbf.m

+ 1 - 0
tools/helpers/MWB_artfdetec_kurt.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s4743--fddf0fc5644eb788a6a78a4fe2c996bc.m

+ 1 - 0
tools/helpers/MWB_iterative_outlierdetection.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s1287--2ea106a9ae61bf2eec2eb21808f1d0b1.m

+ 1 - 0
tools/helpers/THG_FASTER_1_channel_artifacts_20140302.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s1594--995b58e78a7c752344fa23c0dc3aea74.m

+ 1 - 0
tools/helpers/THG_FASTER_2_epoch_artifacts_20140302.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s1467--a5acbddebe4c3f6b3b9625a25205e0e2.m

+ 1 - 0
tools/helpers/THG_FASTER_3_ICA_artifacts_20140305.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s4622--e2880c8048884385a3a6b17ef6fc01db.m

+ 1 - 0
tools/helpers/THG_FASTER_4_channel_x_epoch_artifacts_20140302.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s2347--14ef9679734ea3faa7ab2080076160d1.m

+ 1 - 0
tools/helpers/THG_automatic_artifact_correction_trials_20170922.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s1386--38bc27a8d14453b195f5174e6dd3614d.m

+ 1 - 0
tools/helpers/cm_MWB_channel_x_epoch_artifacts_20170922.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s2012--ed8a007bb142868b6d8887bff42f9670.m

+ 1 - 0
tools/helpers/cm_heuristic_hurst_exponent_20140302.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s1529--2c0c7a1a9b3eb379d82b2f7898187988.m

+ 1 - 0
tools/helpers/cm_inv_fisher_Z_20130605.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s201--ea48de368d446b3bf5ab73e534c00429.m

+ 1 - 0
tools/helpers/cm_nanzscore_20140302.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s201--5fdbe21a3bdf062d2254ac7058e0e8fa.m

+ 1 - 0
tools/helpers/cm_outlier2nan_20140311.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s2236--6b0f08180eac0d20271b7dba2b0d1448.m

+ 1 - 0
tools/helpers/testboxplot.m

@@ -0,0 +1 @@
+/annex/objects/MD5E-s2886--fc36a6bc085699b64f8345aa2db1e327.m