Alterations in topological and dynamical parameters correlate with disease biomarkers and neuropsychological scores in prodromic stages of dementia.
The 1 match
- [1] § Methods › Virtual brain modelling ↔ TVB_rww_notebook.ipynb, lines 147–175 · score 0.74 · Wong Wang, neural mass model, fMRI, BOLD signal, global coupling, denotes
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 579 lines · 25 KB · no license · 1 match
- # %% [markdown]
- # <h1 align="center"><font size="7" face="arial" color="#D9027D">Modelling Resting State with TVB</font></h1>
- # %% [markdown]
- # <h3 align="center"><span style="font-weight:normal"><font size="4.5" face="arial">
- # Anita Monteverdi, Fulvia Palesi, Marta Gaviraghi, and Roberta Maria Lorenzi </font></span></h3>
- # %% [markdown]
- # <h1><font size="6" face="arial" color="#BF026D">Context</font></h1>
- #
- # ***
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">A current topic in system neuroscience literature is the presence of brain activity in the absence of a task condition. These task-negative, spontaneous fluctuations occur in the so-called <b>rest state</b>, and a recurring theme of these fluctuations is that they have a network structure. Because TVB uses the structural connectivity of the brain as the backbone for simulating spontaneous activity, resting state activity and its network structure is a prime candidate for modeling in TVB.</font></div></p>
- # %% [markdown]
- # <h1><font size="6" face="arial" color="#BF026D">Objectives</font></h1>
- #
- # ***
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">In this notebook, we will start from <b>Zimmerman et al, 2018 </b> to:
- # <br>
- # <ul>
- # <li>Build a brain network model using subject-specific structural connectivity,</li>
- # <li>Globally optimize parameters of the models,</li>
- # <li>Define and simulate dynamics of the whole brain at rest,</li>
- # <li>Characterize the resting-state activity using the functional connectivity (FC).</li></ul></font></div></p>
- #
- # </br>
- # <br>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman"><u>References:</u></font></div></p>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman"><blockquote>
- # <li> Zimmermann, J., Perry, A., Breakspeare, M. et al. <b> Differentiation of Alzheimer's disease based on local and global parameters in personalized Virtual Brain models.</b> NeuroImage:Clinical, 2018, 19, 240-251.</li>
- # %% [markdown]
- # <h1><font size="6" face="arial" color="#BF026D">Exercise</font></h1>
- #
- # ***
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman"></font></div></p>
- #
- # <h2><font size="5"face="arial" color="black">How to do it with TVB?</font></h2>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">In the first part of this tutorial, we presents the basic anatomy of a region simulation using The Virtual Brain scripting interface.
- # The first thing we want to do is to import the modules we will need for a simulation.</font></div></p>
- # %%
- %pip install tvb
- # %%
- %matplotlib inline
- # %%
- %%capture
- # Import a bunch of stuff to ease command line usage
- import os
- import numpy as np
- import time as tm
- import matplotlib
- import matplotlib.pyplot as plt
- from tvb.simulator.lab import *
- from tvb.datatypes.time_series import TimeSeriesRegion
- from tvb.datatypes import graph
- # %% [markdown]
- # <h1><font size="5.5" face="arial" color="black">1. Load and prepare connectivity data</font></h1>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">Load in and prepare the structural connectivity and functional connectivity from the source we are using.</font></div></p>
- #
- # <h2><font size="4.5"face="arial" color="black"> Subject-specific structural connectivity</font></h2>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">Here, we use a <b>Structural Connectivity (SC) of 126 regions</b> derived from Diffusion Weighted Imaging (DWI) and Constrained Spherical Deconvolution tractography, as previously published in <b>Palesi et al. (2020)</b>. Connections in this SC matrix were defined with an ad-hoc parcellation scheme combining cerebral cortical and subcortical parcellations (<b>Tzourio-Mazoyer et al., 2002</b>) with cerebellar ones (SUIT, <b>Diedrichsen et al., 2009</b>).
- # <br>We start by loading and visualizing the SC matrix that represents the set of all existing connections between brain areas.</font></div></p>
- #
- # <h2><font size="4.5"face="arial" color="black"> Subject-specific functional connectivity</font></h2>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">For the same subject, we use a static <b>Functional Connectivity (FC) </b> whose edges were defined as the correlation between the time-courses of pairs of the 126 regions.
- # <br>We start by loading and visualizing the SC matrix that represents the set of all existing connections between brain areas.</font></div></p>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman"><u>References:</u></font></div></p>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman"><blockquote>(Palesi et al., 2020): Palesi, F., Lorenzi, R. M., Casellato, C., Ritter, P., Jirsa, V., Wheeler- kingshott, C. A. M. G., and Angelo, E. D. (2020). <b>The importance of cerebellar connectivity on simulated brain dynamics. </b>Frontiers in Cellular Neuroscience, 14,1–11. <br />
- # <br>(Monteverdi et al., 2022): Monteverdi A, Palesi F, Costa A, Vitali P, Pichiecchio A, Cotta Ramusino M, Bernini S, Jirsa V,
- # Gandini Wheeler-Kingshott CAM and D’Angelo E (2022) <b>Subject-specific features of excitation/inhibition profiles in neurodegenerative diseases.</b>
- # Front. Aging Neurosci. 14:868342. doi: 10.3389/fnagi.2022.868342<br />
- # <br>(Tzourio-Mazoyer et al., 2002): Tzourio-Mazoyer, N., Landeau, B., Papathanassiou, D., Crivello, F., Etard, O., Delcroix, N., et al. (2002). <b>Automated anatomical labeling ofactivations in SPM using a macroscopic anatomical parcellation of the MNI MRI single-subject brain. </b>Neuroimage 15, 273–289. doi: 10.1006/nimg.2001.0978.<br />
- # <br>(Diedrichsen et al., 2009): Diedrichsen, J., Balsters, J. H., Flavell, J., Cussans, E., and Ramnani, N. (2009). <b>A probabilistic MR atlas of the human cerebellum.</b> Neuroimage 46, 39–46. doi: 10.1016/j.neuroimage.2009.01.045.<br /></blockquote></font></div></p>
- # %%
- from google.colab import drive
- drive.mount('/content/gdrive')
- # %%
- # Change the path of your Google Drive with the Tutorial folder
- root_path = '/content/gdrive/MyDrive/04_TVB/'
- # %%
- # Define paths for importing empirical structural (SC) and functional connectivity (FC)
- pathSC = root_path + 'TVB_data/Conn_plusCRBL.zip'
- pathFC = root_path + 'TVB_data/functZ_sparse.txt'
- # %%
- # Import empirical connectivities
- #STRUCTURAL
- con = connectivity.Connectivity.from_file(pathSC)
- #Define the average axonal speed
- con.speed = np.array(10)
- print ('')
- print ('Maximum SC value = %10.4f' % np.max(con.weights))
- #FUNCTIONAL
- con_FC = np.genfromtxt(pathFC)
- # %%
- # Visualize the empirical SC, time delays along SC edges, and FC matrices
- fig=plt.figure(figsize=(12,5))
- #labels=con.region_labels[0:126:5]
- labels=con.region_labels[0:-1:5]
- # SC
- plt.subplot(131)
- #cs=imshow(np.log10(con.weights), cmap='jet', aspect='equal', interpolation='none')
- cs=plt.imshow(con.weights, interpolation='none', aspect='equal', cmap='jet', vmax=0.005)
- plt.title('Empirical SC', fontsize=14)
- plt.xticks(np.arange(0, len(con.region_labels)-1, step=5), labels, fontsize=7, rotation=90)
- plt.yticks(np.arange(0, len(con.region_labels)-1, step=5), labels, fontsize=7)
- axcb=plt.colorbar(cs, shrink=0.4)
- axcb.set_label('weights', fontsize=11)
- #delays
- plt.subplot(132)
- plt.imshow(con.tract_lengths/con.speed, interpolation='none', aspect='equal', cmap='jet')
- plt.title('Conduction delays', fontsize=14)
- axcb=plt.colorbar(shrink=0.4)
- axcb.set_label('delays [ms]', fontsize=11)
- # empirical FC
- plt.subplot(133)
- plt.imshow(con_FC, interpolation='nearest', aspect='equal', cmap='jet')
- plt.title('Empirical FC', fontsize=14)
- cb=plt.colorbar(shrink=0.4, ticks=[-0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
- cb.set_label('PPC', fontsize=11)
- plt.show
- # %% [markdown]
- # <h3><font size="5" face="arial" color="black"> 2 Model</font></h3>
- #
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">In this tutorial, we will use a computational model of resting-state network dynamics: the <b>Reduced Wong-Wang</b>, previously introduced in <b>(Hansen et al., 2015)</b>. This model is a reduction of the model presented in <b>(Wong & Wang, 2006)</b> to a single population model and used in a modeling study of resting-state <b>(Deco et al., 2013; Hansen et al., 2015)</b>. The neural activity of each node is given by the following equations:</font></div></p>
- #
- # \begin{eqnarray}
- # \dfrac{\text{d}S_{i}}{\text{d}t} &=& \dfrac{-S_{i}}{\tau_{s}} + \gamma \ (1 - S_{i})\ H(x_{i}) + \sigma\eta_{i}(t)\\
- # &\\
- # H(x_{i}) &=& \dfrac{ax_{i} - b}{1 - \exp(-d \ (ax_{i} - b))}\\
- # &\\
- # x_{i} &=& wJ_{N}S_{i} + J_{N}G\sum_{j}C_{ij}S_{j} + I_{0}
- # \end{eqnarray}
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">where $S_{i}$ denotes the average synaptic gating variable at the local area $i$, $H(x_{i})$ is a sigmoid function that converts the input synaptic activity $x_{i}$ into an output population firing rate.</font></div></p>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">$C_{ij}$ are the entries of the anatomical structural connectivity matrix reweigthed by the global coupling parameter $G$, with which we will study the optimal dynamical working region where the simulations maximally fit the empirical FC. $\eta_{i}(t)$ is a Gaussian white noise with a noise amplitude $\sigma = 0.001.$</font></div></p>
- #
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">This <b>biologically realistic</b> neural mass model is able to reproduce <b>time-averaged resting state FC</b> as well as the recently introduced <b>FC dynamics</b> with fMRI BOLD signals.</font></div></p>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman"><u>References:</u></font></div></p>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman"><blockquote>(Wong & Wang, 2006): Wong, K.-F. & Wang, X.-J. <b>A recurrent network mechanism of time integration in perceptual decision.</b> J. Neurosci., 2006, 26, 1314-1328. <br />
- # <br>(Deco et al., 2013): Deco, G., Ponce-Alvarez, A., Mantini, D., Romani, G.L., Hagmann, P. & Corbetta, M. <b>Resting-state functional connectivity emerges from structurally and dynamically shaped slow linear fluctuations.</b> J. Neurosci., 32(27), 11239-11252, 2013.<br />
- # <br>(Hansen et al., 2015): Hansen, E.C., Battaglia, D., Spiegler, A., Deco, G. & Jirsa V.K. <b>Functional connectivity dynamics: modeling the switching behavior of the resting-state.</b> NeuroImage, 105(2015), 525-535.<br />
- # %%
- # Initialise a Model.
- g2d = models.ReducedWongWang()
- g2d
- # %% [markdown]
- # <h3><font size="5"face="arial" color="black"> 3 Coupling function</font></h3>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">The coupling function is used to join the local model dynamics at distinct spatial locations.</font></div></p>
- # %%
- # Initialise a Coupling function.
- G = np.array(7.5)
- con_coupling = coupling.Scaling(a=G)
- # %% [markdown]
- # <h3><font size="5"face="arial" color="black"> 4 Integrator</font></h3>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">Now that we have defined our structure and dynamics, we need to select an integration scheme.
- #
- # <br>We use a stochastic integration scheme where the noise is added. The shape of the noise must correspond to the number of state variables in neural mass models, here equal to 1.
- # We integrate the coupling and the stochastic terms using a <b>HeunStochastic</b> method, otherwise you can use the detrministic version <b>HeunDeterministic</b>. The step size for the simulation is 0.5.
- # <br>By default in TVB, the stochastic method assumes that the standard deviation of the noise is a constant equal to: $\sqrt{(2\sigma)}$.
- #
- # <br>
- #
- # <b>NOTE</b> that the most important thing here is to use a step size that is small enough for the integration to be numerically stable.</font></div></p>
- # %%
- # Initialise an Integrator scheme.
- dt = 0.5 #integration steps [ms]
- #Change dt to assess how much it impact on the final results
- # We can use the deteministic integrator:
- # heunint = integrators.HeunDeterministic(dt=dt)
- D = 0.001 #standard deviation of the noise
- heunstoc=integrators.HeunStochastic(dt=dt, noise=noise.Additive(nsig=np.array([(D**2)/2])))
- # %% [markdown]
- # <h3><font size="5"face="arial" color="black"> 5 Monitors</font></h3>
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">The last component is Monitor: observer models.
- #
- # <br>Here we select two monitors to get the time series of the model state variables. First, one of the simplest:
- #
- # * the <b>TemporalAverage</b> monitor averages over a time window of length period returning one time point every period (given in ms).
- #
- # Then, among other Monitors which apply a biophysical measurement process to the simulated neural activity, such as EEG, MEG, etc, we would like to relate the simulated neural activity to recent fMRI studies, thus we chose:
- #
- # * the <b>BOLD</b> monitor to generate BOLD signal for each regions by using a hemodynamic model.</font></div></p>
- # %%
- # Initialise some Monitors with period in physical time.
- mon_tavg = monitors.TemporalAverage(period=1.) #1000 Hz
- TR = 720
- mon_bold = monitors.Bold(period=TR)
- #Bundle them
- what_to_watch = (mon_tavg,mon_bold)
- # %% [markdown]
- # <h1 align="center"><font size="6"face="arial" color="black">Go! Simulate</font></h1>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">The last step is to bring all these components together into a <b>Simulator</b> object. We then need to run the configure method, which basically just acts to calculate information necessary for the simulation that draws on specific combinations of the components.</font></div></p>
- # %%
- # Initialise the Simulator.
- regime={'w':np.array(1.), 'I_o':np.array(0.3)}
- sim = simulator.Simulator(
- model=models.ReducedWongWang(**regime),
- connectivity=con,
- coupling=con_coupling,
- conduction_speed=float(con.speed),
- integrator=heunstoc,
- monitors=what_to_watch)
- sim.initial_conditions = 0.001*np.ones((1, 1, con.weights.shape[0], 1))
- sim.configure()
- # %% [markdown]
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">Now, we can run the simulation. All we need to do is iterate for some length, which we provide in *ms*, and collect the output.
- #
- # The data returned by the simulator is in the form of a list of arrays.</font></div></p>
- # %%
- # Perform the simulation.
- tic = tm.time()
- tavg_data, tavg_time = [], []
- bold_data, bold_time = [], []
- for tavg, bold in sim(simulation_length=360000.):
- if not tavg is None:
- tavg_time.append(tavg[0])
- tavg_data.append(tavg[1])
- if not bold is None:
- bold_time.append(bold[0])
- bold_data.append(bold[1])
- 'simulation required %0.3f seconds.' % (tm.time()-tic)
- # %% [markdown]
- # <h1 align="center"><font size="6"face="arial" color="black">Visualize our simulation</font></h1>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">And finally, we can look at the results of our simulation, first in terms of time series...</font></div></p>
- # %%
- # Normalize the time series
- tavg_data /= (np.max(tavg_data, 0) - np.min(tavg_data, 0))
- # Make the lists numpy.arrays for easier use.
- TAVG = np.squeeze(np.array(tavg_data))
- # Plot the temporally averaged time series
- fig2 = plt.figure(figsize=(12,8))
- plt.subplot(3,1,1)
- plt.plot(tavg_time[:], TAVG[:, 0], 'r')
- plt.ylabel(con.region_labels[0],fontsize=13)
- plt.subplot(3,1,2)
- plt.plot(tavg_time[:], TAVG[:, 1], 'c')
- plt.ylabel(con.region_labels[1],fontsize=13)
- plt.subplot(3,1,3)
- plt.plot(tavg_time[:], TAVG[:, 2], 'g')
- plt.xlabel('Time [ms]', fontsize=13)
- plt.ylabel(con.region_labels[2],fontsize=13)
- plt.show()
- # %% [markdown]
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">...And then reconstructing the simulated FC</font></div></p>
- # %%
- def eval_fc(tsr):
- input_shape = tsr.data.shape
- result_shape = (input_shape[2], input_shape[2], input_shape[1], input_shape[3])
- result = np.zeros(result_shape)
- for mode in range(result_shape[3]):
- for var in range(result_shape[2]):
- data = tsr.data[:,var,:, mode].squeeze()
- result[:, :, var, mode] = np.corrcoef(data.T)
- corr_coeff = graph.CorrelationCoefficients(source=tsr, array_data=result)
- return corr_coeff
- # %%
- # Discarded first 10 volumes
- data = np.array(bold_data[10:int(360000/720)])
- # Build a TimeSeries Dataype
- tsr = TimeSeriesRegion(connectivity=con,
- data=data,
- sample_period=sim.monitors[1].period)
- tsr.configure()
- # Compute FC
- corrcoeff_data = eval_fc(tsr)
- FC = corrcoeff_data.array_data[..., 0, 0]
- empFC_wb = np.triu(con_FC, 1) #triangle matrix
- simFC_wb = np.triu(FC, 1)
- pcc_wb = np.corrcoef(empFC_wb.ravel(), simFC_wb.ravel())[0, 1]
- print ('Similarity between empFC and simFC in the whole-brain network: %10.4f' % pcc_wb)
- # Visualize and compare the simulated FC and the empirical FC
- fig=plt.figure(figsize=(17,7))
- # whole-brain network: FC_wb
- plt.subplot(131)
- p1=plt.imshow(FC, interpolation='nearest', aspect='equal', cmap='jet')
- plt.title('Whole-brain simFC', fontsize=14)
- cb1=plt.colorbar(p1, shrink=0.325, ticks=[-0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
- plt.subplot(132)
- p1=plt.imshow(con_FC, interpolation='nearest', aspect='equal', cmap='jet')
- plt.title('Whole-brain empFC', fontsize=14)
- cb1=plt.colorbar(p1, shrink=0.325, ticks=[-0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
- # %% [markdown]
- # <h1 align="center"><font size="6"face="arial" color="#BF026D">Optimize the model!</font></h1>
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">The simulation is ended but the model wasn't tune and optimize. Here we add a function for the optimization steps. </font></div></p>
- # %%
- def run_rww_sim_pcc(con, G, regime, D, dt, TR, simlen):
- # Initialise Simulator.
- sim = simulator.Simulator(
- model=models.ReducedWongWang(**regime),
- connectivity=con,
- coupling=coupling.Scaling(a=np.array(G)),
- conduction_speed=float(con.speed),
- integrator=integrators.HeunStochastic(dt=dt, noise=noise.Additive(nsig=np.array([(D**2)/2]))),
- monitors=(monitors.Bold(period=TR),)
- )
- sim.initial_conditions = (0.001)*np.ones((1, 1, con.weights.shape[0], 1))
- sim.configure()
- # Lunch simulation
- (t, B), = sim.run(simulation_length=simlen)
- # Remove transcient time
- B = B[10:int(simlen/TR), :, :, :]
- # Built a TiemSeries Datatype
- tsr = TimeSeriesRegion(connectivity=con,
- data=B,
- sample_period=sim.monitors[0].period)
- tsr.configure()
- # Compute FC
- corrcoeff_data = eval_fc(tsr)
- FC = corrcoeff_data.array_data[..., 0, 0]
- # Take triangular upper part of FC
- FC_triu = np.triu(FC, 1)
- # Compute Pearson correlation
- pcc_FC = np.corrcoef(np.triu(con_FC, 1).ravel(), FC_triu.ravel())[0, 1]
- pcc_SC = np.corrcoef(np.triu(con.weights, 1).ravel(), FC_triu.ravel())[0, 1]
- return pcc_FC, pcc_SC
- # %%
- #IT TAKES ABOUT 15-20 MINUTES
- tic = tm.time()
- # Run G sweep
- Gs = np.arange(5, 30, 0.5)
- regime = {'a': np.array(270.), 'b':np.array(108.), 'd':np.array(0.154),
- 'gamma':np.array(0.641/1000), 'w':np.array(1.), 'I_o':np.array(0.3)}
- pcc_FC = np.zeros((len(Gs)))
- pcc_SC = np.zeros((len(Gs)))
- print('simulation start.')
- for iG, G in enumerate(Gs):
- print("simulation : G %1.1f" % G)
- pcc_FC[iG], pcc_SC[iG] = run_rww_sim_pcc(con, Gs[iG], regime, 0.001, 1, 720, 60000)
- 'simulation required %0.3f seconds.' % (tm.time()-tic)
- # %%
- #DON'T RUN THIS CELL IF YOU DIDN'T RUN THE CELL ABOVE
- # Visualize
- plt.figure(figsize=(10,8))
- # FC and SC
- plt.plot(Gs, pcc_FC, '-*', label='FC - FC')
- plt.plot(Gs, pcc_SC, '-*g', label='SC - FC')
- plt.xlabel('$G_{coupl}$', fontsize=20);
- plt.title('Correlation Diagram', fontsize=20)
- plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
- plt.show()
- Gopt = Gs[np.argmax(pcc_FC)]
- print ('The optimal value for the global coupling is: %5.1f' % Gopt)
- # %%
- # Initialise a Coupling function at the optimal value of G
- G = np.array(26)
- con_coupling = coupling.Scaling(a=G)
- # %%
- #IT IS NOT NEEDED SINCE WE HAVE ALREADY INITIALISED IT
- # Initialise an Integrator scheme.
- dt = 0.5 #integration steps [ms]
- D = 0.001 #standard deviation of the noise
- heunstoc=integrators.HeunStochastic(dt=dt, noise=noise.Additive(nsig=np.array([(D**2)/2])))
- # %%
- #IT IS NOT NEEDED SINCE WE HAVE ALREADY INITIALISED IT
- # Initialise some Monitors with period in physical time.
- mon_tavg = monitors.TemporalAverage(period=1.) #1000 Hz
- TR = 720
- mon_bold = monitors.Bold(period=TR)
- #Bundle them
- what_to_watch = (mon_tavg,mon_bold)
- # %%
- # Initialise the Simulator.
- regime={'w':np.array(1.), 'I_o':np.array(0.3)}
- sim = simulator.Simulator(
- model=models.ReducedWongWang(**regime),
- connectivity=con,
- coupling=con_coupling,
- conduction_speed=float(con.speed),
- integrator=heunstoc,
- monitors=what_to_watch)
- sim.initial_conditions = 0.001*np.ones((1, 1, con.weights.shape[0], 1))
- sim.configure()
- # %%
- # Perform the simulation.
- tic = tm.time()
- tavg_data, tavg_time = [], []
- bold_data, bold_time = [], []
- for tavg, bold in sim(simulation_length=360000.):
- if not tavg is None:
- tavg_time.append(tavg[0])
- tavg_data.append(tavg[1])
- if not bold is None:
- bold_time.append(bold[0])
- bold_data.append(bold[1])
- 'simulation required %0.3f seconds.' % (tm.time()-tic)
- # %% [markdown]
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">Visualize the simulation</font></div></p>
- # %%
- # Normalize the time series
- tavg_data /= (np.max(tavg_data, 0) - np.min(tavg_data, 0))
- # Make the lists numpy.arrays for easier use.
- TAVG = np.squeeze(np.array(tavg_data))
- # Plot the temporally averaged time series
- fig2 = plt.figure(figsize=(12,8))
- plt.subplot(3,1,1)
- plt.plot(tavg_time[:], TAVG[:, 0], 'r')
- plt.ylabel(con.region_labels[0],fontsize=13)
- plt.subplot(3,1,2)
- plt.plot(tavg_time[:], TAVG[:, 1], 'c')
- plt.ylabel(con.region_labels[1],fontsize=13)
- plt.subplot(3,1,3)
- plt.plot(tavg_time[:], TAVG[:, 2], 'g')
- plt.xlabel('Time [ms]', fontsize=13)
- plt.ylabel(con.region_labels[2],fontsize=13)
- plt.show()
- # %%
- # Normalize the time series
- tavg_data /= (np.max(tavg_data, 0) - np.min(tavg_data, 0))
- # Make the lists numpy.arrays for easier use.
- TAVG = np.squeeze(np.array(tavg_data))
- # Plot the temporally averaged time series
- fig2 = plt.figure(figsize=(12,8))
- plt.subplot(3,1,1)
- plt.plot(tavg_time[10:int(360000/720)], TAVG[10:int(360000/720), 0], 'r')
- plt.ylabel(con.region_labels[0],fontsize=13)
- plt.subplot(3,1,2)
- plt.plot(tavg_time[10:int(360000/720)], TAVG[10:int(360000/720), 1], 'c')
- plt.ylabel(con.region_labels[1],fontsize=13)
- plt.subplot(3,1,3)
- plt.plot(tavg_time[10:int(360000/720)], TAVG[10:int(360000/720), 2], 'g')
- plt.xlabel('Time [ms]', fontsize=13)
- plt.ylabel(con.region_labels[2],fontsize=13)
- plt.show()
- # %% [markdown]
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">...And then reconstructing the simulated FC</font></div></p>
- # %%
- # Discarded first 10 volumes
- data = np.array(bold_data[10:int(360000/720)])
- # Build a TimeSeries Dataype
- tsr = TimeSeriesRegion(connectivity=con,
- data=data,
- sample_period=sim.monitors[1].period)
- tsr.configure()
- # Compute FC
- corrcoeff_data = eval_fc(tsr)
- FC = corrcoeff_data.array_data[..., 0, 0]
- empFC_wb = np.triu(con_FC, 1) #triangle matrix
- simFC_wb = np.triu(FC, 1)
- pcc_wb = np.corrcoef(empFC_wb.ravel(), simFC_wb.ravel())[0, 1]
- print ('Similarity between empFC and simFC in the whole-brain network: %10.4f' % pcc_wb)
- # Visualize and compare the simulated FC and the empirical FC
- fig=plt.figure(figsize=(17,7))
- # whole-brain network: FC_wb
- plt.subplot(131)
- p1=plt.imshow(FC, interpolation='nearest', aspect='equal', cmap='jet')
- plt.title('Whole-brain simFC', fontsize=14)
- cb1=plt.colorbar(p1, shrink=0.325, ticks=[-0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
- plt.subplot(132)
- p1=plt.imshow(con_FC, interpolation='nearest', aspect='equal', cmap='jet')
- plt.title('Whole-brain empFC', fontsize=14)
- cb1=plt.colorbar(p1, shrink=0.325, ticks=[-0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
- # %% [markdown]
- # <h1><font size="6" face="arial" color="#BF026D">Now, it's up to you!!</font></h1>
- #
- # ***
- #
- # <p><div style="text-align: justify"><font size="4.5" face="time roman">These results are starting point for modelling resting state, from which we can base our next simulations.
- #
- # You can choose one of the following further analyses:
- # <br>
- #
- # * Change the integration step of the Heun Stocastic integrator. Try with 1. What does it change?
- # * <b>Generate optimal whole-brain dynamics in a pathological subject</b>, like an Alzheimer's disease patient. To do this you can use data from files ending with _AD. **(TR = 3010 ms, simlen = 360000 ms)**
- # * <b>Simulate optimal brain dynamics in a local circuit </b> instead of whole-brain network. To do this you have to define a network that contains only few specific regions that are known to be functinally related one another. For example, the first 93 nodes are belonging to the cerebral connectivity. <i>Tip: for SC you have to set con.weights con.tract_lengths con.centres con.region_labels </i>
- #
- # </font></div></p>
TVB_rww_notebook.ipynb at commit 0aa8af8, no license · at the source
Overview
- Digital Neuroscience Centre, IRCCS Mondino Foundation,Pavia, Italy
- Unit of Behavioral Neurology, IRCCS Mondino Foundation,Pavia, Italy
- Institute for Advanced Studies (IUSS),Pavia, Italy
- Department of Brain and Behavioral Sciences, University of Pavia,Pavia, Italy
- Laboratory of Neuroinformatics, IRCCS Istituto Centro San Giovanni di Dio Fatebenefratelli,Brescia, Italy
- Advanced Imaging and Artificial Intelligence Center, IRCCS Mondino Foundation,Pavia, Italy
- IRCCS Istituto Auxologico Italiano,Milan, Italy
- Department of Neuroinflammation, Queen Square Multiple Sclerosis Centre, NMR Research Unit, UCL Queen Square Institute of Neurology,London, UK
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repositories
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
Anita-93/TVB_rww_tutorial
0aa8af8fa4f1685327f27e97f081a9e3b11e3088, 23 April 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
2 files
- TVB_rww_notebook.ipynb, Jupyter, 579 lines, 1 match
- README.md, Text, 46 lines
wiki.ebrains.eu/bin/view
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 1 script, each with its path and the digest of its content;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- zenodo:19481491, at Zenodo; found in “Data availability”
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to a dataset: Zenodo 19481491
- it points to the authors' code: Anita-93/
TVB_rww_tutorial , wiki.ebrains.eu/bin/ view
Read it in the paper: doi.org/10.1038/s41598-026-56387-8.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 17 authors, 8 keywords, 12 MeSH terms, 1 funder, 81 references.
Cite
This paper
Monteverdi, A., Cotta Ramusino, M., Conca, F., Manzon, S., Redolfi, A., Lupi, E., De Grazia, M., Lorenzi, R. M., Gaviraghi, M., Mazzocchi, L., Farina, L. M., Costa, A., Pichiecchio, A., Cappa, S. F., Gandini Wheeler-Kingshott, C. A. M., Palesi, F., & D’Angelo, E. (2026). Alterations in topological and dynamical parameters correlate with disease biomarkers and neuropsychological scores in prodromic stages of dementia. Scientific reports, 16(1), 28541. https://
BibTeX
@article{monteverdi2026a
author = {Monteverdi, Anita and Cotta Ramusino, Matteo and Conca, Francesca and Manzon, Sofia and Redolfi, Alberto and Lupi, Eleonora and De Grazia, Marialaura and Lorenzi, Roberta Maria and Gaviraghi, Marta and Mazzocchi, Laura and Farina, Lisa M. and Costa, Alfredo and Pichiecchio, Anna and Cappa, Stefano F. and Gandini Wheeler-Kingshott, Claudia A. M. and Palesi, Fulvia and D’Angelo, Egidio},
title = {{Alterations in topological and dynamical parameters correlate with disease biomarkers and neuropsychological scores in prodromic stages of dementia}},
journal = {Scientific reports},
year = {2026},
month = jun,
volume = {16},
number = {1},
pages = {28541},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/
url = {https://
pmid = {42260290},
pmcid = {PMC13572441}
}
RIS
TY - JOUR
AU - Monteverdi, Anita
AU - Cotta Ramusino, Matteo
AU - Conca, Francesca
AU - Manzon, Sofia
AU - Redolfi, Alberto
AU - Lupi, Eleonora
AU - De Grazia, Marialaura
AU - Lorenzi, Roberta Maria
AU - Gaviraghi, Marta
AU - Mazzocchi, Laura
AU - Farina, Lisa M.
AU - Costa, Alfredo
AU - Pichiecchio, Anna
AU - Cappa, Stefano F.
AU - Gandini Wheeler-Kingshott, Claudia A. M.
AU - Palesi, Fulvia
AU - D’Angelo, Egidio
TI - Alterations in topological and dynamical parameters correlate with disease biomarkers and neuropsychological scores in prodromic stages of dementia
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/
VL - 16
IS - 1
SP - 28541
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Alterations in topological and dynamical parameters correlate with disease biomarkers and neuropsychological scores in prodromic stages of dementia",
"container-title": "Scientific reports",
"author": [
{
"family": "Monteverdi",
"given": "Anita"
},
{
"family": "Cotta Ramusino",
"given": "Matteo"
},
{
"family": "Conca",
"given": "Francesca"
},
{
"family": "Manzon",
"given": "Sofia"
},
{
"family": "Redolfi",
"given": "Alberto"
},
{
"family": "Lupi",
"given": "Eleonora"
},
{
"family": "De Grazia",
"given": "Marialaura"
},
{
"family": "Lorenzi",
"given": "Roberta Maria"
},
{
"family": "Gaviraghi",
"given": "Marta"
},
{
"family": "Mazzocchi",
"given": "Laura"
},
{
"family": "Farina",
"given": "Lisa M."
},
{
"family": "Costa",
"given": "Alfredo"
},
{
"family": "Pichiecchio",
"given": "Anna"
},
{
"family": "Cappa",
"given": "Stefano F."
},
{
"family": "Gandini Wheeler-Kingshott",
"given": "Claudia A. M."
},
{
"family": "Palesi",
"given": "Fulvia"
},
{
"family": "D’Angelo",
"given": "Egidio"
}
],
"container-title-short":
"volume": "16",
"issue": "1",
"page": "28541",
"DOI": "10.1038/
"PMID": "42260290",
"PMCID": "PMC13572441",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
8
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1371/journal.pdig.0001445 [code]
- A digital twin approach for simultaneous reconstruction of brain anatomy and dynamics from neural data.Journal: PLOS digital healthIn common: 7 references
- [2] doi:10.1038/s41593-026-02205-3 [code]
- Competitive interactions shape mammalian brain network dynamics and computation.Journal: Nature neuroscienceIn common: Matplotlib, NumPy, 5 references
- [3] doi:10.1038/s43856-026-01707-2 [code]
- Decreased amyloid-related structure-function coupling in preclinical Alzheimer's disease.Journal: Communications medicineIn common: Matplotlib, NumPy, Alzheimer's / dementia, clinical / translational, 5 references
- [4] doi:10.1162/imag.a.1147 [code]
- The Virtual Brain links transcranial magnetic stimulation evoked potentials and inhibitory neurotransmitter changes in major depressive disorder.Journal: Imaging neuroscience (Cambridge, Mass.)In common: The Virtual Brain, Matplotlib, NumPy, 2 references
- [5] doi:10.7554/elife.108109 [code]
- Multimodal MRI marker of cognition explains the association between cognition and mental health in the UK Biobank.Journal: eLifeIn common: Matplotlib, NumPy, structural MRI / diffusion, 5 references
- [6] doi:10.1162/netn.a.543 [code]
- High-resolution Bayesian Virtual Epileptic Patient using neural field models.Journal: Network neuroscience (Cambridge, Mass.)In common: The Virtual Brain, Matplotlib, NumPy, 2 references
- [7] doi:10.1177/11795972251404254 [code]
- Blind Identification of Altered Functional Subnetworks in Alzheimer's Disease Using Resting-State fMRI.Journal: Biomedical engineering and computational biologyIn common: Alzheimer's / dementia, 4 references
- [8] doi:10.1371/journal.pbio.3003916 [code]
- Arousal-driven critical roaming reproduces human functional connectivity dynamics.Journal: PLoS biologyIn common: Matplotlib, NumPy, 3 references
- [9] doi:10.1162/imag.a.1252 [code]
- Does the brain's E:I balance really shape long-range temporal correlations? Lessons learned from 3T MRI.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Matplotlib, NumPy, structural MRI / diffusion, 3 references
- [10] doi:10.1371/journal.pcbi.1013463 [code]
- A multi-frequency whole-brain neural mass model with homeostatic feedback inhibition.Journal: PLoS computational biologyIn common: Matplotlib, NumPy, 3 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 1 script, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:97632676683035ed…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
