%create the JAVA object
omero = omeroconnect.Main;

%connect to the server as user X
omero.initConnectionDetails('cmpdartsvr1.cmp.uea.ac.uk', 'avondoj', 'avondo');

%get the whole database belonging to this user
omerodatabase = omero.getDatabase();

%print it to screen
omero.printDatabase(omerodatabase);

%get the Image at id 1
img = omero.getImage(1);

%display our image scale (microns per pixel)
xscale = omero.getPhysicalX(img);
yscale = omero.getPhysicalY(img);
zscale = omero.getPhysicalZ(img);

xscale, yscale, zscale

%now iterate over all the planes
%and draw.
figure(1);
for z=1:omero.getZ(img),
    for t=1:omero.getT(img),
        for c=1:omero.getC(img),
            plane = double(omero.getPlane(img, z-1, c-1, t-1));
            plane = reshape(plane, omero.getX(img), omero.getY(img));   
            figure(1);
            imagesc(plane);
            drawnow;
        end
    end
end

%now close the connection
omero.closeConnection();