Skip to content

Instantly share code, notes, and snippets.

View caglorithm's full-sized avatar

Caglar Cakan caglorithm

View GitHub Profile

neurolib tutorial

A tutorial for neurolib will be held at the CNS*2022 satellite tutorials.

This tutorial is intended researchers interested in learning how to use neurolib for simulating, exploring, and optimizing neural mass models and whole-brain networks.

Registration

Registration for the satellite tutorials is free, but required. Register here 👈.

import numpy as np
aal2 = {
1: "Precentral_L",
2: "Precentral_R",
3: "Frontal_Sup_2_L",
4: "Frontal_Sup_2_R",
5: "Frontal_Mid_2_L",
6: "Frontal_Mid_2_R",
7: "Frontal_Inf_Oper_L",
@caglorithm
caglorithm / afd-data.py
Last active April 22, 2020 11:32
Watch the AfD go down
import pandas as pd
import matplotlib.pyplot as plt
import datetime
import matplotlib.dates as mdates
table_urls = ["https://www.wahlrecht.de/umfragen/allensbach.htm",
"https://www.wahlrecht.de/umfragen/emnid.htm",
"https://www.wahlrecht.de/umfragen/forsa.htm",
"https://www.wahlrecht.de/umfragen/politbarometer.htm",
"https://www.wahlrecht.de/umfragen/gms.htm",
@caglorithm
caglorithm / neurolib_brain_matrix_lrlr_to_llrr_reorder.py
Created April 18, 2020 23:11
neurolib - convert brain matrix from LRLR to LLRR ordering
import numpy as np
plt.rcParams['image.cmap'] = 'plasma'
import matplotlib.pyplot as plt
from neurolib.utils.loadData import Dataset
ds = Dataset("hcp")
mat_orig = ds.Cmats[0]
N = mat_orig.shape[0]
@caglorithm
caglorithm / neurolib_parameter_exploration.py
Last active April 18, 2020 00:40
Example brain network parameter exploration: tune global coupling strength
from neurolib.models.aln import ALNModel
from neurolib.utils.loadData import Dataset
from neurolib.optimize.exploration import BoxSearch
from neurolib.utils.parameterSpace import ParameterSpace
# load brain scan dataset
ds = Dataset("hcp")
# initialize brain network model
model = ALNModel(Cmat = ds.Cmat, Dmat = ds.Dmat)
# 5 minute simulation