function allfiltered = getGaborMapsMethod2(imagePaths,templateSize,allfilter)
% getGaborMapsMethod2 Compute S1 maps from images whose paths are specified in <imagePaths>.
%

nimage = length(imagePaths); % number of example images
I = cell(1,nimage);
for i = 1 : nimage
    tmpIm = imread(imagePaths{i});
    if size(tmpIm,3) == 3
        tmpIm = rgb2gray(tmpIm);
    end
    tmpIm = double(tmpIm);
    I{i} = imresize(tmpIm,templateSize,'nearest'); % images are all resized to templateSize
end

allfiltered = applyfilterfftsameLocalNormMethod2(I, allfilter); % Gabor filtering

