-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
57 lines (41 loc) · 1.88 KB
/
main.py
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
from scripts import main_con as m
import os
import pickle
p = r"/data/rainville/HYPNOSIS_ASL_ANALYSIS/CBF_normalized"
conf_dir = (
r"/data/rainville/HYPNOSIS_ASL_ANALYSIS")
pwd_main = r"/data/rainville/dSutterlin/projects/resting_hypnosis/resting_state_hypnosis"
#p = r'/home/dsutterlin/projects/test_data/ASL_RS_hypnosis/CBF_4D_normalized'
#conf_dir = False
#pwd_main = r"/home/dsutterlin/projects/resting_state_hypnosis/resting_state_hypnosis"
data, fcdict = m.con_matrix(
p,
pwd_main=pwd_main,
conf_dir=conf_dir,
save_base= os.path.join(pwd_main, 'debug'),
save_folder="difumo64_correl_noProc",
atlas_name="difumo64",
sphere_coord = [(54, -28, 26)],
connectivity_measure="correlation",
n_sub = None,
verbose=True,
remove_ROI_maps = [8,14,43], # based on masker report, outside brain or no interest
remove_subjects = ['APM_07_H1', 'APM_11_H1', 'APM_22_H2'] # based on rainville et al., 2019 and .xlsx file
)
graphs = m.connectome_analyses(data, fcdict, bootstrap = 400)
with open(os.path.join(pwd_main,'debug', 'difumo64_correl_noProc', 'data.pkl'),'rb') as f:
data = pickle.load(f)
with open(os.path.join(pwd_main,'debug', 'difumo64_correl_noProc', 'graphs_dict.pkl'),'rb') as f:
graphs = pickle.load(f)
cv_results = m.prediction_analyses(data, graphs, n_permut = 200, verbose = False)
'''
import matplotlib.pyplot as plt
import pickle
with open(os.path.join(pwd_main, 'debug', 'difumo64_correlation', 'dict_connectomes.pkl'), 'rb') as f:
results_con = pickle.load(f)
with open(os.path.join(pwd_main, 'debug', 'difumo64_correlation', 'data.pkl'), 'rb') as f:
data = pickle.load(f)
with open(os.path.join(pwd_main, 'debug', 'difumo64_correlation', 'atlas_labels.pkl'), 'rb') as f:
labels = pickle.load(f)
save_to = os.path.join(pwd_main, 'debug', 'difumo64_correlation')
'''