function index=getindex(dbin,phibin,thdbin,dbins,phibins)
% Get an index into a count histogram
%
% Parameters:
%
%   dbin        Distance bin number
%   phibin      Direction bin number
%   thdbin      Orientation bin number
%   dbins       Number of distance bins
%   phibins     Number of direction bins
%
% Return:
%
%   index       A Histogram bin number
%
% Copyright (C) 2001-2009 Center for Perceptual Systems

index=(dbin-1)+(phibin-1).*dbins+(thdbin-1).*phibins.*dbins+1;
