Page 1 of 1

How to get the list of images in a dataset?

PostPosted: Wed Jul 18, 2018 10:11 pm
by Kouichi_C_Nakamura
How can I get the list of images or image IDs in a dataset? My best bet is to use ContainerService.

I'm executing Java commands in MATLAB, so code may look a bit strange, but I thought something like below would work.

Code: Select all
cs = session.getContainerService;
imgs = cs.getImages('dataset',ds_id,[]);


However, as usual, it appears that the input arguments are in the wrong types. Documentation is not very helpful. https://downloads.openmicroscopy.org/om ... #getImages

Re: How to get the list of images in a dataset?

PostPosted: Thu Jul 19, 2018 8:27 am
by Dominik
Hi,

here's an example:

Code: Select all
long datasetId = 123;
List<omero.model.Image> imgs = cs.getImages(omero.model.Dataset.class.getSimpleName(), Collections.singletonList(datasetId), null);
        for(omero.model.Image img : imgs)
            System.out.println(img.getId().getValue());


Yes the Ice Api documentation is quite cryptic. There's also the 'OMERO.blitz' documentation which can be more helpful with respect to the Java API: https://downloads.openmicroscopy.org/omero/5.4.6/api/ , but still it's not ideal. I have a look around, hope I can point you to the right location later.

Kind Regards,
Dominik

Re: How to get the list of images in a dataset?

PostPosted: Thu Jul 19, 2018 10:43 am
by Dominik
There is also some MATLAB specific documentation here:
https://docs.openmicroscopy.org/omero/5 ... atlab.html

Regards,
Dominik

Re: How to get the list of images in a dataset?

PostPosted: Thu Jul 19, 2018 8:19 pm
by Kouichi_C_Nakamura
Sorry, I should have looked more carefully. https://docs.openmicroscopy.org/omero/5 ... ading-data

This is the one I was looking for!

Code: Select all
datasetImages = getImages(session, 'dataset', datasetsIds)

Re: How to get the list of images in a dataset?

PostPosted: Fri Jul 20, 2018 3:19 pm
by Kouichi_C_Nakamura
Yes the Ice Api documentation is quite cryptic.


This is something I'd never understand. Why on earth do people leave cryptic documentation? During the last a few months I spent days and nights wandering in ImageJ and OMERO API documentation, but generally, they're inconceivable. Usually, there is no example given. Data type of input arguments are usually given, but often it is not specific enough and it is hard to work out how to prepare them. Phew...