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

      • getName

        public java.lang.String getName()
        Gets the image name.
        Specified by:
        getName in interface RepositoryObject
        Returns:
        See above.
      • setName

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

        public java.lang.String getDescription()
        Gets the image description.
        Specified by:
        getDescription in interface RepositoryObject
        Returns:
        See above.
      • setDescription

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

        public java.sql.Timestamp getAcquisitionDate()
        Gets the ImageData acquisition date.
        Specified by:
        getAcquisitionDate in interface Image
        Returns:
        acquisition date.
      • 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 interface Image
        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 interface Image
        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 interface Image
        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.
        Specified by:
        getPixels in interface Image
        Returns:
        See above.
      • 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 interface Image
        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 interface Image
        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 interface Image
        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 interface Image
        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.