Commit 68e8e336 authored by Jan Fousek's avatar Jan Fousek
Browse files

presented version of the notebooks

parent f90f4f1b
%% Cell type:code id:68ccd22b tags:
%% Cell type:code id:7b069db6 tags:
 
``` python
%load_ext autoreload
%autoreload 2
```
 
%% Cell type:markdown id:e5a89d1a tags:
%% Cell type:markdown id:26493873 tags:
 
# First steps using TVB
 
**Summer School in Nonlinear Dynamics for the Life Sciences with Applications to Neuroscience and Psychology May 31-June 11, 2021**
**EITN Workshop on Computational Neuroscience in EBRAINS, June 10, 2021**
 
%% Cell type:markdown id:c669ec16 tags:
%% Cell type:markdown id:7600f537 tags:
 
# Brain network modeling with TVB
 
***
 
Components to be covered
* node dynamics
* connectivity
* coupling functions
* monitors
* integrator
* stimulus
 
%% Cell type:markdown id:727cf9bf tags:
%% Cell type:markdown id:9611478f tags:
 
# Objectives
 
Here we:
 
* Build a brain network model using subject-specific structural connectivity,
* Simulate resting-state activity,
* Characterize the resting-state activity by calculating the functional connectivity (FC).
 
%% Cell type:markdown id:48605a2c tags:
%% Cell type:markdown id:68d1fa73 tags:
 
# How to do it with TVB?
 
***
 
In the first part of this tutorial, we presents the basic anatomy of a region simulation using The Virtual Brain's scripting interface.
 
The first thing we want to do is to import the modules we will need for a simulation.
 
%% Cell type:code id:48088d0e tags:
%% Cell type:code id:944fa90e tags:
 
``` python
%%capture
import os
import time as tm
 
import numpy as np
import matplotlib.pyplot as plt
 
from tvb.simulator.lab import *
from utils import plot_connectivity
from phase_plane import phase_plane_interactive
```
 
%% Cell type:markdown id:1a410d7a tags:
%% Cell type:markdown id:844294a1 tags:
 
A basic simulation of TVB consists of **5 main components**. Each of these components is an object within TVB:
 
%% Cell type:markdown id:ae302f73 tags:
%% Cell type:markdown id:73e7c33e tags:
 
### Connectivity
 
 
We start by loading and visualizing the structural connectivity matrix that represents the set of all existing connections between brain areas. Having loaded the default dataset, we can then alter the speed of signal propagation through the network:
 
%% Cell type:code id:710d21e4 tags:
%% Cell type:code id:b64aa207 tags:
 
``` python
# Import the anatomical structural connectivity.
conn = connectivity.Connectivity().from_file(
os.path.abspath('dataset/connectivity_76.zip')
)
```
%% Cell type:code id:b023951d tags:
``` python
nregions = len(conn.region_labels) # Number of regions
conn.speed = np.array(np.inf) # Set the conduction speed
conn.configure()
```
 
%% Cell type:markdown id:de6dafab tags:
%% Cell type:markdown id:61389c0d tags:
 
*Take a look at some of the properties of the `conn` object: `weights`, `delays`, `region_labels`, etc.*
 
%% Cell type:code id:a301f70b tags:
%% Cell type:code id:06cda1ca tags:
 
``` python
conn
```
 
%% Output
 
<tvb.datatypes.connectivity.Connectivity at 0x7fb69414a6d8>
<tvb.datatypes.connectivity.Connectivity at 0x7f04661be6a0>
 
%% Cell type:code id:c82cd475 tags:
%% Cell type:code id:e3545b57 tags:
 
``` python
plot_connectivity(conn)
```
 
%% Output
 
 
%% Cell type:markdown id:e4d3660a tags:
%% Cell type:markdown id:08fa4205 tags:
 
### Model