Package fr.igred.omero.repository
Class DatasetWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.repository.GenericRepositoryObjectWrapper<DatasetData>
-
- fr.igred.omero.repository.DatasetWrapper
-
public class DatasetWrapper extends GenericRepositoryObjectWrapper<DatasetData>
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
Fields Modifier and Type Field Description static java.lang.String
ANNOTATION_LINK
Annotation link name for this type of object-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Constructor Description DatasetWrapper(java.lang.String name, java.lang.String description)
Constructor of the DatasetWrapper classDatasetWrapper(DatasetData dataset)
Constructor of the DatasetWrapper class
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addImage(Client client, ImageWrapper image)
Adds a single image to the dataset in OMEROvoid
addImages(Client client, java.util.List<? extends ImageWrapper> images)
Adds a list of image to the dataset in OMERO.protected java.lang.String
annotationLinkType()
Returns the type of annotation link for this objectDatasetData
asDatasetData()
Deprecated.Returns the DatasetData contained.java.lang.String
getDescription()
Gets the DatasetData descriptionjava.util.List<ImageWrapper>
getImages(Client client)
Gets all images in the dataset available from OMERO.java.util.List<ImageWrapper>
getImages(Client client, java.lang.String name)
Gets all images in the dataset with a certain name from OMERO.java.util.List<ImageWrapper>
getImagesKey(Client client, java.lang.String key)
Deprecated.Gets all images in the dataset with a certain keyjava.util.List<ImageWrapper>
getImagesLike(Client client, java.lang.String motif)
Gets all images in the dataset with a certain motif in their name from OMERO.java.util.List<ImageWrapper>
getImagesPairKeyValue(Client client, java.lang.String key, java.lang.String value)
Deprecated.Gets all images in the dataset with a certain key value pair from OMEROjava.util.List<ImageWrapper>
getImagesTagged(Client client, TagAnnotationWrapper tag)
Gets all images in the dataset tagged with a specified tag from OMERO.java.util.List<ImageWrapper>
getImagesTagged(Client client, java.lang.Long tagId)
Gets all images in the dataset tagged with a specified tag from OMERO.java.util.List<ImageWrapper>
getImagesWithKey(Client client, java.lang.String key)
Gets all images in the dataset with a certain keyjava.util.List<ImageWrapper>
getImagesWithKeyValuePair(Client client, java.lang.String key, java.lang.String value)
Gets all images in the dataset with a certain key value pair from OMEROjava.lang.String
getName()
Gets the DatasetData namejava.util.List<ProjectWrapper>
getProjects(Client client)
Retrieves the projects containing this dataset.java.util.List<java.lang.Long>
importAndReplaceImages(Client client, java.lang.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.java.util.List<java.lang.Long>
importAndReplaceImages(Client client, java.lang.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.java.util.List<java.lang.Long>
importImage(Client client, java.lang.String path)
Imports one image file to the dataset in OMERO.boolean
importImages(Client client, java.lang.String... paths)
Imports all images candidates in the paths to the dataset in OMERO.void
refresh(Client client)
Refreshes the dataset.void
removeImage(Client client, ImageWrapper image)
Removes an image from the dataset in OMERO.java.util.List<ImageWrapper>
replaceImages(Client client, java.util.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(java.lang.String description)
Sets the description of the dataset.void
setName(java.lang.String name)
Sets the name of the dataset.-
Methods inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addFileAnnotation, addKeyValuePair, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTags, addTags, copyAnnotationLinks, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getTable, getTables, getTags, getValue, importImage, importImages, 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, saveAndUpdate, toString, wrap, wrap
-
-
-
-
Field Detail
-
ANNOTATION_LINK
public static final java.lang.String ANNOTATION_LINK
Annotation link name for this type of object- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DatasetWrapper
public DatasetWrapper(java.lang.String name, java.lang.String description)
Constructor of the DatasetWrapper class- Parameters:
name
- Name of the dataset.description
- Description of the dataset.
-
DatasetWrapper
public DatasetWrapper(DatasetData dataset)
Constructor of the DatasetWrapper class- Parameters:
dataset
- Dataset to be contained.
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the DatasetData name- Specified by:
getName
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- DatasetData name.
-
setName
public void setName(java.lang.String name)
Sets the name of the dataset.- Parameters:
name
- The name of the dataset. Mustn't benull
.- Throws:
java.lang.IllegalArgumentException
- If the name isnull
.
-
asDatasetData
@Deprecated public DatasetData asDatasetData()
Deprecated.Returns the DatasetData contained. UseGenericObjectWrapper.asDataObject()
instead.- Returns:
- See above.
-
getDescription
public java.lang.String getDescription()
Gets the DatasetData description- Specified by:
getDescription
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- DatasetData description.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of the dataset.- Parameters:
description
- The description of the dataset.
-
annotationLinkType
protected java.lang.String annotationLinkType()
Returns the type of annotation link for this object- Specified by:
annotationLinkType
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- See above.
-
getProjects
public java.util.List<ProjectWrapper> getProjects(Client client) throws OMEROServerError, ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public java.util.List<ImageWrapper> getImages(Client client) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public java.util.List<ImageWrapper> getImages(Client client, java.lang.String name) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesLike
public java.util.List<ImageWrapper> getImagesLike(Client client, java.lang.String motif) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesTagged
public java.util.List<ImageWrapper> getImagesTagged(Client client, TagAnnotationWrapper tag) throws ServiceException, AccessException, OMEROServerError, java.util.concurrent.ExecutionException
Gets all images in the dataset tagged with a specified tag from OMERO.- Parameters:
client
- The client handling the connection.tag
- TagAnnotationWrapper containing the tag researched.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesTagged
public java.util.List<ImageWrapper> getImagesTagged(Client client, java.lang.Long tagId) throws ServiceException, AccessException, OMEROServerError, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesKey
@Deprecated public java.util.List<ImageWrapper> getImagesKey(Client client, java.lang.String key) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesWithKey
public java.util.List<ImageWrapper> getImagesWithKey(Client client, java.lang.String key) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesPairKeyValue
@Deprecated public java.util.List<ImageWrapper> getImagesPairKeyValue(Client client, java.lang.String key, java.lang.String value) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesWithKeyValuePair
public java.util.List<ImageWrapper> getImagesWithKeyValuePair(Client client, java.lang.String key, java.lang.String value) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addImages
public void addImages(Client client, java.util.List<? extends ImageWrapper> images) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addImage
public void addImage(Client client, ImageWrapper image) throws ServiceException, AccessException, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
removeImage
public void removeImage(Client client, ImageWrapper image) throws ServiceException, AccessException, java.util.concurrent.ExecutionException, OMEROServerError, java.lang.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.OMEROServerError
- Server error.java.lang.InterruptedException
- If block(long) does not return.
-
importImages
public boolean importImages(Client client, java.lang.String... paths) throws ServiceException, OMEROServerError, AccessException, java.io.IOException, java.util.concurrent.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.java.io.IOException
- Cannot read file.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
importImage
public java.util.List<java.lang.Long> importImage(Client client, java.lang.String path) throws ServiceException, AccessException, OMEROServerError, java.util.concurrent.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
replaceImages
public java.util.List<ImageWrapper> replaceImages(Client client, java.util.Collection<? extends ImageWrapper> oldImages, ImageWrapper newImage) throws AccessException, ServiceException, java.util.concurrent.ExecutionException, OMEROServerError, java.lang.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.java.lang.InterruptedException
- If block(long) does not return.
-
importAndReplaceImages
public java.util.List<java.lang.Long> importAndReplaceImages(Client client, java.lang.String path, GenericRepositoryObjectWrapper.ReplacePolicy policy) throws ServiceException, AccessException, OMEROServerError, java.util.concurrent.ExecutionException, java.lang.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.java.lang.InterruptedException
- If block(long) does not return.
-
importAndReplaceImages
public java.util.List<java.lang.Long> importAndReplaceImages(Client client, java.lang.String path) throws ServiceException, AccessException, OMEROServerError, java.util.concurrent.ExecutionException, java.lang.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.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.java.lang.InterruptedException
- If block(long) does not return.
-
refresh
public void refresh(Client client) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Refreshes the dataset.- Parameters:
client
- The client handling the connection.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-