Package fr.igred.omero.repository
Class ImageWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.repository.GenericRepositoryObjectWrapper<ImageData>
-
- fr.igred.omero.repository.ImageWrapper
-
public class ImageWrapper extends GenericRepositoryObjectWrapper<ImageData>
Class containing an ImageData.Implements function using the ImageData contained
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fr.igred.omero.GenericObjectWrapper
GenericObjectWrapper.SortById<U extends GenericObjectWrapper<?>>
-
-
Field Summary
-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
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 ImageData
asImageData()
List<File>
download(Client client, String path)
Downloads the original files from the server.Timestamp
getAcquisitionDate()
Gets the ImageData acquisition dateColor
getChannelColor(Client client, int index)
Gets the current color of the channelColor
getChannelImportedColor(Client client, int index)
Gets the original color of the channelString
getChannelName(Client client, int index)
Gets the name of the channelList<ChannelWrapper>
getChannels(Client client)
Gets the image channelsString
getDescription()
Gets the ImageData descriptionFolderWrapper
getFolder(Client client, Long folderId)
Gets the folder with the specified id on OMERO.List<FolderWrapper>
getFolders(Client client)
Gets the list of Folder linked to the image Associate the folder to the imageString
getName()
Gets the ImageData namePixelsWrapper
getPixels()
Gets the PixelsWrapper of the imageList<ROIWrapper>
getROIs(Client client)
Gets all ROIs linked to the image in OMEROBufferedImage
getThumbnail(Client client, int size)
Retrieves the image thumbnail of the specified size.void
saveROI(Client client, ROIWrapper roi)
Links a ROI to the image in OMEROvoid
setDescription(String description)
Sets the description of the image.void
setName(String name)
Sets the name of the image.ImagePlus
toImagePlus(Client client)
Generates the ImagePlus from the ij library corresponding to the image from OMERO WARNING : you need to include the ij library to use this functionImagePlus
toImagePlus(Client client, int[] xBound, int[] yBound, int[] cBound, int[] zBound, int[] tBound)
Gets the imagePlus generated from the image from OMERO corresponding to the boundImagePlus
toImagePlus(Client client, ROIWrapper roi)
Gets the imagePlus from the image generated from the ROI.-
Methods inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
addFile, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTag, addTags, addTags, getKeyValuePairs, getTable, getTables, getTags, getValue
-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString
-
-
-
-
Constructor Detail
-
ImageWrapper
public ImageWrapper(ImageData image)
Constructor of the class ImageWrapper- Parameters:
image
- The image contained in the ImageWrapper.
-
-
Method Detail
-
getName
public String getName()
Gets the ImageData name- Returns:
- name.
-
setName
public void setName(String name)
Sets the name of the image.- Parameters:
name
- The name of the image. Mustn't benull
.- Throws:
IllegalArgumentException
- If the name isnull
.
-
getDescription
public String getDescription()
Gets the ImageData description- Returns:
- description.
-
setDescription
public void setDescription(String description)
Sets the description of the image.- Parameters:
description
- The description of the image.
-
getAcquisitionDate
public Timestamp getAcquisitionDate()
Gets the ImageData acquisition date- Returns:
- acquisition date.
-
asImageData
public ImageData asImageData()
- Returns:
- ImageData contained.
-
saveROI
public void saveROI(Client client, ROIWrapper roi) throws ServiceException, AccessException, ExecutionException
Links a ROI to the image in OMERODO NOT USE IT IF A SHAPE WAS DELETED !!!
- Parameters:
client
- The client handling the connection.roi
- ROI to be added.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getROIs
public List<ROIWrapper> getROIs(Client client) throws ServiceException, AccessException, ExecutionException
Gets all ROIs linked to the image in OMERO- Parameters:
client
- The client handling the connection.- Returns:
- List of ROIs linked to the image.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getFolders
public List<FolderWrapper> getFolders(Client client) throws ServiceException, AccessException, ExecutionException
Gets the list of Folder linked to the image Associate the folder to the image- Parameters:
client
- The client handling the connection.- Returns:
- List of FolderWrapper containing the folder.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getFolder
public FolderWrapper getFolder(Client client, Long folderId) throws ServiceException, OMEROServerError
Gets the folder with the specified id on OMERO.- Parameters:
client
- The client handling the connection.folderId
- Id of the folder.- Returns:
- The folder if it exist.
- Throws:
ServiceException
- Cannot connect to OMERO.OMEROServerError
- Server error.
-
getPixels
public PixelsWrapper getPixels()
Gets the PixelsWrapper of the image- Returns:
- Contains the PixelsData associated with the image.
-
toImagePlus
public ImagePlus toImagePlus(Client client) throws ServiceException, AccessException, ExecutionException
Generates the ImagePlus from the ij library corresponding to the image from OMERO WARNING : you need to include the ij library to use this function- Parameters:
client
- The client handling the connection.- Returns:
- ImagePlus generated from the current image.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- If an error occurs while retrieving the plane data from the pixels source.ExecutionException
- A Facility can't be retrieved or instantiated.
-
toImagePlus
public ImagePlus toImagePlus(Client client, int[] xBound, int[] yBound, int[] cBound, int[] zBound, int[] tBound) throws ServiceException, AccessException, ExecutionException
Gets the imagePlus generated from the image from OMERO corresponding to the bound- Parameters:
client
- The client handling the connection.xBound
- Array containing the X bound from which the pixels should be retrieved.yBound
- Array containing the Y bound from which the pixels should be retrieved.cBound
- Array containing the C bound from which the pixels should be retrieved.zBound
- Array containing the Z bound from which the pixels should be retrieved.tBound
- Array containing the T bound 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.ExecutionException
- A Facility can't be retrieved or instantiated.
-
toImagePlus
public ImagePlus toImagePlus(Client client, ROIWrapper roi) throws ServiceException, AccessException, ExecutionException
Gets the imagePlus from the image generated from the ROI.- Parameters:
client
- The client handling the connection.roi
- The ROI.- 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.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getChannels
public List<ChannelWrapper> getChannels(Client client) throws ServiceException, AccessException, ExecutionException
Gets the image channels- Parameters:
client
- The client handling the connection.- Returns:
- the channels.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getChannelName
public String getChannelName(Client client, int index) throws ServiceException, AccessException, ExecutionException
Gets the name of the channel- Parameters:
client
- The client handling the connection.index
- Channel number.- Returns:
- name of the channel.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getChannelImportedColor
public Color getChannelImportedColor(Client client, int index) throws ServiceException, AccessException, ExecutionException
Gets the original color of the channel- Parameters:
client
- The client handling the connection.index
- Channel number.- Returns:
- Original color of the channel.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getChannelColor
public Color getChannelColor(Client client, int index) throws ServiceException, AccessException, ExecutionException
Gets the current color of the channel- Parameters:
client
- The client handling the connection.index
- Channel number.- Returns:
- Color of the channel.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getThumbnail
public BufferedImage getThumbnail(Client client, int size) throws ServiceException, OMEROServerError, IOException
Retrieves the image thumbnail of the specified size.If the image is not square, the size will be the longest side.
- Parameters:
client
- The client handling the connection.size
- The thumbnail size.- Returns:
- The thumbnail as a
BufferedImage
. - Throws:
ServiceException
- Cannot connect to OMERO.OMEROServerError
- Server error.IOException
- Cannot read thumbnail from store.
-
download
public List<File> download(Client client, String path) throws OMEROServerError, ServiceException, AccessException
Downloads the original files from the server.- Parameters:
client
- The client handling the connection.path
- Path to the file.- Returns:
- See above.
- Throws:
OMEROServerError
- Server error.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.
-
-