%  Show a film of the CT reconstruction
%
%  Calling: dummy = ct_reconstruction_film_demo (ct_demo_image, frame_no, dx);
%
%  Input: ct_demo_image  - Data for the resulting CT reconstruction movie.
%         frame_no       - Frame number in the reconstruction
%         dx             -  Spatial sampling interval
%
%  Output: None
%
%  Version 1.0, 27/10-2014, Joergen Arendt Jensen
%      Initial version

function dummy = show_movie(ct_demo_image, frame_no, dx, times, duration)

%  Make axis for the image display

Nimage=size(ct_demo_image,1);
x_axis=((1:Nimage)-Nimage/2)*dx;
y_axis=x_axis;

%  Calculate the delay between frames

delay=duration/length(frame_no);

%  Make the display

for j=1:times
    for i=1:length(frame_no)
        
        imagesc(x_axis*1000, y_axis*1000, ct_demo_image(:,:,i))
        xlabel('X [mm]')
        ylabel('Y [mm]')
        title(['Projection number ',num2str(frame_no(i))])
        axis('square')
        colormap(gray)
        drawnow
        pause(delay)
    end
end

dummy=0;
