Package fr.igred.omero.containers
Class DatasetWrapper
- java.lang.Object
-
- fr.igred.omero.ObjectWrapper<T>
-
- fr.igred.omero.AnnotatableWrapper<T>
-
- fr.igred.omero.RepositoryObjectWrapper<DatasetData>
-
- fr.igred.omero.containers.DatasetWrapper
-
- All Implemented Interfaces:
Annotatable
,ContainerLinked
,Dataset
,ImageLinked
,RemoteObject
,RepositoryObject
public class DatasetWrapper extends RepositoryObjectWrapper<DatasetData> implements Dataset
Class containing a DatasetData object.Wraps function calls to the DatasetData contained.
-
-
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.ObjectWrapper
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 Modifier and Type Method Description protected java.lang.String
annotationLinkType()
Returns the type of annotation link for this object.java.lang.String
getDescription()
Gets the DatasetData descriptionjava.util.List<Image>
getImages()
Gets all the images in the dataset (if it was properly loaded from OMERO).java.util.List<Image>
getImages(Browser browser)
Gets all images in the dataset available from OMERO.java.lang.String
getName()
Gets the DatasetData namejava.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
reload(Browser browser)
Reloads the dataset from OMERO.void
removeImage(Client client, Image image)
Removes an image from the dataset in OMERO.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.RepositoryObjectWrapper
importImage, importImages
-
Methods inherited from class fr.igred.omero.AnnotatableWrapper
addAndReplaceFile, addAndReplaceTable, addKeyValuePair, addTag, addTag, getAnnotations, getFileAnnotations, getMapAnnotations, getMyRating, getTable, getTags, rate, removeLink, unlink
-
Methods inherited from class fr.igred.omero.ObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface fr.igred.omero.Annotatable
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addKeyValuePair, addTable, addTag, addTag, addTags, copyAnnotationLinks, getAnnotationData, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getTable, getTables, getTags, getValues, isLinked, link, link, linkIfNotLinked, rate, unlink
-
Methods inherited from interface fr.igred.omero.containers.Dataset
addImage, addImages, asDataObject, getDatasets, getImages, getImagesLike, getImagesTagged, getImagesTagged, getImagesWithKey, getImagesWithKeyValuePair, getProjects, importAndReplaceImages, importAndReplaceImages, replaceImages
-
Methods inherited from interface fr.igred.omero.RemoteObject
canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, getCreated, getGroupId, getId, getOwner, saveAndUpdate
-
-
-
-
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 interfaceRepositoryObject
- Returns:
- DatasetData name.
-
setName
public void setName(java.lang.String name)
Sets the name of the dataset.
-
getDescription
public java.lang.String getDescription()
Gets the DatasetData description- Specified by:
getDescription
in interfaceRepositoryObject
- Returns:
- DatasetData description.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of the dataset.- Specified by:
setDescription
in interfaceDataset
- 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 classAnnotatableWrapper<DatasetData>
- Returns:
- See above.
-
getImages
public java.util.List<Image> getImages()
Gets all the images in the dataset (if it was properly loaded from OMERO).
-
getImages
public java.util.List<Image> getImages(Browser browser) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Gets all images in the dataset available from OMERO.- Specified by:
getImages
in interfaceDataset
- Specified by:
getImages
in interfaceImageLinked
- Parameters:
browser
- The data browser.- 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.
-
removeImage
public void removeImage(Client client, Image image) throws ServiceException, AccessException, java.util.concurrent.ExecutionException, ServerException, java.lang.InterruptedException
Removes an image from the dataset in OMERO.- Specified by:
removeImage
in interfaceDataset
- 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.ServerException
- Server error.java.lang.InterruptedException
- If block(long) does not return.
-
importImages
public boolean importImages(Client client, java.lang.String... paths) throws ServiceException, ServerException, AccessException, java.io.IOException, java.util.concurrent.ExecutionException
Imports all images candidates in the paths to the dataset in OMERO.- Specified by:
importImages
in interfaceDataset
- 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.ServerException
- 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, ServerException, java.util.concurrent.ExecutionException
Imports one image file to the dataset in OMERO.- Specified by:
importImage
in interfaceDataset
- 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.ServerException
- Server error.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
reload
public void reload(Browser browser) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Reloads the dataset from OMERO.- Specified by:
reload
in interfaceDataset
- Parameters:
browser
- The data browser.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-