public class DefaultOMEROService extends AbstractService implements OMEROService, Optional
| Constructor and Description |
|---|
DefaultOMEROService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addROIMapping(Object roi,
ROIData shape)
Add a mapping between a ROIs originating from ImageJ and an OMERO
ROIData. |
void |
clearROIMappings()
Removes all
Object ROIData mappings. |
List<ROIData> |
convertOMEROROI(TreeNode<?> dataNodeRois,
Interval interval)
|
TableData |
convertOMEROTable(Table<?,?> imageJTable)
Converts the given ImageJ table to an OMERO table, but does not save the
table to the server.
|
OMEROSession |
createSession(OMEROLocation location)
Creates an OMEROSession.
|
Dataset |
downloadImage(client client,
long imageID)
Downloads the image with the given image ID from OMERO, storing the result
into a new ImageJ
Dataset. |
ROITree |
downloadROI(OMEROLocation credentials,
long roiID)
|
ROITree |
downloadROIs(OMEROLocation credentials,
long imageID)
Downloads the ROIs associated with the given
imageID from OMERO,
and returns them as a ROITree. |
Table<?,?> |
downloadTable(OMEROLocation credentials,
long tableID)
Downloads the table with the given ID from OMERO, storing the result into a
new ImageJ
Table. |
List<Table<?,?>> |
downloadTables(OMEROLocation credentials,
long imageID)
Downloads all tables associated with the given image ID in OMERO.
|
Param |
getJobParam(ModuleItem<?> item)
Converts an ImageJ module parameter to an OMERO job parameter.
|
ROIData |
getROIMapping(Object key)
Retrieve the
ROIData associated with this key. |
Set<Object> |
getROIMappingKeys()
Returns all the keys for mapped ROIs.
|
ROIData |
getUpdatedServerROIData(long roiDataId)
Returns the most recently retrieved
ROIData object with the given
ID. |
RType |
prototype(Class<?> type)
Creates an OMERO parameter prototype for the given Java class.
|
void |
removeROIMapping(Object key)
Removes the
Object ROIData mapping associated with the
given key from the stored ROIs. |
void |
removeSession(OMEROSession session)
Remove the specified
OMEROSession for the cache of stored sessions. |
OMEROSession |
session()
Returns the
OMEROSession related to the running thread. |
OMEROSession |
session(OMEROLocation location)
Returns an
OMEROSession using the given OMEROLocation. |
Object |
toImageJ(client client,
RType value,
Class<?> type)
Converts an OMERO parameter value to an ImageJ value of the given type.
|
Object |
toOMERO(client client,
Object value)
Converts an ImageJ parameter value to an OMERO parameter value.
|
RType |
toOMERO(Object value)
Converts an ImageJ parameter value to an OMERO parameter value.
|
Collection<ROIData> |
updateAndReturnROIs(OMEROLocation credentials,
TreeNode<?> ijROIs,
long imageID)
Converts the given
TreeNode to OMERO ROI(s), creating new Objects
on the server only for ROIs which didn't previously exist. |
long[] |
updateROIs(OMEROLocation credentials,
TreeNode<?> ijROIs,
long imageID)
Converts the given
TreeNode to OMERO ROIs(s). |
Collection<ROIData> |
uploadAndReturnROIs(OMEROLocation credentials,
TreeNode<?> ijROIs,
long imageID)
Converts the given
TreeNode to OMERO ROI(s), and uploads them all
as new Objects to the server. |
long |
uploadImage(client client,
Dataset dataset)
Uploads the given ImageJ
Dataset's image to OMERO, returning the
new image ID on the OMERO server. |
void |
uploadImage(OMEROLocation credentials,
Dataset image,
boolean uploadROIs,
TreeNode<?> rois,
boolean updateROIs,
boolean uploadTables,
List<Table<?,?>> tables,
String[] tableNames,
long omeroDatasetID)
Uploads the given image to OMERO, and optionally uploads the given ROIs and
tables.
|
void |
uploadImageAttachments(OMEROLocation credentials,
long imageID,
boolean uploadROIs,
boolean updateROIs,
boolean uploadTables,
TreeNode<?> rois,
List<Table<?,?>> tables,
String[] tableNames)
Uploads the attachments to the OMERO server, and attaches them to the image
associated with the given id.
|
long[] |
uploadROIs(OMEROLocation credentials,
TreeNode<?> ijROIs,
long imageID)
Converts the given
TreeNode to OMERO ROI(s), uploads them to the
OMEROServer, and attaches them to the image with the specified ID. |
long |
uploadTable(OMEROLocation credentials,
String name,
Table<?,?> imageJTable,
long imageID)
Uploads an ImageJ table to OMERO, returning the new table ID on the OMERO
server.
|
getContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinitialize, registerEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiondisposepublic Param getJobParam(ModuleItem<?> item)
OMEROServicegetJobParam in interface OMEROServicepublic RType prototype(Class<?> type)
OMEROServiceprototype in interface OMEROServicepublic RType toOMERO(Object value)
OMEROService
This method only handles basic types, not image types; see
OMEROService.toOMERO(omero.client, Object) for details.
toOMERO in interface OMEROServicepublic Object toOMERO(client client, Object value) throws ServerError, IOException, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException, NumberFormatException, URISyntaxException
OMEROService
If the given object is an image type (i.e., Dataset,
DatasetView or ImageDisplay) then the OMEROService.uploadImage(net.imagej.omero.OMEROLocation, net.imagej.Dataset, boolean, org.scijava.util.TreeNode<?>, boolean, boolean, java.util.List<org.scijava.table.Table<?, ?>>, java.lang.String[], long)
method will be used transparently to convert the object into an OMERO image
ID.
toOMERO in interface OMEROServiceGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionServerErrorIOExceptionNumberFormatExceptionURISyntaxExceptionpublic Object toImageJ(client client, RType value, Class<?> type) throws ServerError, IOException, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, SecurityException, DSOutOfServiceException, ExecutionException, DSAccessException
OMEROService
If the requested type is an image type (i.e., Dataset,
DatasetView or ImageDisplay) then the
OMEROService.downloadImage(omero.client, long) method will be used transparently to convert the
OMERO image ID into such an object.
toImageJ in interface OMEROServiceServerErrorIOExceptionGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionSecurityExceptionDSOutOfServiceExceptionExecutionExceptionDSAccessExceptionpublic void uploadImage(OMEROLocation credentials, Dataset image, boolean uploadROIs, TreeNode<?> rois, boolean updateROIs, boolean uploadTables, List<Table<?,?>> tables, String[] tableNames, long omeroDatasetID) throws ServerError, IOException, ExecutionException, DSOutOfServiceException, DSAccessException, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException
OMEROServiceuploadImage in interface OMEROServiceServerErrorIOExceptionExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionpublic void uploadImageAttachments(OMEROLocation credentials, long imageID, boolean uploadROIs, boolean updateROIs, boolean uploadTables, TreeNode<?> rois, List<Table<?,?>> tables, String[] tableNames) throws ExecutionException, DSOutOfServiceException, DSAccessException, ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException
OMEROServiceuploadImageAttachments in interface OMEROServiceExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionServerErrorGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionpublic Dataset downloadImage(client client, long imageID) throws ServerError, IOException
OMEROServiceDataset.downloadImage in interface OMEROServiceServerErrorIOExceptionpublic long uploadImage(client client, Dataset dataset) throws ServerError, IOException
OMEROServiceDataset's image to OMERO, returning the
new image ID on the OMERO server.uploadImage in interface OMEROServiceServerErrorIOExceptionpublic long uploadTable(OMEROLocation credentials, String name, Table<?,?> imageJTable, long imageID) throws ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException
OMEROServiceuploadTable in interface OMEROServiceServerErrorGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionpublic TableData convertOMEROTable(Table<?,?> imageJTable)
OMEROServiceconvertOMEROTable in interface OMEROServicepublic Table<?,?> downloadTable(OMEROLocation credentials, long tableID) throws ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException
OMEROServiceTable.downloadTable in interface OMEROServiceServerErrorGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionpublic List<Table<?,?>> downloadTables(OMEROLocation credentials, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException, ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException
OMEROServicedownloadTables in interface OMEROServiceExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionServerErrorGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionpublic ROITree downloadROIs(OMEROLocation credentials, long imageID) throws ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException
OMEROServiceimageID from OMERO,
and returns them as a ROITree.downloadROIs in interface OMEROServiceServerErrorGlacier2.PermissionDeniedExceptionGlacier2.CannotCreateSessionExceptionExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionpublic ROITree downloadROI(OMEROLocation credentials, long roiID) throws DSOutOfServiceException, DSAccessException, ExecutionException
OMEROServicedownloadROI in interface OMEROServiceDSOutOfServiceExceptionDSAccessExceptionExecutionExceptionpublic long[] uploadROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROServiceTreeNode to OMERO ROI(s), uploads them to the
OMEROServer, and attaches them to the image with the specified ID. All ROIs
are uploaded as new Objects, regardless of their origin.uploadROIs in interface OMEROServiceExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionpublic long[] updateROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROServiceTreeNode to OMERO ROIs(s). ROIs which originated
from OMERO are updated on the server, and new ROIs are uploaded. The ids of
the new ROI objects is returned.updateROIs in interface OMEROServiceExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionpublic Collection<ROIData> uploadAndReturnROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROServiceTreeNode to OMERO ROI(s), and uploads them all
as new Objects to the server. The new OMERO objects are then returned.uploadAndReturnROIs in interface OMEROServiceExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionpublic Collection<ROIData> updateAndReturnROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROServiceTreeNode to OMERO ROI(s), creating new Objects
on the server only for ROIs which didn't previously exist. ROIs which
originated from OMERO are updated on the server. A collection of the new
ROI objects is returned.updateAndReturnROIs in interface OMEROServiceExecutionExceptionDSOutOfServiceExceptionDSAccessExceptionpublic List<ROIData> convertOMEROROI(TreeNode<?> dataNodeRois, Interval interval)
OMEROServiceTreeNode to ROIData. If an interval is
provided it will be used to convert unbounded MaskPredicates to
ROIData. If the interval is null, then unbounded
MaskPredicates cannot be converted to ROIData and an
exception is thrown.convertOMEROROI in interface OMEROServicepublic ROIData getUpdatedServerROIData(long roiDataId)
OMEROServiceROIData object with the given
ID. If no such mapping exists null is returned.
When a ROIData object is updated and the new version uploaded to the OMERO
server, previous ROIData objects become "locked" and subsequent attempts to
update and upload new versions of them to OMERO will result in
OptimisticLockException. Therefore, pairings of the
id and the update OMERO server ROIData object must be stored.
getUpdatedServerROIData in interface OMEROServicepublic void addROIMapping(Object roi, ROIData shape)
OMEROServiceROIData.addROIMapping in interface OMEROServicepublic ROIData getROIMapping(Object key)
OMEROServiceROIData associated with this key. Returns null
if there's no mapping.getROIMapping in interface OMEROServicepublic Set<Object> getROIMappingKeys()
OMEROServicegetROIMappingKeys in interface OMEROServicepublic void removeROIMapping(Object key)
OMEROServiceObject ROIData mapping associated with the
given key from the stored ROIs.removeROIMapping in interface OMEROServicepublic void clearROIMappings()
OMEROServiceObject ROIData mappings.clearROIMappings in interface OMEROServicepublic OMEROSession session(OMEROLocation location)
OMEROServiceOMEROSession using the given OMEROLocation. If a
session with this location already exists it is returned, if not a new one
is created.session in interface OMEROServicelocation - OMEROLocationpublic OMEROSession session()
OMEROServiceOMEROSession related to the running thread.session in interface OMEROServicepublic OMEROSession createSession(OMEROLocation location)
OMEROServicecreateSession in interface OMEROServicelocation - OMEROLocation to be used to create the sessionpublic void removeSession(OMEROSession session)
OMEROServiceOMEROSession for the cache of stored sessions.removeSession in interface OMEROServicesession - The session to be removedCopyright © 2014–2022 ImageJ. All rights reserved.