function runTask(task,A9,g_f,g_h,lambda,sigLIP,Tdec,g_delay)
% runTask :: Main function for choosing the task whose (behavioral and physiological) data will be simulated and supplying key model
% lateral intraparietal area parameters
%
%% Default uses
% runTask(1,1,2,5,5,5,55,9) to replicate model simulations of the reaction time task
% runTask(2,4.5,2,5,5,55,9) to replicate model simulations of the fixed duration task (2002)
% runTask(3,5,2,7.5,3,55,5.5) to replicate model simulations of the fixed duration task (2001)
%
%% Input variables
% task (1 for reaction time task (Roitman & Shadlen, 2002), 2 for fixed
% duration task (Roitman & Shadlen, 2002), 3 for fixed duration task
% (Shadlen & Newsome, 2001)
%
% A9 :: Parameter that scales passive decay in lateral intraparietal
% neuronal responses
%
% g_f :: Parameter that scales the gain of self-excitation in lateral
% intraparietal recurrent competitive field
%
% g_h :: Parameter that scales the gain of recurrent inhition in lateral
% intraparietal recurrent competitive field
%
% lambda :: Parameter that scales the bottom-up excitation to a lateral
% intraparietal cellfrom the media superior temporal pool tuned to the
% preferred direction
%
% sigLIP :: Standard deviation of the Brownian motion process that injects
% noise into the dynamics of lateral intraparietal area neurons
%
% Tdec :: Threshold lateral intraparietal activity for making decision in
% the reaction time task
%
% g_delay :: Parameter that scales the gain of self-excitation during the
% variable delay period in the fixed duration task for the lateral
% intraparietal cell that corresponds to the judged direction
%
%% Reference
% Grossberg, S. and Pilly, P. K. (2008). Temporal dyanamics of decision-making during motion perception in the visual cortex. Vision Research, 48(12), 1345-1373.
%
%% Author
% Praveen K. Pilly (advaitp@gmail.com)
%
%% License policy
% Written by Praveen K. Pilly, Department of Cognitive and Neural Systems, Boston University
% Copyright 2009, Trustees of Boston University
%
% Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted
% without fee, provided that the above copyright notice and this permission notice appear in all copies, derivative works and
% associated documentation, and that neither the name of Boston University nor that of the author(s) be used in advertising or
% publicity pertaining to the distribution or sale of the software without specific, prior written permission. Neither Boston
% University nor its agents make any representations about the suitability of this software for any purpose. It is provided "as
% is" without warranty of any kind, either express or implied. Neither Boston University nor the author indemnify any
% infringement of copyright, patent, trademark, or trade secret resulting from the use, modification, distribution or sale of
% this software.
%
%% Last modified
% June 25, 2009
%% Neurophysiological experiment :: stimulus parameters
%
% For simplicity, the signal dots in the motion stimulus always moved in
% the rightward direction
%
% Coherence levels that were tested
coherences=[0 3.2 6.4 12.8 25.6 51.2]; % between 0 and 100%
%
% Number of trials per coherence level
numtrials=500;
%% Important parameters for motion processing in the MODE model
%
sigMT=0; % Standard deviation of the Brownian motion process that injects noise into the dynamics of middle temporal area neurons
%
sigMST=0; % Standard deviation of the Brownian motion process that injects noise into the dynamics of medial superior temporal area neurons
%
K3=20; % Parameter that scales inhibition in the directional inhibitory interneuron layer
%
K4=20; % Parameter that scales inhibition in the directional transient cell layer
%
InhWeights_MTMST=[0 1 1 1 2]; % Parameters that scale the inter-directional competition in the motion capture circuit of middle temporal and medial superior temporal areas
% [w0 w1 w2 w3 w4], where wj modulates the amount of competition between
% global motion cells whose preferred directions differ by j*pi/4
% NOTE: MODE model is sensitive only to eight equally-spaced directions
%%
% Other parameters
%
% Duration for which recordings need to be made in model middle temporal and
% medial superior temporal areas
period=2.5; % (in sec) [This is an estimatate of the reaction time upper limit in the reaction time task]
%% NOTE
% Each trial of length '2.5 s' takes about 3043 s to run on a 2.33 GHz 8 GB RAM
% desktop (Intel Xeon CPU) in MATLAB R2008a on Windows XP Pro
%
% To reduce the run time, you may want to consider using fourth-order
% Runge-Kutta method (allowing for a bigger time-step with stability) or adaptive
% numerical integration methods instead of Euler method, which is being currently used
%%
%%
% MODE model lateral intraparietal decision circuit makes directional decisions based on
% global motion signals from model medial superior temporal area
%
% For the sake of efficiency, model middle temporal and medial superior temporal
% responses for 2.5 sec from motion stimulus onset in each trial
% are first computed and stored, before the medial superior temporal signals
% are fed into the lateral intraparietal module for each task
% (Reaction time task, Fixed duration task [2002], Fixed duration task [2001])
%%
% cohL=length(coherences);
% for trial=1:numtrials
% trial % to track the progress of the simulation
% for coh=1:cohL
% coh % to track the progress of the simulation
%
% % Each trial begings with the generation of a new random dot motion
% % stimulus
% [Stim]=rdm_stimulus(coherences(coh)/100);
%
% tic
%
% % The motion stimulus is processed by interactions within and
% % between various areas involved in motion processing from Retina
% % till medial superior temporal area
% [MT,MST]=MODE_motion(255*Stim,period,sigMT,sigMST,K3,K4,InhWeights_MTMST);
%
% toc % to have a time estimate for the simulation of each trial
%
% Motion(:,:,coh,trial,1)=MT;
% Motion(:,:,coh,trial,2)=MST;
% end
% end
warning('off','all')
hwait = waitbar(0,'Run in progress . . . ', ...
'Units', 'Characters', 'Position', [200 10 60 4.75]);
drawnow;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
% For a relatively quicker running of the model to compute the main results, we are loading
% pre-computed global motion signals from model medial superior temporal area (numtrials = 100)
% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
load('Motion0405.mat')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This shows how model middle temporal and medial superior temporal responses
% depend on signal direction and coherence
waitbar(0.1, hwait, 'Run in progress . . .');
analyzeMTMST(Motion,coherences);
% Common lateral intraparietal area parameters across the 3 tasks
n_f=5;
n_h=10;
if task==1
% Reaction time task -- Physiological (lateral intraparietal area) and behavioral simulations
B9=80;
pre_y=35;
muu=50;
g_BG=10;
TD=1;
Tsacc=B9-10;
runRTtask(Motion,coherences,period,A9,B9,g_f,g_h,lambda,sigLIP,pre_y, ...
muu,n_f,n_h,Tdec,Tsacc,g_BG,TD,hwait);
elseif task==2
% 2002 Fixed duration task -- Physiological (lateral intraparietal area) and behavioral simulations
B9=80;
pre_y=35;
muu=50;
g_BG=35;
Tsacc=B9-10;
run2002FDtask(Motion,coherences,period,A9,B9,g_f,g_h,lambda,sigLIP,pre_y,muu,n_f,n_h,Tsacc,g_BG,g_delay,hwait);
elseif task==3
% 2001 Fixed duration task -- Physiological (lateral intraparietal area) and behavioral simulations
B9=60;
pre_y=15;
muu=25;
g_BG=25;
Tsacc=B9-10;
run2001FDtask(Motion,coherences,period,A9,B9,g_f,g_h,lambda,sigLIP,pre_y, ...
muu,n_f,n_h,Tsacc,g_BG,g_delay,hwait);
end
close(hwait)
return