%
%

ref_nearest = imrotate(ref, the_angle, 'nearest','crop');
ref_bilinear = imrotate(ref, the_angle, 'bilinear','crop');
ref_bicubic = imrotate(ref, the_angle, 'bicubic','crop');

% we really need a "max" and "min" that operate over all dimenions of an arbitrary number of arguments...

the_min = min( min(min(min(ref)), min(min(ref_nearest))), min(min(min(ref_bilinear)), min(min(ref_bicubic))));
the_max = max( max(max(max(ref)), max(max(ref_nearest))), max(max(max(ref_bilinear)), max(max(ref_bicubic))));

subplot(1,4,1);
imagesc(ref);
title('reference');
caxis([the_min the_max]);

subplot(1,4,2);
imagesc(ref_nearest);
title('rotated using ''nearest''');
caxis([the_min the_max]);

subplot(1,4,3);
imagesc(ref_bilinear);
title('rotated using ''bilinear''');
caxis([the_min the_max]);

subplot(1,4,4);
imagesc(ref_bicubic);
title('rotated using ''bicubic'' ');
caxis([the_min the_max]);

