];
for i=1:numel(sigs)
  sig = sigs(i);
  alpha = alphas(i);
  filterwidth = 101;
  [Dx,Dy] = create_distortion_map(I,sig,alpha,filterwidth);
  I2 = distort_image(I,Dx,Dy);
  
  figure;
  imagesc(I2);colormap(cm)
  set(gca,'XTickLabel','')
  set(gca,'YTickLabel','')
  axis([0,28,0,28]);
  printPmtkFigure(sprintf('elasticDistortionDigit%d', i));
  
  figure;
  quiver(X,Y,-Dx,Dy);
  set(gca,'XTickLabel','')
  set(gca,'YTickLabel','')
  axis([0,29,0,29]);
  printPmtkFigure(sprintf('elasticD