function image_redraw ( )

%*****************************************************************************80
%
%% image_redraw ( ) ???
%
%  Discussion:
%
%    ???
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 November 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'image_redraw():\n' );
  fprintf ( 1, '  Read points sampled from the aneurysm plot.\n' );
  fprintf ( 1, '  Flip the Y data.\n' );
  fprintf ( 1, '  Rewrite the data to a file.\n' );
  fprintf ( 1, '  Plot the data.\n' );

  xy = load ( 'aneurysm_boundary.txt' );
%
%  For some reason, getpts numbers the vertical axis starting at the top!
%
  x = xy(:,1);
  y = xy(:,2);

  ymax = max ( y );
  y = ymax - y;

  n = length ( x );
  r8vec2_write ( 'aneurysm_boundary.txt', n, x, y );
%
%  Plot the data.
%
  plot ( x, y, 'bo-' );
  grid ( 'on' );
  axis ( 'equal' );
  print ( '-dpng', 'aneurysm_boundary.png' );

  return
end
function r8vec2_write ( output_filename, n, x, y )

%*****************************************************************************80
%
%% r8vec2_write() writes an R8VEC2 file.
%
%  Discussion:
%
%    An R8VEC2 is a pair of vectors of R8's.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 July 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    string OUTPUT_FILENAME, the output filename.
%
%    integer N, the number of points.
%
%    real X(N), Y(N), the vectors.
%

%
%  Open the file.
%
  output_unit = fopen ( output_filename, 'wt' );

  if ( output_unit < 0 ) 
    fprintf ( 1, '\n' );
    fprintf ( 1, 'R8VEC2_WRITE - Error!\n' );
    fprintf ( 1, '  Could not open the output file.\n' );
    error ( 'R8VEC2_WRITE - Error!' );
  end

  for j = 1 : n
    fprintf ( output_unit, '  %24.16g  %24.16g\n', x(j), y(j) );
  end
%
%  Close the file.
%
  fclose ( output_unit );

  return
end
