forked from chassall/continuousfeedback
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis_02_prep.m
More file actions
56 lines (44 loc) · 1.7 KB
/
analysis_02_prep.m
File metadata and controls
56 lines (44 loc) · 1.7 KB
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
% Preprocess EEG for the continuous feedback processing project
%
% Other m-files required:
% EEGLAB toolbox https://github.com/sccn/eeglab
% /private/ccn_prep.m
% /private/ccnlabactichamp.locs
% /private/ccn_check.m
% /private/find_artifacts.m
% /private/make_erp.m
% Author: Cameron Hassall, Department of Psychiatry, University of Oxford
% email address: cameron.hassall@psych.ox.ac.uk
% Website: http://www.cameronhassall.com
% Participant strings
ps = {'01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21'};
% Set data folders - set as needed
if ispc
dataFolder = 'E:\OneDrive - Nexus365\Projects\2021_EEG_Gnomes_Hassall\data';
else
dataFolder = '/Users/chassall/OneDrive - Nexus365/Projects/2021_EEG_Gnomes_Hassall/data';
end
% ICA settings - which triggers? Window size?
icaTriggers = {'S 1','S 2','S 3','S 4','S 5','S 6'}; % Fixation cross
icaWindow = [-0.2 2.8];
% Artifact check settings - which triggers? Window size? Baseline?
checkTriggers = icaTriggers;
checkWindow = [-0.2 0.6];
baseline = [-200 0];
toRemove = {};
allBadChannels = {};
filters = [0.1 30];
badChannels = {};
reference = {'TP9','TP10'};
appendString = '';
artifactSettings.maxMin = 100;
artifactSettings.level = 100;
artifactSettings.step = 40;
artifactSettings.lowest = 0.1;
for p = 1:length(ps)
rng(2021); % Set for consistency
subName = ['sub-' ps{p}];
taskName = 'gnomes';
ccn_prep(dataFolder,subName,taskName,icaTriggers,icaWindow,filters,reference,badChannels,appendString);
allBadChannels{p} = ccn_check(dataFolder,subName,taskName,icaTriggers,checkWindow,baseline,artifactSettings);
end