We're Hiring!

[MATLAB] Import image to matlab

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

[MATLAB] Import image to matlab

Postby moritz.buck » Tue Oct 30, 2012 8:57 am

A long thread on uploading to omero from matlab is there, but I have not seen the other story.

Basically, I just wanted to know if there is a simple function already implemented which basically takes an image ID and spits out a directly useable image matrix?

Thanks anyhow,
Moritz Buck, Ph.D.
===============

Cell Control and Communication Group
Center for Systems Biology
FRIAS LifeNet
University of Freiburg
moritz.buck
 
Posts: 2
Joined: Tue Oct 30, 2012 8:36 am

Re: [MATLAB] Import image to matlab

Postby sbesson » Tue Oct 30, 2012 9:29 am

Hi Moritz,

there is no single function which does exactly what you want. However, such a function can be easily written using OMERO.matlab.

Below is a script example which connects to a server, load the image imageId and reads its first plane as a matrix.

Code: Select all
% Connect to the server
loadOmero
client = omero.client(server, port);
session = client.createSession(user, password);

% Get the image specified by imageId (integer or double)
ids = java.util.ArrayList();
ids.add(java.lang.Long(imageId));
proxy = session.getContainerService();
list = proxy.getImages('omero.model.Image', ids, omero.sys.ParametersI());
image = list.get(0);

% Get the pixels
pixelsList = image.copyPixels();
pixels = pixelsList.get(0);
pixelsId = pixels.getId().getValue();

% Initialize the rawPixelsStore and get the first plane
store = session.createRawPixelsStore();
store.setPixelsId(pixelsId, false);
plane = store.getPlane(0, 0, 0);
plane = toMatrix(plane, pixels);


More information is available on https://www.openmicroscopy.org/site/support/omero4/developers/Matlab.html.

Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: [MATLAB] Import image to matlab

Postby moritz.buck » Tue Oct 30, 2012 9:32 am

Ok, it is so then,

thank you,
Moritz Buck, Ph.D.
===============

Cell Control and Communication Group
Center for Systems Biology
FRIAS LifeNet
University of Freiburg
moritz.buck
 
Posts: 2
Joined: Tue Oct 30, 2012 8:36 am


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest