Class ImageWrapper

    • 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

      • setName

        public void setName​(java.lang.String name)
        Sets the name of the image.
        Parameters:
        name - The name of the image. Mustn't be null.
        Throws:
        java.lang.IllegalArgumentException - If the name is null.
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets the description of the image.
        Parameters:
        description - The description of the image.
      • getAcquisitionDate

        public java.sql.Timestamp getAcquisitionDate()
        Gets the ImageData acquisition date
        Returns:
        acquisition date.
      • getWells

        public java.util.List<WellWrapper> getWells​(Client client)
                                             throws AccessException,
                                                    ServiceException,
                                                    java.util.concurrent.ExecutionException
        Retrieves the wells containing this image.
        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.
      • getPlateAcquisitions

        public java.util.List<PlateAcquisitionWrapper> getPlateAcquisitions​(Client client)
                                                                     throws AccessException,
                                                                            ServiceException,
                                                                            java.util.concurrent.ExecutionException
        Returns the plate acquisitions linked to this image.
        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.
      • getPlates

        public java.util.List<PlateWrapper> getPlates​(Client client)
                                               throws AccessException,
                                                      ServiceException,
                                                      java.util.concurrent.ExecutionException
        Retrieves the plates containing this image.
        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.
      • isOrphaned

        public boolean isOrphaned​(Client client)
                           throws ServiceException,
                                  OMEROServerError
        Checks if image is orphaned (not in a WellSample nor linked to a dataset).
        Parameters:
        client - The client handling the connection.
        Returns:
        true if the image is orphaned, false otherwise.
        Throws:
        ServiceException - Cannot connect to OMERO.
        OMEROServerError - Server error.
      • saveROIs

        public java.util.List<ROIWrapper> saveROIs​(Client client,
                                                   java.util.Collection<? extends ROIWrapper> rois)
                                            throws ServiceException,
                                                   AccessException,
                                                   java.util.concurrent.ExecutionException
        Links ROIs to the image in OMERO.

        DO NOT USE IT IF A SHAPE WAS DELETED !!!

        Parameters:
        client - The client handling the connection.
        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.
      • saveROIs

        public java.util.List<ROIWrapper> saveROIs​(Client client,
                                                   ROIWrapper... rois)
                                            throws ServiceException,
                                                   AccessException,
                                                   java.util.concurrent.ExecutionException
        Links ROIs to the image in OMERO.

        DO NOT USE IT IF A SHAPE WAS DELETED !!!

        Parameters:
        client - 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.
      • saveROI

        @Deprecated
        public void saveROI​(Client client,
                            ROIWrapper roi)
                     throws ServiceException,
                            AccessException,
                            java.util.concurrent.ExecutionException
        Deprecated.
        Links a ROI to the image in OMERO

        DO 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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getROIs

        public java.util.List<ROIWrapper> getROIs​(Client client)
                                           throws ServiceException,
                                                  AccessException,
                                                  java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getROIFolders

        public java.util.List<FolderWrapper> getROIFolders​(Client client)
                                                    throws ServiceException,
                                                           AccessException,
                                                           java.util.concurrent.ExecutionException
        Gets the list of folders linked to the ROIs in this image.
        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.
      • getFolder

        @Deprecated
        public FolderWrapper getFolder​(Client client,
                                       java.lang.Long folderId)
                                throws ServiceException,
                                       OMEROServerError
        Deprecated.
        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 exists.
        Throws:
        ServiceException - Cannot connect to OMERO.
        OMEROServerError - Server error.
        java.util.NoSuchElementException - Folder does not exist.
      • getPixels

        public PixelsWrapper getPixels()
        Gets the Pixels for this image.
        Returns:
        See above.
      • toImagePlus

        public ImagePlus toImagePlus​(Client client)
                              throws ServiceException,
                                     AccessException,
                                     java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • 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.
        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.
      • toImagePlus

        public ImagePlus toImagePlus​(Client client,
                                     ROIWrapper roi)
                              throws ServiceException,
                                     AccessException,
                                     java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getChannels

        public java.util.List<ChannelWrapper> getChannels​(Client client)
                                                   throws ServiceException,
                                                          AccessException,
                                                          java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getChannelName

        public java.lang.String getChannelName​(Client client,
                                               int index)
                                        throws ServiceException,
                                               AccessException,
                                               java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getChannelImportedColor

        public java.awt.Color getChannelImportedColor​(Client client,
                                                      int index)
                                               throws ServiceException,
                                                      AccessException,
                                                      java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getChannelColor

        public java.awt.Color getChannelColor​(Client client,
                                              int index)
                                       throws ServiceException,
                                              AccessException,
                                              java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getThumbnail

        public java.awt.image.BufferedImage getThumbnail​(Client client,
                                                         int size)
                                                  throws ServiceException,
                                                         OMEROServerError,
                                                         java.io.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.
        java.io.IOException - Cannot read thumbnail from store.