openmicroscopy/openmicroscopy — pull request #2284 by sbesson (2014-04-10 15:33:15+00:00)
Title: OMERO.matlab: add argument to retrieve annotation by owner

This PR adds support in the OMERO.matlab `getXXXYYYAnnotations` functions for:
- retrieving annotations owned by a different user than the session owner
- keeping the output unflattened when multiple object ids are passed to the function

To test this PR, from a read-annotate group:

1. Choose an `Image` of id `imageId` and add multiple comment annotations owned by multiple users of the group using the OMERO.clients.
2. Download the OMERO.matlab toolbox from the CI job, start MATLAB, log in as one of these users, as described in https://www.openmicroscopy.org/site/support/omero5/developers/Matlab.html and test the following scenarios:
- ``getImageCommentAnnotations(session, imageId)`` should return the comments attached by the user used to create the omero session under MATLAB
- ``getImageCommentAnnotations(session, imageId, 'owner', userId)`` should only return the comments attached by the user of id `userId`
- ``getImageCommentAnnotations(session, imageId, 'owner', -1)`` should return all the comments attached to the image
- ``getImageCommentAnnotations(session, imageId, 'owner', 0)`` should return an empty array
2. Retry steps 1 and 2 with another type of object, e.g. `Project` and another type of annotation e.g. `TagAnnotation` or `FileAnnotation` and check you obtain the same results as above
3. Select a mixture of images, some being annotated and some not, and store their ids in a MATLAB array `imageList`. Check:

-
```
getImageCommentAnnotations(session, imageList)
getImageCommentAnnotations(session, imageList, 'flatten', true)
```

returns a MATLAB array of all the comment annotations owned by the session owner attached to any of the images

- ``getImageCommentAnnotations(session, imageList, `flatten`, false)``

returns a cell array which i-th element contains all comment annotations owned by the session owner for the i-th image.