Class RawDataFacility

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class RawDataFacility
    extends Facility
    implements java.lang.AutoCloseable
    A Facility for accessing raw data
    Since:
    5.1
    • Method Detail

      • getHistogram

        public java.util.Map<java.lang.Integer,​int[]> getHistogram​(SecurityContext ctx,
                                                                         PixelsData pixels,
                                                                         int[] channels,
                                                                         int z,
                                                                         int t)
                                                                  throws DSOutOfServiceException,
                                                                         DSAccessException
        Get the histogram data for the given image, using default 256 bins and the channels global min/max for the histogram range. Currently only non-tiled images are supported.
        Parameters:
        ctx - The SecurityContext
        pixels - The PixelsData object
        channels - The channel indices
        z - The z plane index (optional; default: 0)
        t - The t plane index (optional; default: 0)
        Returns:
        A Map of histogram data, where the key is the channel index
        Throws:
        DSOutOfServiceException - If the connection is broken, or not logged in
        DSAccessException - If an error occurred while trying to retrieve data from OMERO service.
      • getHistogram

        public java.util.Map<java.lang.Integer,​int[]> getHistogram​(SecurityContext ctx,
                                                                         PixelsData pixels,
                                                                         int[] channels,
                                                                         int binCount,
                                                                         boolean globalRange,
                                                                         omero.romio.PlaneDef plane)
                                                                  throws DSOutOfServiceException,
                                                                         DSAccessException
        Get the histogram data for the given image. Currently only non-tiled images are supported.
        Parameters:
        ctx - The SecurityContext
        pixels - The PixelsData object
        channels - The channel indices
        binCount - The number of bins (optional, default: 256)
        globalRange - Use the global minimum/maximum to determine the histogram range, otherwise use plane minimum/maximum value
        plane - The plane to specify z/t and/or a certain region (optional, default: whole region of the first z/t plane)
        Returns:
        A Map of histogram data, where the key is the channel index
        Throws:
        DSOutOfServiceException - If the connection is broken, or not logged in
        DSAccessException - If an error occurred while trying to retrieve data from OMERO service.
      • getPlane

        public Plane2D getPlane​(SecurityContext ctx,
                                PixelsData pixels,
                                int z,
                                int t,
                                int c)
                         throws DSOutOfServiceException,
                                DSAccessException
        Extracts a 2D plane from the pixels set. Connection to the PixelsStore will be closed automatically.
        Parameters:
        ctx - The security context.
        pixels - The PixelsData object to fetch the data from.
        z - The z-section at which data is to be fetched.
        t - The timepoint at which data is to be fetched.
        c - The channel at which data is to be fetched.
        Returns:
        A plane 2D object that encapsulates the actual plane pixels.
        Throws:
        DSOutOfServiceException - If the connection is broken, or not logged in
        DSAccessException - If an error occurred while trying to retrieve data from OMERO service.
      • getTile

        public Plane2D getTile​(SecurityContext ctx,
                               PixelsData pixels,
                               int z,
                               int t,
                               int c,
                               int x,
                               int y,
                               int w,
                               int h)
                        throws DataSourceException
        Extracts a 2D tile from the pixels set
        Parameters:
        ctx - The security context.
        pixels - The PixelsData object to fetch the data from.
        z - The z-section at which data is to be fetched.
        t - The timepoint at which data is to be fetched.
        c - The channel at which data is to be fetched.
        x - The x coordinate
        y - The y coordinate
        w - The width of the tile
        h - The height of the tile
        Returns:
        A plane 2D object that encapsulates the actual tile pixels.
        Throws:
        DataSourceException - If an error occurs while retrieving the plane data from the pixels source.
      • getTile

        public Plane2D getTile​(SecurityContext ctx,
                               PixelsData pixels,
                               int z,
                               int t,
                               int c,
                               int x,
                               int y,
                               int w,
                               int h,
                               int resolutionLevel)
                        throws DataSourceException
        Extracts a 2D tile from the pixels set
        Parameters:
        ctx - The security context.
        pixels - The PixelsData object to fetch the data from.
        z - The z-section at which data is to be fetched.
        t - The timepoint at which data is to be fetched.
        c - The channel at which data is to be fetched.
        x - The x coordinate
        y - The y coordinate
        w - The width of the tile
        h - The height of the tile
        resolutionLevel - A specific resolution level (optional), see also getResolutionDescriptions()
        Returns:
        A plane 2D object that encapsulates the actual tile pixels.
        Throws:
        DataSourceException - If an error occurs while retrieving the plane data from the pixels source.
      • getResolutionDescriptions

        public java.util.List<omero.api.ResolutionDescription> getResolutionDescriptions​(SecurityContext ctx,
                                                                                         PixelsData pixels)
                                                                                  throws DataSourceException
        Get the available resolution descriptions
        Parameters:
        ctx - The SecurityContext
        pixels - The PixelsData object
        Returns:
        See above
        Throws:
        DataSourceException - If an error occurs while retrieving the data
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable