%%
% Matlab code in this directory computes the results published in:
%    Heeger DJ, Zemlianova KO, Dynamic Normalization, Proceedings of the
%    National Academy of Sciences, under review.
%
% See also:
%    Heeger DJ, Mackey WE, Oscillatory Recurrent Gated Neural Integrator
%    Circuits (ORGaNICs): A Unifying Theoretical Framework for Neural
%    Dynamics, Proceedings of the National Academy of Sciences, 2019.
%
%    Heeger DJ, Mackey WE, ORGaNICs: A Canonical Neural Circuit Computation,
%    bioRxiv 506337; doi: https://doi.org/10.1101/506337, 2018.
% 
%    Heeger DJ, Mackey WE, ORGaNICs: A Theory of Working Memory in Brains
%    and Machines, arXiv:1803.06288, 2018.

%
% The Matlab code in this directory was developed and written by David
% Heeger (david.heeger@nyu.edu).
% 
% Copyright (c) 2017-2020, David J. Heeger, New York University

%%
% To run the code, you must edit the first two lines of 'makeAllFigures.m'
% so that this directory and its subdirectories get added your matlab path.
% It should look using something like the following:

chdir '~/ORGaNIC Normalization Matlab Code 3-22-2020'
addpath(genpath('Toolbox'));

%% Flow of computation

% To recompute all of the figures in the published paper and in the SI
% Appendix, simply run the 'makeAllFigures.m' script.

% If you edit that script, you will see that it calls in sequence scripts
% that compute the results for each of the figures and supplementary
% figures:
%
xorientationScript;
makeFigS1
makeFig3
makeFig4
makeFig5
makeFig6
makeFig7

% The code implements a family of recurrent circuit models of V1
% normalization.
%
% organicNormalizationScript: Script that calls organicNormalization.m to
% run simulations of one of the reduced models.
%
% organicNormalization.m: Calls one of the reduced models, depending on the
% value of the 'variant' parameter.
%
% organicNormalization1.m: Reduced model given by Eq. S35.
%
% organicNormalization2.m: Reduced model given by Eq. S36.
%
% organicNormalization3.m: Reduced model given by Eq. S37.
%
% organicNormalization4.m: Reduced model given by Eq. S27.
%
% organicNormalization5.m: Reduced model given by Eq. S38.
%
% organicNormalizationOriScript: Script that calls
% organicNormalizationOri.m.
%
% organicNormalizationOri.m: Implementation for a collection of neurons
% with 12 orientation tuning curves at one spatial location, used for Figs.
% 3 & 4.
%
% organicNormalizationOriX3.m: Implementation of Eqs. 1-3 for a collection
% of neurons with the same 12 orientation tuning curves, covering the
% horizontal meridian of the visual field from -60° to 60° eccentricity,
% used for Figs. 5 & 6.
%
% organicNormalizationOriXsteadyState3: Computes the fixed point for Eqs.
% 1-3.
%
% organicNormalizationOriX4.m: Implementation of Eq. S26 for a collection
% of neurons with the same 12 orientation tuning curves, covering the
% horizontal meridian of the visual field from -60° to 60° eccentricity.
%
% organicNormalizationOriXsteadyState3: Computes the fixed point for Eq.
% S26.
%
% organicNormalizationFullScript: Script that calls
% organicNormalizationFull.m.
%
% organicNormalizationFull.m: Implementation for a full population of
% neurons with RFs covering a small portion of the 2D visual field, with
% multiple orientation and spatial frequency bands. 
