ome / omero-gateway-java

Gradle project containing OMERO Java Client Library
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
1 stars 9 forks source link

Add method to get PlaneInfos #57

Closed dominikl closed 3 years ago

dominikl commented 3 years ago

Add a similar method to the copyPlaneInfo method of Python BlitzGateway. Should fix https://github.com/ome/omero-gateway-java/issues/54 .

Todo: Still needs integration test. Done

dominikl commented 3 years ago

I can't compile/run the integration tests locally any longer, so I can't add any. But here's some example test code (using Image id 83221 which has some PlaneInfos):

public static void main(String[] args) throws Exception {
        LoginCredentials lc = new LoginCredentials("user-3", "xxx", "merge-ci-devspace.openmicroscopy.org");

        try(Gateway gw = new Gateway(new SimpleLogger())) {
            ExperimenterData e = gw.connect(lc);
            SecurityContext ctx = new SecurityContext(e.getGroupId());
            long imageId = 83221;
            BrowseFacility b = gw.getFacility(BrowseFacility.class);
            ImageData img = b.getImage(ctx, imageId);

            MetadataFacility mf = gw.getFacility(MetadataFacility.class);
            List<PlaneInfoData> pis = mf.getPlaneInfos(ctx, img.getDefaultPixels());
            for (PlaneInfoData pi : pis) {
                System.out.println("c="+pi.getTheC()+" z="+pi.getTheZ()+" t="+pi.getTheT()+" deltaT="+pi.getDeltaT());
            }
        }
    }
jburel commented 3 years ago

Now that you can run the tests locally. Will you add a test?

dominikl commented 3 years ago

Will do. A problem could be to create an image with PlaneInfos in the test environment. But I'll have a look.

jburel commented 3 years ago

I wrote a Python script for idr0113 to populate plane info (parse_time.py) This will have to be translated into Java but that will give you an idea of what to do

jburel commented 3 years ago

Tests in https://github.com/ome/openmicroscopy/pull/6285 are green