Package fr.igred.omero.repository
Class DatasetWrapper
java.lang.Object
fr.igred.omero.GenericObjectWrapper<T>
fr.igred.omero.AnnotatableWrapper<T>
fr.igred.omero.repository.GenericRepositoryObjectWrapper<DatasetData>
fr.igred.omero.repository.DatasetWrapper
Class containing a DatasetData object.
Wraps function calls to the DatasetData contained.
-
Nested Class Summary
Nested classes/interfaces inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
GenericRepositoryObjectWrapper.ReplacePolicy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Annotation link name for this type of objectFields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
Constructor Summary
ConstructorDescriptionDatasetWrapper
(String name, String description) Constructor of the DatasetWrapper classDatasetWrapper
(DatasetData dataset) Constructor of the DatasetWrapper class -
Method Summary
Modifier and TypeMethodDescriptionvoid
addImage
(Client client, ImageWrapper image) Adds a single image to the dataset in OMEROvoid
addImages
(Client client, List<? extends ImageWrapper> images) Adds a list of image to the dataset in OMERO.protected String
Returns the type of annotation link for this object.Deprecated.Returns the DatasetData contained.Gets the DatasetData descriptionGets all images in the dataset available from OMERO.Gets all images in the dataset with a certain name from OMERO.getImagesKey
(Client client, String key) Deprecated.Gets all images in the dataset with a certain keygetImagesLike
(Client client, String motif) Gets all images in the dataset with a certain motif in their name from OMERO.getImagesPairKeyValue
(Client client, String key, String value) Deprecated.Gets all images in the dataset with a certain key value pair from OMEROgetImagesTagged
(Client client, TagAnnotationWrapper tag) Gets all images in the dataset tagged with a specified tag from OMERO.getImagesTagged
(Client client, Long tagId) Gets all images in the dataset tagged with a specified tag from OMERO.getImagesWithKey
(Client client, String key) Gets all images in the dataset with a certain keygetImagesWithKeyValuePair
(Client client, String key, String value) Gets all images in the dataset with a certain key value pair from OMEROgetName()
Gets the DatasetData namegetProjects
(Client client) Retrieves the projects containing this dataset.importAndReplaceImages
(Client client, String path) Imports one image file to the dataset in OMERO and replace older images sharing the same name after copying their annotations and ROIs, and concatenating the descriptions (on new lines) by unlinking them.importAndReplaceImages
(Client client, String path, GenericRepositoryObjectWrapper.ReplacePolicy policy) Imports one image file to the dataset in OMERO and replace older images sharing the same name after copying their annotations and ROIs, and concatenating the descriptions (on new lines) by unlinking or even deleting them.importImage
(Client client, String path) Imports one image file to the dataset in OMERO.boolean
importImages
(Client client, int threads, String... paths) Imports all images candidates in the paths to the dataset in OMERO.boolean
importImages
(Client client, String... paths) Imports all images candidates in the paths to the dataset in OMERO.void
Reloads the dataset from OMERO.void
removeImage
(Client client, ImageWrapper image) Removes an image from the dataset in OMERO.replaceImages
(Client client, Collection<? extends ImageWrapper> oldImages, ImageWrapper newImage) Replaces (and unlinks) a collection of images from this dataset by a new image, after copying their annotations and ROIs, and concatenating the descriptions (on new lines).void
setDescription
(String description) Sets the description of the dataset.void
Sets the name of the dataset.Methods inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
copyAnnotationLinks, importImage, importImages, refresh
Methods inherited from class fr.igred.omero.AnnotatableWrapper
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addFileAnnotation, addKeyValuePair, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTags, addTags, copyAnnotationLinks, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getRatings, getTable, getTables, getTags, getValue, isLinked, link, link, linkIfNotLinked, rate, removeLink, unlink
Methods inherited from class fr.igred.omero.GenericObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, flatten, getCreated, getGroupId, getId, getOwner, getUpdated, saveAndUpdate, toString, wrap, wrap
-
Field Details
-
ANNOTATION_LINK
Annotation link name for this type of object- See Also:
-
-
Constructor Details
-
DatasetWrapper
Constructor of the DatasetWrapper class- Parameters:
name
- Name of the dataset.description
- Description of the dataset.
-
DatasetWrapper
Constructor of the DatasetWrapper class- Parameters:
dataset
- Dataset to be contained.
-
-
Method Details
-
getName
Gets the DatasetData name- Specified by:
getName
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- DatasetData name.
-
setName
Sets the name of the dataset.- Parameters:
name
- The name of the dataset. Mustn't benull
.- Throws:
IllegalArgumentException
- If the name isnull
.
-
asDatasetData
Deprecated.Returns the DatasetData contained. UseGenericObjectWrapper.asDataObject()
instead.- Returns:
- See above.
-
getDescription
Gets the DatasetData description- Specified by:
getDescription
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- DatasetData description.
-
setDescription
Sets the description of the dataset.- Parameters:
description
- The description of the dataset.
-
annotationLinkType
Returns the type of annotation link for this object.- Specified by:
annotationLinkType
in classAnnotatableWrapper<DatasetData>
- Returns:
- See above.
-
getProjects
public List<ProjectWrapper> getProjects(Client client) throws OMEROServerError, ServiceException, AccessException, ExecutionException Retrieves the projects containing this dataset.- Parameters:
client
- The client handling the connection.- Returns:
- See above.
- Throws:
OMEROServerError
- Server error.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages(Client client) throws ServiceException, AccessException, ExecutionException Gets all images in the dataset available from OMERO.- Parameters:
client
- The client handling the connection.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages(Client client, String name) throws ServiceException, AccessException, ExecutionException Gets all images in the dataset with a certain name from OMERO.- Parameters:
client
- The client handling the connection.name
- Name searched.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesLike
public List<ImageWrapper> getImagesLike(Client client, String motif) throws ServiceException, AccessException, ExecutionException Gets all images in the dataset with a certain motif in their name from OMERO.- Parameters:
client
- The client handling the connection.motif
- Motif searched in an image name.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesTagged
public List<ImageWrapper> getImagesTagged(Client client, TagAnnotationWrapper tag) throws ServiceException, AccessException, OMEROServerError, ExecutionException Gets all images in the dataset tagged with a specified tag from OMERO.- Parameters:
client
- The client handling the connection.tag
- The tag annotation.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesTagged
public List<ImageWrapper> getImagesTagged(Client client, Long tagId) throws ServiceException, AccessException, OMEROServerError, ExecutionException Gets all images in the dataset tagged with a specified tag from OMERO.- Parameters:
client
- The client handling the connection.tagId
- ID of the tag researched.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesKey
@Deprecated public List<ImageWrapper> getImagesKey(Client client, String key) throws ServiceException, AccessException, ExecutionException Deprecated.Gets all images in the dataset with a certain key- Parameters:
client
- The client handling the connection.key
- Name of the key researched.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesWithKey
public List<ImageWrapper> getImagesWithKey(Client client, String key) throws ServiceException, AccessException, ExecutionException Gets all images in the dataset with a certain key- Parameters:
client
- The client handling the connection.key
- Name of the key researched.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesPairKeyValue
@Deprecated public List<ImageWrapper> getImagesPairKeyValue(Client client, String key, String value) throws ServiceException, AccessException, ExecutionException Deprecated.Gets all images in the dataset with a certain key value pair from OMERO- Parameters:
client
- The client handling the connection.key
- Name of the key researched.value
- Value associated with the key.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesWithKeyValuePair
public List<ImageWrapper> getImagesWithKeyValuePair(Client client, String key, String value) throws ServiceException, AccessException, ExecutionException Gets all images in the dataset with a certain key value pair from OMERO- Parameters:
client
- The client handling the connection.key
- Name of the key researched.value
- Value associated with the key.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addImages
public void addImages(Client client, List<? extends ImageWrapper> images) throws ServiceException, AccessException, ExecutionException Adds a list of image to the dataset in OMERO.- Parameters:
client
- The client handling the connection.images
- Image to add to the dataset.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addImage
public void addImage(Client client, ImageWrapper image) throws ServiceException, AccessException, ExecutionException Adds a single image to the dataset in OMERO- Parameters:
client
- The client handling the connection.image
- Image to add.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
removeImage
public void removeImage(Client client, ImageWrapper image) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException Removes an image from the dataset in OMERO.- Parameters:
client
- The client handling the connection.image
- Image to remove.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.OMEROServerError
- Server error.InterruptedException
- If block(long) does not return.
-
importImages
public boolean importImages(Client client, String... paths) throws ServiceException, OMEROServerError, AccessException, IOException, ExecutionException Imports all images candidates in the paths to the dataset in OMERO.- Parameters:
client
- The client handling the connection.paths
- Paths to the image files on the computer.- Returns:
- If the import did not exit because of an error.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.IOException
- Cannot read file.ExecutionException
- A Facility can't be retrieved or instantiated.
-
importImages
public boolean importImages(Client client, int threads, String... paths) throws ServiceException, OMEROServerError, AccessException, IOException, ExecutionException Imports all images candidates in the paths to the dataset in OMERO.- Parameters:
client
- The client handling the connection.threads
- The number of threads (same value used for filesets and uploads).paths
- Paths to the image files on the computer.- Returns:
- If the import did not exit because of an error.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.IOException
- Cannot read file.ExecutionException
- A Facility can't be retrieved or instantiated.
-
importImage
public List<Long> importImage(Client client, String path) throws ServiceException, AccessException, OMEROServerError, ExecutionException Imports one image file to the dataset in OMERO.- Parameters:
client
- The client handling the connection.path
- Path to the image file on the computer.- Returns:
- The list of IDs of the newly imported images.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
replaceImages
public List<ImageWrapper> replaceImages(Client client, Collection<? extends ImageWrapper> oldImages, ImageWrapper newImage) throws AccessException, ServiceException, ExecutionException, OMEROServerError, InterruptedException Replaces (and unlinks) a collection of images from this dataset by a new image, after copying their annotations and ROIs, and concatenating the descriptions (on new lines).- Parameters:
client
- The client handling the connection.oldImages
- The list of old images to replace.newImage
- The new image.- Returns:
- The list of images that became orphaned once replaced.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- If block(long) does not return.
-
importAndReplaceImages
public List<Long> importAndReplaceImages(Client client, String path, GenericRepositoryObjectWrapper.ReplacePolicy policy) throws ServiceException, AccessException, OMEROServerError, ExecutionException, InterruptedException Imports one image file to the dataset in OMERO and replace older images sharing the same name after copying their annotations and ROIs, and concatenating the descriptions (on new lines) by unlinking or even deleting them.- Parameters:
client
- The client handling the connection.path
- Path to the image on the computer.policy
- Whether older images should be unlinked, deleted or deleted only if they become orphaned.- Returns:
- The list of IDs of the newly imported images.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- If block(long) does not return.
-
importAndReplaceImages
public List<Long> importAndReplaceImages(Client client, String path) throws ServiceException, AccessException, OMEROServerError, ExecutionException, InterruptedException Imports one image file to the dataset in OMERO and replace older images sharing the same name after copying their annotations and ROIs, and concatenating the descriptions (on new lines) by unlinking them.- Parameters:
client
- The client handling the connection.path
- Path to the image on the computer.- Returns:
- The list of IDs of the newly imported images.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- If block(long) does not return.
-
reload
Reloads the dataset from OMERO.- Overrides:
reload
in classGenericRepositoryObjectWrapper<DatasetData>
- Parameters:
browser
- The data browser.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-