forked from dagush/WholeBrain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DecoEtAl2018_Fig3A.py
69 lines (62 loc) · 3.01 KB
/
DecoEtAl2018_Fig3A.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
58
59
60
61
62
63
64
65
66
67
68
69
# ==========================================================================
# ==========================================================================
# Computes the Functional Connectivity Dynamics (FCD)
#
# From the original code:
# --------------------------------------------------------------------------
#
# Computes simulations with the Dynamic Mean Field Model (DMF) using
# Feedback Inhibitory Control (FIC) and Regional Drug Receptor Modulation (RDRM):
#
# - the optimal coupling (we=2.1) for fitting the placebo condition
# - the optimal neuromodulator gain for fitting the LSD condition (wge=0.2)
#
# Taken from the code (Code_Figure3.m) from:
#
# [DecoEtAl_2018] Deco,G., Cruzat,J., Cabral, J., Knudsen,G.M., Carhart-Harris,R.L., Whybrow,P.C.,
# Whole-brain multimodal neuroimaging model using serotonin receptor maps explain non-linear functional effects of LSD
# Logothetis,N.K. & Kringelbach,M.L. (2018) Current Biology
# https://www.cell.com/current-biology/pdfExtended/S0960-9822(18)31045-5
#
# Code written by Josephine Cruzat [email protected]
#
# Translated to Python by Gustavo Patow
# ==========================================================================
# ==========================================================================
import numpy as np
import scipy.io as sio
import matplotlib.pyplot as plt
from pathlib import Path
filePath = 'Data_Produced/SC90/DecoEtAl2018_fneuro.mat'
if not Path(filePath).is_file():
import DecoEtAl2018_Prepro_fgain_Neuro as prepro
prepro.prepro_G_Optim()
print('Loading {}'.format(filePath))
fNeuro = sio.loadmat(filePath)
WEs = fNeuro['we'].flatten()
# fitting_LSD = fNeuro['fitting_LSD'].flatten()
fitting_PLA = fNeuro['fitting_PLA'].flatten()
# FCDfitt_LSD = fNeuro['FCDfitt_LSD'].flatten()
FCDfitt_PLA = fNeuro['FCDfitt_PLA'].flatten()
# mFCDfitt5 = np.mean(FCDfitt5,2);
# stdFCDfitt5 = np.std(FCDfitt5,[],2);
# mfitting5 = np.mean(fitting5,2);
# stdfitting5 = np.std(fitting5,[],2);
maxFC = WEs[np.argmax(fitting_PLA)]
minFCD = WEs[np.argmin(FCDfitt_PLA)]
print("\n\n#####################################################################################################")
print(f"# Max FC({maxFC}) = {np.max(fitting_PLA)} ** Min FCD({minFCD}) = {np.min(FCDfitt_PLA)} **")
print("#####################################################################################################\n\n")
plt.rcParams.update({'font.size': 15})
plotFCDpla, = plt.plot(WEs, FCDfitt_PLA)
plotFCDpla.set_label("FCD placebo")
plotFCpla, = plt.plot(WEs, fitting_PLA)
plotFCpla.set_label("FC placebo")
plt.title("Whole-brain fitting")
plt.ylabel("Fitting")
plt.xlabel("Global Coupling (G = we)")
plt.legend()
plt.show()
# ================================================================================================================
# ================================================================================================================
# ================================================================================================================EOF