function G=anisot(g,theta,sig1,sig2)
%
% anisot :: Function to generate a spatial oriented, anisotropic kernel
%
%% Input variables
% g :: Kernel gain
%
% theta :: Orientation of the major axis (in radians)
%
% sig1 :: Standard deviation along major axis
%
% sig2 :: Standard deviation along minor axis
%
%% Output variable
% G :: Kernel matrix
%
%% 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
%%
theta=pi/2+theta;
N=2*ceil(3*sig1)+1;
N1=(N-1)/2 + 1;
for i=1:N
for j=1:N
G(i,j)=exp(-0.5*[(((i-N1)*cos(theta)+(j-N1)*sin(theta))/sig1)^2+((-(i-N1)*sin(theta)+(j-N1)*cos(theta))/sig2)^2]);
end
end
G(:,:)=g*G(:,:)./sum(sum(G(:,:)));
return