-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_neuron_list.m
22 lines (19 loc) · 1.51 KB
/
get_neuron_list.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function[connections, list] = get_neuron_list(connections)
% Create a list of all MSN, FSI, and D1 / D2 neuron IDs (without connections)
% Column 1 is the unique neuron ID in the striatum generated by MatLab
% Column 2 is the neuron's ID within that group required by SpineCreator
list.msn = unique(connections.msnmsn(:, 1));
list.d1 = [list.msn(1 : ceil(length(list.msn) / 2))' ; 0 : ceil(length(list.msn) / 2) - 1]';
list.d2 = [list.msn(length(list.d1) + 1 : end)' ; 0 : floor(length(list.msn) / 2) - 1]';
list.fsi = sort(unique([unique(connections.fsifsi(:, 1)) ; unique(connections.fsimsn(:, 1))]));
list.fsi(:,2) = 0:length(list.fsi) - 1;
% Separate all MSN connections into D-type lists
connections.d1.all = connections.msnmsn((connections.msnmsn(:, 1) <= max(list.d1(:, 1))), :);
connections.d1.d1 = connections.d1.all((connections.d1.all(:, 2) <= max(list.d1(:, 1))), :);
connections.d1.d2 = connections.d1.all((connections.d1.all(:, 2) > max(list.d1(:, 1))), :);
connections.d2.all = connections.msnmsn((connections.msnmsn(:, 1) > max(list.d1(:, 1))), :);
connections.d2.d1 = connections.d2.all((connections.d2.all(:, 2) <= max(list.d1(:, 1))), :);
connections.d2.d2 = connections.d2.all((connections.d2.all(:, 2) > max(list.d1(:, 1))), :);
connections.fsi.d1 = connections.fsimsn((connections.fsimsn(:, 2) <= max(list.d1(:, 1))), :);
connections.fsi.d2 = connections.fsimsn((connections.fsimsn(:, 2) > max(list.d1(:, 1))), :);
end