-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.m
executable file
·49 lines (40 loc) · 1.56 KB
/
main.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
clc
clear
close all
%% Load a parcellation scheme and metaData
atlas.data = niftiread('../Data/AAL.nii.gz');
atlas.data(atlas.data>9000)=0;
atlas.hdr = niftiinfo('../Data/AAL.nii.gz');
load('../Data/roiAAL.mat','roiAAL');
roiAAL = roiAAL(1:90,:);
customAAL = readtable('../Data/custom_atlas.xlsx');
[atlasCustom,roiAALcustom] = mergeROIs(customAAL,roiAAL,atlas);
atlas.tbl = roiAAL;
atlasCustom.tbl = roiAALcustom;
atlas = atlasCustom;
clear roiAAL roiAALcustom atlasCustom customAAL
%% Load data
MNI_atlas = load('../Data/MNI_atlas_orig.mat');
load('../Data/metaData.mat');
HUP_atlasAll = load('../Data/HUP_atlas.mat');
EngelSFThres = 1.4;
spikeThresh = 24; % this is empirical, 1 spike/hour
%% univariate normaltive modelling of HUP-MNI
[norm_MNI_HUP_Atlas,iEEGhupAll,abrnormHUPAtlas] = ...
mainUnivar(metaData,atlas,MNI_atlas,HUP_atlasAll,EngelSFThres,spikeThresh);
iEEGhupAll_z = univariateAbr(norm_MNI_HUP_Atlas,iEEGhupAll);
%% save univariate
save("../data/norm_MNI_HUP_Atlas.mat", "norm_MNI_HUP_Atlas")
save("../data/custom_atlas_normative.mat", "atlas")
%% multivariate normaltive modelling of HUP-MNI
[norm_Connection,norm_ConnectionCount,pat_Connection,pat_ConnectionCount] = ...
mainNetwork(metaData,atlas,MNI_atlas,HUP_atlasAll,EngelSFThres,spikeThresh);
try
load('pat_ConnectionRedAAL_z.mat');
catch
pat_Connection = netowkrAbr(norm_Connection,pat_Connection);
end
abrConn = edgeslist2AbrConn(pat_Connection,HUP_atlasAll); % converts edge list to connectivity matrix
percentile_thres = 75;
iEEGhupAll_z = nodeAbrEdge(abrConn,iEEGhupAll_z,percentile_thres);
%%