[ome-devel] dataset.getname() gives error? Matlab
Sebastien Besson
s.besson at dundee.ac.uk
Fri Aug 17 13:32:47 BST 2012
Hi Ian,
a solution to your problem is to reload the datasets using the ContainerService.
% Create dataset ids array
datasetIds = java.util.ArrayList();
datasetIds.add(java.lang.Long(dataset.getId().getValue()))
% Load datasets
proxy = session.getContainerService();
datasets = proxy.loadContainerHierarchy('omero.model.Dataset', datasetIds,[]);
% Read dataset name
datasets.get(0).getName().getValue()
Cheers,
Sebastien
On 17 Aug 2012, at 12:09, Munro, Ian wrote:
Hello
I wonder if anyone can help me with this?
Given a valid imageId I'm trying to get the name of the parent dataset using Matlab.
this snippet
ids = java.util.ArrayList();
ids.add(imageId); %add the id of the image.
param = omero.sys.ParametersI;
param.addIds(ids);
service = session.getQueryService();
list = service.findAllByQuery(['select l from DatasetImageLink as l where l.child.id = ', num2str(ID)], []);
dataset = list.get(0).getParent();
datasetId = dataset.getId().getValue()
runs fine & gives me a datasetId that looks good (ie matches what I see with insight)
However this line
dataset.getName()
Gives me the following errors
Error using omero.model.DatasetI/getName
Java exception occurred:
omero.UnloadedEntityException: Object unloaded:omero.model.DatasetI at d0c94c0
at omero.model.DatasetI.errorIfUnloaded(DatasetI.java:22)
at omero.model.DatasetI.getName(DatasetI.java:668)
at omero.model.Dataset.getName(Dataset.java:218)
Any help welcome at this point. I assume "Object Unloaded" is a clue here?
Thanks
Ian
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20120817/0cac3ca4/attachment.html>
More information about the ome-devel
mailing list