sim_tools.
make_D
(target, source, names, values=None)[source]¶Create matrix of afferent/efferent dopamine regions in the model
Parameters: | target : Python list or NumPy 1darray
source : Python list or NumPy 1darray
names : Python list or NumPy 1darray
values : Python list or NumPy 1darray
|
---|---|
Returns: | D : NumPy 2darray
|
See also
Notes
None
Examples
For the sake of simplicity consider a brain “parcellation” consisting of three (bilateral) regions, called A, B, and C. Thus, we define the following names array
>>> names = ['L_A','L_B','L_C','R_A','R_B','R_C']
Assume that in the left hemisphere dopamine is mainly concentrated in region B, its release is steered by neural firing in region A. In the right hemisphere, dopamine release in region C is depending on neural activity in area B. Then the target and source arrays are given by
>>> target = ['L_B','R_C']
>>> source = ['L_A','R_B']
Then the call
>>> D = make_D(target,source,names)
>>> D
array([[ 0., 0., 0., 0., 0., 0.],
[ 1., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 1., 0.]])
generates a 6-by-6 NumPy array D, that has non-zero entries in rows 2 and 6 (because ‘L_B’ is the second, and ‘R_C’ the sixth element of the list names), and columns 1 and 5 (because ‘L_A’ is the first, and ‘R_B’ the 5th element of the list names). Thus, the row/column index of each non-zero entry in D has the format target-by-source.