%create the JAVA object
omero = omeroconnect.Main;

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

%now we search for all the images tagged with Arabidopsis
images = omero.getObjectsByTag('Image', 'Arabidopsis');

%now print to screen the imageID of the images we have found
iterator = images.iterator();
while(iterator.hasNext())
    img = iterator.next();
    imageID = img.getId().getValue()
end

%now we search for all the Images tagged with Arabidopsis and Leaf
tags = {'Arabidopsis' 'Leaf'};
images = omero.getObjectsByTags('Image', tags);

%now print to screen the imageID of the images we have found
iterator = images.iterator();
while(iterator.hasNext())
    img = iterator.next();
    imageID = img.getId().getValue()
end

%now close the connection
omero.closeConnection();