Dear Damien,
With OMERO.matlab-4.4.4-ice33-b3099 installed and after correct initialization of the variables, the code example below should:
1. initiate the toolbox and connect to the server
2. load the image imageID using the ContainerService
3. retrieve the first plane of the image using the RawPixelsStore service
- Code: Select all
server = xxx;
username = xxx;
password = xxx;
imageID = xxx;
% Load the OMERO.matlab toolbox
loadOmero;
% Create a client and a session
client = omero.client(server);
session = client.createSession(username, password);
omeroKeepAlive(client);
% Create a list of image IDs to be retrieved
ids = java.util.ArrayList();
imageId = java.lang.Long(imageID);
ids.add(imageId);
% Load images by IDs using container service
proxy = session.getContainerService();
list = proxy.getImages('omero.model.Image', ids, omero.sys.ParametersI());
image = list.get(0);
% Create raw pixels store to read the planes
pixels = image.getPrimaryPixels();
store = session.createRawPixelsStore();
store.setPixelsId(pixels.getId().getValue(), false);
% Read the first plane and convert it into double matrix
plane = store.getPlane(0, 0, 0);
I = double(toMatrix(plane,pixels)');
Let me know if this works,
Sebastien