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, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
public Param getJobParam(ModuleItem<?> item)
OMEROService
getJobParam
in interface OMEROService
public RType prototype(Class<?> type)
OMEROService
prototype
in interface OMEROService
public 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 OMEROService
public 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 OMEROService
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
ExecutionException
DSOutOfServiceException
DSAccessException
ServerError
IOException
NumberFormatException
URISyntaxException
public 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 OMEROService
ServerError
IOException
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
SecurityException
DSOutOfServiceException
ExecutionException
DSAccessException
public 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
OMEROService
uploadImage
in interface OMEROService
ServerError
IOException
ExecutionException
DSOutOfServiceException
DSAccessException
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
public 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
OMEROService
uploadImageAttachments
in interface OMEROService
ExecutionException
DSOutOfServiceException
DSAccessException
ServerError
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
public Dataset downloadImage(client client, long imageID) throws ServerError, IOException
OMEROService
Dataset
.downloadImage
in interface OMEROService
ServerError
IOException
public long uploadImage(client client, Dataset dataset) throws ServerError, IOException
OMEROService
Dataset
's image to OMERO, returning the
new image ID on the OMERO server.uploadImage
in interface OMEROService
ServerError
IOException
public long uploadTable(OMEROLocation credentials, String name, Table<?,?> imageJTable, long imageID) throws ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException
OMEROService
uploadTable
in interface OMEROService
ServerError
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
ExecutionException
DSOutOfServiceException
DSAccessException
public TableData convertOMEROTable(Table<?,?> imageJTable)
OMEROService
convertOMEROTable
in interface OMEROService
public Table<?,?> downloadTable(OMEROLocation credentials, long tableID) throws ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException
OMEROService
Table
.downloadTable
in interface OMEROService
ServerError
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
ExecutionException
DSOutOfServiceException
DSAccessException
public List<Table<?,?>> downloadTables(OMEROLocation credentials, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException, ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException
OMEROService
downloadTables
in interface OMEROService
ExecutionException
DSOutOfServiceException
DSAccessException
ServerError
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
public ROITree downloadROIs(OMEROLocation credentials, long imageID) throws ServerError, Glacier2.PermissionDeniedException, Glacier2.CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException
OMEROService
imageID
from OMERO,
and returns them as a ROITree
.downloadROIs
in interface OMEROService
ServerError
Glacier2.PermissionDeniedException
Glacier2.CannotCreateSessionException
ExecutionException
DSOutOfServiceException
DSAccessException
public ROITree downloadROI(OMEROLocation credentials, long roiID) throws DSOutOfServiceException, DSAccessException, ExecutionException
OMEROService
downloadROI
in interface OMEROService
DSOutOfServiceException
DSAccessException
ExecutionException
public long[] uploadROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROService
TreeNode
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 OMEROService
ExecutionException
DSOutOfServiceException
DSAccessException
public long[] updateROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROService
TreeNode
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 OMEROService
ExecutionException
DSOutOfServiceException
DSAccessException
public Collection<ROIData> uploadAndReturnROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROService
TreeNode
to OMERO ROI(s), and uploads them all
as new Objects to the server. The new OMERO objects are then returned.uploadAndReturnROIs
in interface OMEROService
ExecutionException
DSOutOfServiceException
DSAccessException
public Collection<ROIData> updateAndReturnROIs(OMEROLocation credentials, TreeNode<?> ijROIs, long imageID) throws ExecutionException, DSOutOfServiceException, DSAccessException
OMEROService
TreeNode
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 OMEROService
ExecutionException
DSOutOfServiceException
DSAccessException
public List<ROIData> convertOMEROROI(TreeNode<?> dataNodeRois, Interval interval)
OMEROService
TreeNode
to ROIData
. If an interval is
provided it will be used to convert unbounded MaskPredicate
s to
ROIData
. If the interval is null, then unbounded
MaskPredicate
s cannot be converted to ROIData
and an
exception is thrown.convertOMEROROI
in interface OMEROService
public ROIData getUpdatedServerROIData(long roiDataId)
OMEROService
ROIData
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 OMEROService
public void addROIMapping(Object roi, ROIData shape)
OMEROService
ROIData
.addROIMapping
in interface OMEROService
public ROIData getROIMapping(Object key)
OMEROService
ROIData
associated with this key. Returns null
if there's no mapping.getROIMapping
in interface OMEROService
public Set<Object> getROIMappingKeys()
OMEROService
getROIMappingKeys
in interface OMEROService
public void removeROIMapping(Object key)
OMEROService
Object
ROIData
mapping associated with the
given key from the stored ROIs.removeROIMapping
in interface OMEROService
public void clearROIMappings()
OMEROService
Object
ROIData
mappings.clearROIMappings
in interface OMEROService
public OMEROSession session(OMEROLocation location)
OMEROService
OMEROSession
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 OMEROService
location
- OMEROLocationpublic OMEROSession session()
OMEROService
OMEROSession
related to the running thread.session
in interface OMEROService
public OMEROSession createSession(OMEROLocation location)
OMEROService
createSession
in interface OMEROService
location
- OMEROLocation to be used to create the sessionpublic void removeSession(OMEROSession session)
OMEROService
OMEROSession
for the cache of stored sessions.removeSession
in interface OMEROService
session
- The session to be removedCopyright © 2014–2022 ImageJ. All rights reserved.