[ome-devel] listing wells of another users plate with Java API?

Jäälinoja, Harri Tapio harri.jaalinoja at helsinki.fi
Tue Feb 7 15:25:49 GMT 2017


Hi,

I uploaded the same dataset also as the jenkins user. But this part...

println 3
Collection<WellData> wells = browse.getWells(ctx, plateId);
Iterator<WellData> j = wells.iterator();
WellData well;
while (j.hasNext()) {
    well = j.next();
    //Do something
        println 'well'
}

... still doesn't print any wells even though the user owns the plate. I remembered to change the hardcoded plate ID.

Best,
Harri
________________________________________
From: Jäälinoja, Harri Tapio
Sent: 07 February 2017 11:52:38
To: OME External Developer List
Subject: Re: [ome-devel] listing wells of another users plate with Java API?

Hi,

it didn't help immediately, here's the latest try:

IContainerPrx proxy = gateway.getPojosService(ctx);
ParametersI param = new ParametersI();
long userId = gateway.getLoggedInUser().getId();
param.exp(rtypes.rlong(userId));
//param.allExps()
//param.allGrps()
//Load the orphaned datasets.
param.orphan();
//Do not load the images.
param.noLeaves(); //indicate to load the images
//param.noLeaves(); //no images loaded, this is the default value.

// Is omero.model.screen.Plate the right class to search here?
List<IObject> results = proxy.loadContainerHierarchy(
        Plate.class.getName(), plateIds, param);
println results


You can see the complete script here:
https://github.com/hajaalin/Jenkins-LSCI/blob/master/jobs/OS_CONTRIBUTE_IMAGELIST/buildScripts/omeroImageListTest.groovy

Ans this is the command line:
$ groovy -cp "/home/hajaalin/Software/OMERO.insight-5.3.0-m7-152-2b4e9f8-ice35-b0-linux/libs/*" jobs/OS_CONTRIBUTE_IMAGELIST/buildScripts/omeroImageListTest.groovy
connected!
1
LMU-CELLINSIGHT_170111150001
2
3
4
[]
disconnected!


Best,
Harri

________________________________________
From: ome-devel <ome-devel-bounces at lists.openmicroscopy.org.uk> on behalf of Aleksandra Tarkowska (Staff) <A.Tarkowska at dundee.ac.uk>
Sent: 06 February 2017 17:51:12
To: OME External Developer List
Subject: Re: [ome-devel] listing wells of another users plate with Java API?

HI

Did you try to pass user id using ParamtersI ? like in https://github.com/openmicroscopy/openmicroscopy/blob/develop/examples/Training/java/src/training/ReadDataAdvanced.java#L170

Kind regards

Ola
Software Engineer
Open Microscopy Environment
University of Dundee

On 6 Feb 2017, at 15:38, Jäälinoja, Harri Tapio <harri.jaalinoja at helsinki.fi<mailto:harri.jaalinoja at helsinki.fi>> wrote:

Hi,

is it possible to list WellData from a Plate owned by another user? The group is read-annotate, and the user I would like to use in the script can view the images in omero-web.

# the findObject call with the boolean to indicate allGroups finds the plate
# but I didn't find any way to navigate from PlateData to wells
BrowseFacility browse = gateway.getFacility(BrowseFacility.class);
PlateData plate;
plate = (PlateData) browse.findObject(ctx,PlateData.class,plateId,true)
println plate.getName()

# getWells returns an empty list when the script user does not own the plate
Collection<WellData> wells = browse.getWells(ctx, plateId);
Iterator<WellData> j = wells.iterator();
WellData well;
while (j.hasNext()) {
   well = j.next();
   //Do something
  println 'well'
}

The idea is to create a image list with omero URLs for CellProfiler. I'd like to run the script in Jenkins (see https://github.com/Novartis/Jenkins-LSCI), and I'd prefer to use a dedicated OMERO user for this, instead of prompting the users for their LDAP passwords.

I'm using 5.3.0-m7.

Thanks,
Harri

---
Harri Jäälinoja
Light Microscopy Unit
Institute of Biotechnology
University of Helsinki
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


The University of Dundee is a registered Scottish Charity, No: SC015096


More information about the ome-devel mailing list