function intmask = illogical(logicalmask, value)
%
% illogical(logicalmask, value)
%
% take a logical mask and return an intger mask with
% 0 (where it was False)
% value (where it was True)


if nargin == 1
   value = 1;
elseif nargin ~= 2
   help(mfilename)
   error('must input a mask\n')
end


if isempty(logicalmask)
   intmask = [];
   return
end


intmask = zeros(size(logicalmask));
intmask(find(logicalmask)) = value;



  