% Main program for the lower part of Figure 13.

% Read the image 'smoothD-148.tif' here supposed to be located in 
% the current directory
 Z=double(imread('smoothD-148.tif'))./256;
 figure(1)
 imshow(Z)

% Reverse the order of the rows in Z
 RZ=Rmirror(Z);

% Now view the image from the upper part of Figure 13 as a surface
% from a view far below, and with illumination from far low left
 figure(4)
 [X,Y]=meshgrid(1:1:656,1:1:581);
 [Nx,Ny,Nz]=surfnorm(RZ);
 s=[-30000 -30000 50000];
 colormap(gray);
 axis([0 656  0 581 0 5]);
 cla
 hold on
 view([0 -30000 50000])
 surfl(X,Y,RZ,s); shading interp;
 axis off;
 hold off
 print 'surface.ps' -deps
% This is the image used in the lower part of Figure 13.

