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.Implements function using the DatasetData contained
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fr.igred.omero.GenericObjectWrapper
GenericObjectWrapper.SortById<U extends GenericObjectWrapper<?>>
-
-
Field Summary
Fields Modifier and Type Field Description static String
ANNOTATION_LINK
-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Constructor Description DatasetWrapper(String name, String description)
Constructor of the DatasetWrapper classDatasetWrapper(DatasetData dataset)
Constructor of the DatasetWrapper class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addImage(Client client, ImageWrapper image)
Adds a single image to the dataset in OMEROvoid
addImages(Client client, List<ImageWrapper> images)
Adds a list of image to the dataset in OMERO.protected String
annotationLinkType()
Returns the type of annotation link for this objectDatasetData
asDatasetData()
String
getDescription()
Gets the DatasetData descriptionList<ImageWrapper>
getImages(Client client)
Gets all images in the dataset available from OMERO.List<ImageWrapper>
getImages(Client client, String name)
Gets all images in the dataset with a certain from OMERO.List<ImageWrapper>
getImagesKey(Client client, String key)
Gets all images in the dataset with a certain keyList<ImageWrapper>
getImagesLike(Client client, String motif)
Gets all images in the dataset with a certain motif in their name from OMERO.List<ImageWrapper>
getImagesPairKeyValue(Client client, String key, String value)
Gets all images in the dataset with a certain key value pair from OMEROList<ImageWrapper>
getImagesTagged(Client client, TagAnnotationWrapper tag)
Gets all images in the dataset tagged with a specified tag from OMERO.List<ImageWrapper>
getImagesTagged(Client client, Long tagId)
Gets all images in the dataset tagged with a specified tag from OMERO.String
getName()
Gets the DatasetData nameList<Long>
importImage(Client client, String path)
Imports one image candidate 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
refresh(Client client)
Refreshes the wrapped dataset.void
removeImage(Client client, ImageWrapper image)
Removes an image from the dataset in OMERO.void
setDescription(String description)
Sets the description of the dataset.void
setName(String name)
Sets the name of the dataset.-
Methods inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
addFile, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTag, addTags, addTags, getFileAnnotations, getKeyValuePairs, getTable, getTables, getTags, getValue, removeLink, unlink
-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString
-
-
-
-
Field Detail
-
ANNOTATION_LINK
public static final String ANNOTATION_LINK
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DatasetWrapper
public DatasetWrapper(String name, 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 String getName()
Gets the DatasetData name- Specified by:
getName
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- DatasetData name.
-
setName
public void setName(String name)
Sets the name of the dataset.- Parameters:
name
- The name of the dataset. Mustn't benull
.- Throws:
IllegalArgumentException
- If the name isnull
.
-
getDescription
public String getDescription()
Gets the DatasetData description- Specified by:
getDescription
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- DatasetData description.
-
setDescription
public void setDescription(String description)
Sets the description of the dataset.- Parameters:
description
- The description of the dataset.
-
asDatasetData
public DatasetData asDatasetData()
- Returns:
- the DatasetData contained.
-
annotationLinkType
protected String annotationLinkType()
Returns the type of annotation link for this object- Specified by:
annotationLinkType
in classGenericRepositoryObjectWrapper<DatasetData>
- Returns:
- See above.
-
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:
- ImageWrapper list.
- 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 from OMERO.- Parameters:
client
- The client handling the connection.name
- Name searched.- Returns:
- ImageWrapper list.
- 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:
- ImageWrapper list.
- 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
- TagAnnotationWrapper containing the tag researched.- Returns:
- ImageWrapper list.
- 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:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesKey
public List<ImageWrapper> getImagesKey(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:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesPairKeyValue
public List<ImageWrapper> getImagesPairKeyValue(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:
- ImageWrapper list.
- 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<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
- If the thread was interrupted.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 on your 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 candidate in the paths to the dataset in OMERO.- Parameters:
client
- The client handling the connection.path
- Path to the image on your 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.
-
refresh
public void refresh(Client client) throws ServiceException, AccessException, ExecutionException
Refreshes the wrapped dataset.- Parameters:
client
- The client handling the connection.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-