


thisx = zeros(1, nbasis); thisy = zeros(1, nbasis); 
thatx = zeros(1, nbasis); thaty = zeros(1, nbasis); 
for (di = 1 : nbasis)
   thisx(1, di) = xMax + FxAll(di); 
   thisy(1, di) = yMax + FyAll(di); 
   CBackMax2(di, S2mapAll{di}, sub1, sx1, sy1, xRange, yRange, thisx(di), thisy(di), thatx, thaty);
end

symb = zeros(sx1, sy1); 
for (di = 1 : nbasis)
    TotalsketchA = TotalsketchAll(di); 
    MiA = MiAll(di, 1:TotalsketchA)+0.; 
    MxA = MxAll(di, 1:TotalsketchA)+0.; MyA = MyAll(di, 1:TotalsketchA)+0.; 
    CBackMax1(1, norient, S1map, MiA, MxA, MyA, allsymbol(1, :), symb, Lrange1, Orange, sub1, h, TotalsketchA, sx1, sy1, thatx(di), thaty(di));
end


if (showon<.5)
  towrite = J{1} + symb*100;
  outepsgif(towrite, ['ex7_' num2str(isplit)]);  % overlaid sketch 
  towrite = uint8(255 * (towrite-min(towrite(:)))/(max(towrite(:))-min(towrite(:))));
  imwrite(towrite,['togif' '\tbike' num2str(isplit) '.jpg'],'jpeg'); 
end

