Package fr.igred.omero.core
Class ImageWrapper
- java.lang.Object
-
- fr.igred.omero.ObjectWrapper<T>
-
- fr.igred.omero.AnnotatableWrapper<T>
-
- fr.igred.omero.RepositoryObjectWrapper<ImageData>
-
- fr.igred.omero.core.ImageWrapper
-
- All Implemented Interfaces:
Annotatable
,ContainerLinked
,Image
,HCSLinked
,ImageLinked
,RemoteObject
,RepositoryObject
public class ImageWrapper extends RepositoryObjectWrapper<ImageData> implements Image
Class containing an ImageData.Wraps function calls to the ImageData 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 ImageWrapper(ImageData image)
Constructor of the class ImageWrapper
-
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.util.List<java.io.File>
download(ConnectionHandler client, java.lang.String path)
Downloads the original files from the server.java.sql.Timestamp
getAcquisitionDate()
Gets the ImageData acquisition date.java.util.List<Channel>
getChannels(Browser browser)
Gets the image channels.java.lang.String
getDescription()
Gets the image description.java.lang.String
getName()
Gets the image name.Pixels
getPixels()
Gets the Pixels for this image.java.util.List<Folder>
getROIFolders(DataManager dm)
Gets the list of folders linked to the ROIs in this image.java.util.List<ROI>
getROIs(DataManager dm)
Gets all ROIs linked to the image in OMEROjava.awt.image.BufferedImage
getThumbnail(ConnectionHandler client, int size)
Retrieves the image thumbnail of the specified size.java.util.List<ROI>
saveROIs(DataManager dm, java.util.Collection<? extends ROI> rois)
Links ROIs to the image in OMERO.void
setDescription(java.lang.String description)
Sets the description of the image.void
setName(java.lang.String name)
Sets the name of the image.ImagePlus
toImagePlus(Client client, int[] xBounds, int[] yBounds, int[] cBounds, int[] zBounds, int[] tBounds)
Gets the imagePlus generated from the image from OMERO corresponding to the bound.-
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.core.Image
asDataObject, getChannelColor, getChannelImportedColor, getChannelName, getDatasets, getFilesetImages, getFolders, getImages, getPlateAcquisitions, getPlates, getProjects, getScreens, getWells, isOrphaned, saveROIs, toImagePlus, toImagePlus
-
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
-
ImageWrapper
public ImageWrapper(ImageData image)
Constructor of the class ImageWrapper- Parameters:
image
- The image to wrap in the ImageWrapper.
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the image name.- Specified by:
getName
in interfaceRepositoryObject
- Returns:
- See above.
-
setName
public void setName(java.lang.String name)
Sets the name of the image.
-
getDescription
public java.lang.String getDescription()
Gets the image description.- Specified by:
getDescription
in interfaceRepositoryObject
- Returns:
- See above.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of the image.- Specified by:
setDescription
in interfaceImage
- Parameters:
description
- The description of the image.
-
getAcquisitionDate
public java.sql.Timestamp getAcquisitionDate()
Gets the ImageData acquisition date.- Specified by:
getAcquisitionDate
in interfaceImage
- Returns:
- acquisition date.
-
annotationLinkType
protected java.lang.String annotationLinkType()
Returns the type of annotation link for this object.- Specified by:
annotationLinkType
in classAnnotatableWrapper<ImageData>
- Returns:
- See above.
-
saveROIs
public java.util.List<ROI> saveROIs(DataManager dm, java.util.Collection<? extends ROI> rois) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Links ROIs to the image in OMERO.DO NOT USE IT IF A SHAPE WAS DELETED !!!
- Specified by:
saveROIs
in interfaceImage
- Parameters:
dm
- The data manager.rois
- ROIs to be added.- Returns:
- The updated list of ROIs.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getROIs
public java.util.List<ROI> getROIs(DataManager dm) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Gets all ROIs linked to the image in OMERO- Specified by:
getROIs
in interfaceImage
- Parameters:
dm
- The data manager.- Returns:
- List of ROIs linked to the image.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getROIFolders
public java.util.List<Folder> getROIFolders(DataManager dm) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Gets the list of folders linked to the ROIs in this image.- Specified by:
getROIFolders
in interfaceImage
- Parameters:
dm
- The data manager.- 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.
-
getPixels
public Pixels getPixels()
Gets the Pixels for this image.
-
toImagePlus
public ImagePlus toImagePlus(Client client, int[] xBounds, int[] yBounds, int[] cBounds, int[] zBounds, int[] tBounds) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Gets the imagePlus generated from the image from OMERO corresponding to the bound.- Specified by:
toImagePlus
in interfaceImage
- Parameters:
client
- The client handling the connection.xBounds
- Array containing the X bounds from which the pixels should be retrieved.yBounds
- Array containing the Y bounds from which the pixels should be retrieved.cBounds
- Array containing the C bounds from which the pixels should be retrieved.zBounds
- Array containing the Z bounds from which the pixels should be retrieved.tBounds
- Array containing the T bounds from which the pixels should be retrieved.- Returns:
- an ImagePlus from the ij library.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- If an error occurs while retrieving the plane data from the pixels source.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getChannels
public java.util.List<Channel> getChannels(Browser browser) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Gets the image channels.- Specified by:
getChannels
in interfaceImage
- Parameters:
browser
- The data browser.- Returns:
- the channels.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getThumbnail
public java.awt.image.BufferedImage getThumbnail(ConnectionHandler client, int size) throws ServiceException, ServerException, java.io.IOException
Retrieves the image thumbnail of the specified size.If the image is not square, the size will be the longest side.
- Specified by:
getThumbnail
in interfaceImage
- Parameters:
client
- The client handling the connection.size
- The thumbnail size.- Returns:
- The thumbnail as a
BufferedImage
. - Throws:
ServiceException
- Cannot connect to OMERO.ServerException
- Server error.java.io.IOException
- Cannot read thumbnail from store.
-
download
public java.util.List<java.io.File> download(ConnectionHandler client, java.lang.String path) throws ServerException, ServiceException, AccessException, java.util.concurrent.ExecutionException
Downloads the original files from the server.- Specified by:
download
in interfaceImage
- Parameters:
client
- The client handling the connection.path
- Path to the file.- Returns:
- See above.
- Throws:
ServerException
- Server error.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.java.util.concurrent.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-