function display(image)
% function display(image)
%
% Display image at the X terminal.
% This program generates temporary files named _image_display_.*

% Avoids flipping/rotation by saving
image=flipud(rot90(image));

% Saves the image
fid=fopen('_image_display_.raw','w');
fwrite(fid,image,'float');
fclose(fid);

% Create a shell script file for displaying the saved image
fid=fopen('_image_display_.sh','w');
fprintf(fid,'raw2hips -float -s %d %d < _image_display_.raw | xhips2 &\n', ...
		size(image,2), size(image,1));
fclose(fid);

% Execute the shell script and clean up
!sh _image_display_.sh
!rm _image_display_.* 
