function showPyramid(pyramid)
% show an image pyramid into a single screenshot

[rows, cols, levels] = size(pyramid);
image = ones([cols+2 2*rows+levels]);

offs = 2;
for level = 0:levels-1
   levim = getLevel(pyramid,level);
   levim = (levim - min(min(levim))) / (max(max(levim)) - min(min(levim)));
   image(2:(2+cols/2^level-1),offs:(offs+rows/2^level-1)) = levim;
   offs = offs + cols/2^level + 1;
end

imshow(image);
colormap(hot);
