Cortical Basal Ganglia Network Model during Closed-loop DBS (Fleming et al 2020)

 Download zip file   Auto-launch 
Help downloading and running models
Accession:262046
We developed a computational model of the cortical basal ganglia network to investigate closed-loop control of deep brain stimulation (DBS) for Parkinson’s disease (PD). The cortical basal ganglia network model incorporates the (i) the extracellular DBS electric field, (ii) antidromic and orthodromic activation of STN afferent fibers, (iii) the LFP detected at non-stimulating contacts on the DBS electrode and (iv) temporal variation of network beta-band activity within the thalamo-cortico-basal ganglia loop. The model facilitates investigation of clinically-viable closed-loop DBS control approaches, modulating either DBS amplitude or frequency, using an LFP derived measure of network beta-activity.
Reference:
1 . Fleming JE, Dunn E, Lowery MM (2020) Simulation of Closed-Loop Deep Brain Stimulation Control Schemes for Suppression of Pathological Beta Oscillations in Parkinson’s Disease Frontiers in Neuroscience 14:166
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network; Extracellular; Axon;
Brain Region(s)/Organism: Basal ganglia; Neocortex;
Cell Type(s): Hodgkin-Huxley neuron;
Channel(s): I K; I Sodium; I Calcium; I_AHP; I L high threshold; I T low threshold;
Gap Junctions:
Receptor(s): GabaA; AMPA;
Gene(s):
Transmitter(s): Gaba; Glutamate;
Simulation Environment: NEURON; Python; PyNN;
Model Concept(s): Deep brain stimulation; Parkinson's; Beta oscillations; Activity Patterns; Extracellular Fields;
Implementer(s): John E. Fleming, John E [john.fleming at ucdconnect.ie];
Search NeuronDB for information about:  GabaA; AMPA; I L high threshold; I T low threshold; I K; I Sodium; I Calcium; I_AHP; Gaba; Glutamate;
/
Cortex_BasalGanglia_DBS_model
Updated_PyNN_Files
readme.html
Cortical_Axon_I_Kd.mod
Cortical_Axon_I_Kv.mod
Cortical_Axon_I_Leak.mod
Cortical_Axon_I_Na.mod
Cortical_Soma_I_K.mod
Cortical_Soma_I_Leak.mod
Cortical_Soma_I_M.mod
Cortical_Soma_I_Na.mod
Destexhe_Static_AMPA_Synapse.mod
Destexhe_Static_GABAA_Synapse.mod
Interneuron_I_K.mod
Interneuron_I_Leak.mod
Interneuron_I_Na.mod
myions.mod *
pGPeA.mod
pSTN.mod *
SynNoise.mod
Thalamic_I_leak.mod
Thalamic_I_Na_K.mod
Thalamic_I_T.mod
xtra.mod
burst_level_1.txt *
burst_level_10.txt
burst_level_2.txt *
burst_level_3.txt *
burst_level_4.txt
burst_level_5.txt
burst_level_6.txt *
burst_level_7.txt *
burst_level_8.txt *
burst_level_9.txt
burst_times_1.txt
burst_times_10.txt
burst_times_2.txt
burst_times_3.txt
burst_times_4.txt
burst_times_5.txt
burst_times_6.txt
burst_times_7.txt
burst_times_8.txt
burst_times_9.txt
Controllers.py
Cortical_Basal_Ganglia_Cell_Classes.py
cortical_collateral_electrode_distances.txt
cortical_xy_pos.txt
CorticalAxonInterneuron_Connections.txt
CorticalSomaThalamic_Connections.txt
CorticalSTN_Connections.txt
Electrode_Distances.py
Global_Variables.py
GPe_Stimulation_Order.txt
GPeGPe_Connections.txt
GPeGPi_Connections.txt *
GPeSTN_Connections.txt
GPiThalamic_Connections.txt
InterneuronCortical_Connections.txt
run_CBG_Model_Amplitude_Modulation_Controller.py
run_CBG_Model_Frequency_Modulation_Controller.py
run_CBG_Model_to_SS.py
STN_xy_pos.txt
STNGPe_Connections.txt
STNGPi_Connections.txt *
Striatal_Spike_Times.npy
StriatalGPe_Connections.txt
ThalamicCorticalSoma_Connections.txt
                            
# -*- coding: utf-8 -*-
"""
Created on Wed April 03 14:27:26 2019

Description: Functions for calculating cell distances to electrode. Distance is 
			 calculated similar to space.distance, but distance is now between 
			 a cell position and a point for an electrode rather than between two cell positions

Edits:
	10-01-18: Created electrode_distance function

@author: John Fleming, john.fleming@ucdconnect.ie

"""

# There must be some Python package out there that provides most of this stuff.
# Distance computations are provided by scipy.spatial, but scipy is a fairly heavy dependency.

try:
	reduce
except NameError:
	from functools import reduce
import numpy
import math
from operator import and_
from pyNN.random import NumpyRNG
from pyNN import descriptions
import logging

logger = logging.getLogger("PyNN")

def distance_to_electrode(src_electrode, tgt_cell, mask=None):
	"""
	Return the Euclidian distance from a point source electrode to a cell.
	`mask` allows only certain dimensions to be considered, e.g.::
		* to ignore the z-dimension, use `mask=array([0,1])`
		* to ignore y, `mask=array([0,2])`
		* to just consider z-distance, `mask=array([2])`
	'src_electrode' is the electrode positon in xyz co-ordinates.
	'tgt_cell' is the cell that the distance will be calculated to.
	"""
	d = src_electrode - tgt_cell.position

	if mask is not None:
		d = d[mask]
	return numpy.sqrt(numpy.dot(d, d))
	
def distances_to_electrode(src_electrode, tgt_pop, coordinate_mask=None):
	"""
	Return an array of the Euclidian distances from a point source 
	electrode to a population of cells.
	`coordinate_mask` allows only certain dimensions to be considered, e.g.::
		* to ignore the z-dimension, use `coordinate_mask=array([0,1])`
		* to ignore y, `coordinate_mask=array([0,2])`
		* to just consider z-distance, `coordinate_mask=array([2])`
	'src_electrode' is the electrode positon in xyz co-ordinates.
	'tgt_pop' is the population of cells that the distance will be calculated to.
	"""
	row_size,col_size = tgt_pop.positions.shape
	cell_electrode_distances = numpy.zeros((col_size,1))
	cell_electrode_distances.flatten()
	
	for cell_id, tgt_cell in enumerate(tgt_pop):
		cell_electrode_distances[cell_id] = distance_to_electrode(src_electrode,tgt_cell,mask=coordinate_mask)
	
	return cell_electrode_distances
	#return cell_electrode_distances.flatten()
	
def collateral_distances_to_electrode(src_electrode, tgt_pop, L, nseg):
	"""
	Return an nd-array of the Euclidian distances from a point source 
	electrode to a population of cells. Each row corresponds to a collateral
	from the cortical population. Each column corresponds to the segments of the 
	collateral, with 0 being the furthest segment from the 2d plane the cells are
	distributed in  and 1 being in the plane.
	'src_electrode' is the electrode positon in xyz co-ordinates.
	'tgt_pop' is the population of cells that the distance will be calculated to.
	'L' is the length of the cortical collateral
	'nseg' is the number of segments in a collateral 
	'segment_electrode_distances' is the distance from the centre of each collateral 
	segment to the stimulating electrode. Each row corresponds to a collateral of a single 
	cortical cell. Each column corresponds to a segment of the collateral.
	"""
	row_size,col_size = tgt_pop.positions.shape
	segment_electrode_distances = numpy.zeros((col_size,nseg))
	
	segment_centres = numpy.arange(0, nseg+3-1)*(1/nseg)
	segment_centres = segment_centres - (1/(2*nseg))
	segment_centres[0] = 0
	segment_centres[-1] = 1
	segment_centres = segment_centres[1:len(segment_centres)-1]
	
	z_coordinate = L*segment_centres - L/2
	#print(z_coordinate)
	
	for cell_id, tgt_cell in enumerate(tgt_pop):
		for seg in numpy.arange(nseg):
			tgt_cell.position = numpy.array([tgt_cell.position[0], tgt_cell.position[1], z_coordinate[seg]])
			segment_electrode_distances[cell_id][seg] = distance_to_electrode(src_electrode,tgt_cell)
		
	return segment_electrode_distances