function vis(Vector,index,dim)
% function vis(Vector,index); - visualises the specified element from
% VECTOR - images in vector format
% INDEX  - the index of the image to be displayed
% IMSIZES - default is squared, overwritten if parameter present
  
% the dimension of the image is computed
if nargin==2
    dim(1) = floor(sqrt(size(Vector,1)));
    dim(2) = dim(1);
end;
colormap gray;
imagesc(reshape(Vector(:,index),dim(1),dim(2)));
axis tight; shading interp;
set(gca,'Xtick',[]); set(gca,'Ytick',[]);