-
Notifications
You must be signed in to change notification settings - Fork 1
/
combine_gradiometers.m
executable file
·75 lines (53 loc) · 1.78 KB
/
combine_gradiometers.m
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%% Combined gradiometers
clear all
clc
addpath /usr/local/spm12
addpath /work/imaging3/MEG/Camcan_word_recognition/scripts/spm_melek
spm('defaults', 'EEG')
%% Define your subject data MEG
% subjects option
data_path =
'/work/imaging3/MEG/Camcan_word_recognition/data/data_B_trans/aamod_meg_denoise_ICA_2_applytrajectory_00002/';
addpath
/work/imaging3/MEG/Camcan_word_recognition/functions/QueryFunction/QueryFun_v1;
q = [];
q.SessionList = {
'MEG'
'/work/imaging3/MEG/Camcan_word_recognition/data/data_B_trans/aamod_meg_denoise_ICA_2_applytrajectory_00002/*<ccID>/analysis_orthography_2/bdef_Mspm12_transdef_transrest_mf2pt2_wordrecog_raw.mat';
};
q = CCQuery_CheckFiles(q);
info = LoadSubIDs;
CCIDS = info.SubCCIDc;
%% options
S = [];
S.mode = 'scalp x time';
S.conditions = {'consonants';'words'};
S.timewin = [-100 600];
% dobascor = 1;
%% Loop through subjects
for idx = 1:numel(q.AllExistSubInd)
ii = q.AllExistSubInd(idx);
fname = q.FileNames.MEG{ii};
subjname = splitstring(fname,'/');
subjname = subjname{8};
this_dir = [data_path subjname '/' 'analysis_orthography_2'];
% this_megcomb = [this_dir
'/PPpmbdef_Mspm12_trans_mf2pt2_wordrecog_raw.mat'];
% if exist (this_megcomb, 'file') == 0 % if processing didn't run
yet
fprintf('\n**** Processing subject %s ****\n\n',CCIDS{ii})
% write file
input_MEG = [this_dir
'/bdef_Mspm12_transdef_transrest_mf2pt2_wordrecog_raw.mat'];
SS.D = input_MEG;
SS.mode = 'replacemeg';
SS.prefix = 'P';
D = spm_eeg_combineplanar(SS);
% clear D;
% S = [];
% S.D = [this_dir
'/Pbdef_Mspm12_transdef_transrest_mf2pt2_wordrecog_raw.mat'];
% S.timewin = [-100 0];
% S.prefix='b';
% D = spm_eeg_bc(S);
end