function T=shroud(Tx,N)
%
%% 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
%%
if size(Tx)==[0,0]
T=[];
else
T3=modD(Tx,N);
T4=(Tx-T3)/N+1;
n=size(T3,2);
T1=[];
T2=[];
for j=1:n
H1=T3(j)-1:T3(j)+1;
H2=T4(j)-1:T4(j)+1;
for k1=1:3
for k2=1:3
if (k1~=2)|(k2~=2)
if (H1(k1)>0)&(H1(k1)<=N)&(H2(k2)>0)&(H2(k2)<=N)
T1=[T1 H1(k1)];
T2=[T2 H2(k2)];
end
end
end
end
end
T=N*(T2-1)+T1;
T=unique(T);
end
return