-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathretinaStencil.m
More file actions
48 lines (39 loc) · 1.95 KB
/
Copy pathretinaStencil.m
File metadata and controls
48 lines (39 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%% License Info
%A Model of Feedforward, Global, and Lateral Inhibition in the Locust Visual System.
%This model examines the architecture and function of inhibitory mechanisms in the
%visual system of locusts, namely those involved in the processing of inputs to a
%key looming-sensitive neuron, the lobula giant movement detector (LGMD).
%Copyright (c) 2026, Erik Olson, Travis Wiens, and Jack Gray
%CITATION:
%When using the model code for scientific publications, cite the following work:
%Olson EGN, Wiens TK, Gray JR. A model of feedforward, global, and lateral inhibition
%in the locust visual system predicts responses to looming stimuli. Biol Cybern. 2021
%Jun;115(3):245-265. doi: 10.1007/s00422-021-00876-8. Epub 2021 May 16. PMID: 33997912.
%This program is free software: you can redistribute it and/or modify
%it under the terms of the GNU General Public License as published by
%the Free Software Foundation, either version 3 of the License, or
%(at your option) any later version.
%This program is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%GNU General Public License for more details.
%You should have received a copy of the GNU General Public License
%along with this program. If not, see <https://www.gnu.org/licenses/>.
%Contact: erik.olson@usask.ca
%% Code
function stencil = retinaStencil(radius)
%This function generates a sparse matrix defining the retina, where ones
%define valid retinotopic unit and zeroes define areas outside the retina.
%The input is the radius of the eye in retinotopic units, including the
%center unit.
stencil = ones(2*radius-1);
%change upper right and bottom left corners to zeros, creating a hexagonal
%pattern of ones
for i = 1:2*radius-1
for j = 1:2*radius-1
if abs(i-j)>=radius
stencil(i,j) = 0;
end
end
end
end