function c2 = C2_Easy(Images,options);
%function c2 = C2_Easy(Images,options);
%
%images must be either a cell array of images, 
%or a matrix where each layer is an image, or a
%or a matrix where each column is an image, wherin the original size parameter of options must be set

d.OriginalSize = [128 128];
options = ResolveMissingOptions(options,d);


rot = [90 -45 0 45];
c1ScaleSS = [1:2:18];
RF_siz    = [7:2:39];
c1SpaceSS = [8:2:22];
minFS     = 7;
maxFS     = 39;
div = [4:-.05:3.2];
Div       = div;
[fSiz,filters,c1OL,numSimpleFilters] = init_gabor(rot, RF_siz, Div);

if(iscell(Images))
  nImages = length(Images);
else
  if(size(Images,3) > 1);
    nImages = size(Images,3);
  else
    nImages = size(Images,2);
  end
end


for iImage = 1:nImages, %for every input image
  fprintf(1,'Image %d: of %d\r',iImage,nImages);
  stim = GetStim(Images,iImage,options);
  img_siz = size(stim);
  clear C2_imgI;
  for j = 1:numPatchSizes, %for every unique patch size
    C2_imgI = [C2_imgI;C2(stim,filters,fSiz,c1SpaceSS,c1ScaleSS,c1OL,cPatches{j})];
  end
  c2(:,i) = C2_imgI;
end

function stim = GetStim(Images,iImg,options)
if(iscell(Images))
  stim = Images{iImg};
else
  if(size(Images,3) > 1);
    stim = Images(:,:,iImg);
  else
    stim = reshape(Images(:,iImg),options.OriginalSize);
  end
end
