Accept Gateway objects in all MATLAB functions
Posted: Tue Jan 29, 2019 11:03 am
Now thanks to this topic (http://www.openmicroscopy.org/community ... f=6&t=8593), with a dependency on Bio-Formats, you can use Jave Gateway from MATLAB. See loadOmeroGateway.m https://gist.github.com/kouichi-c-nakam ... 71a8578596
Accept Gateway objects in all (MATLAB) functions
https://github.com/ome/omero-matlab/issues/5
Following the proposal above, I tried to make a MATLAB function``writeMapAnnotation.m`` support Gateway object as well. For that, however, you'll need ExperimenterData (user), a group ID, or SecurityContext (ctx) alongside with Gateway object, because many of omeo.gateway.Facility subclasses require a SecurityContext (ctx) prepared as below:
In modifying ``writeMapAnnotation.m``, I think the syntaxes like
1. ma = writeMapAnnotation({gateway, user}, keys, values)
2. ma = writeMapAnnotation(gateway, keys, values, user)
3. ma = writeMapAnnotation(gateway, user, keys, values)
are awkward, because they differ from the syntax for the session-client approach.
Do you think one of the examples below is good?
4. ma = writeMapAnnotation(gateway, keys, values, 'user',user)
5. ma = writeMapAnnotation(gateway, keys, values, 'group',groupId)
6. ma = writeMapAnnotation(gateway, keys, values, 'context',ctx)
Or we need to think of something else?
Option 4 is the simplest.
But because writeMapAnnotation already accepts `group` parameter, option 5 can be implemented with the smallest changes in the syntax.
I'd love to hear your thoughts on this.
Accept Gateway objects in all (MATLAB) functions
https://github.com/ome/omero-matlab/issues/5
Following the proposal above, I tried to make a MATLAB function``writeMapAnnotation.m`` support Gateway object as well. For that, however, you'll need ExperimenterData (user), a group ID, or SecurityContext (ctx) alongside with Gateway object, because many of omeo.gateway.Facility subclasses require a SecurityContext (ctx) prepared as below:
- Code: Select all
ctx = omero.gateway.SecurityContext(user.getGroupId());
In modifying ``writeMapAnnotation.m``, I think the syntaxes like
1. ma = writeMapAnnotation({gateway, user}, keys, values)
2. ma = writeMapAnnotation(gateway, keys, values, user)
3. ma = writeMapAnnotation(gateway, user, keys, values)
are awkward, because they differ from the syntax for the session-client approach.
Do you think one of the examples below is good?
4. ma = writeMapAnnotation(gateway, keys, values, 'user',user)
5. ma = writeMapAnnotation(gateway, keys, values, 'group',groupId)
6. ma = writeMapAnnotation(gateway, keys, values, 'context',ctx)
Or we need to think of something else?
Option 4 is the simplest.
But because writeMapAnnotation already accepts `group` parameter, option 5 can be implemented with the smallest changes in the syntax.
I'd love to hear your thoughts on this.