function S2Map = C1Im_caS2Centroid_2_S2Map_EucDist(c1im, caS2centroid);
%function S2Map = C1Im_caS2Centroid_2_S2Map_SumNormXCorr(c1im, caS2centroid);
%
%calculate the S2 layer given a c1 image and a cell array of s2 centroids.
S2Map = zeros(size(c1im,1), size(c1im,2), length(caS2centroid));
tic
for i = 1:length(caS2centroid);
    fprintf('%d of %d.  %d seconds elapsed\r',i,length(caS2centroid),round(toc));
    S2Map(:,:,i) = WindowedPatchDistance(c1im, caS2centroid{i});
end
 
