omerojava.util
Class GatewayUtils

java.lang.Object
  extended by omerojava.util.GatewayUtils

public class GatewayUtils
extends Object

Since:
3.0-Beta4
Version:
3.0 (Internal version: $Revision: $Date: $)
Author:
Jean-Marie Burel      j.burel@dundee.ac.uk, Donald MacDonald      donald@lifesci.dundee.ac.uk

Constructor Summary
GatewayUtils()
           
 
Method Summary
static byte[] convertClientToServer(omero.model.Pixels pixels, double[][] data)
          convert the client data pixels to server byte array, also sets the data pixel size to the size of the pixels in the pixels Id param.
static int getBytesPerPixels(String pixelsType)
          Returns the number of bytes per pixel depending on the pixel type.
static List<omero.model.Dataset> getDatasetsFromProject(omero.model.Project project)
          Get the datasets from the project, the project must have the datasets loaded already.
static List<omero.model.Image> getImagesFromDataset(omero.model.Dataset dataset)
          Get the images from the Dataset, the Dataset must be loaded in the project beforehand.
static List<omero.model.Image> getImagesFromProject(omero.model.Project project)
          Get the images from the Project, the images must be loaded in the project beforehand.
static List<omero.model.Pixels> getPixelsFromDataset(omero.model.Dataset dataset)
          Get the pixels from the Dataset, the pixels must be loaded in the Dataset beforehand.
static List<omero.model.Pixels> getPixelsFromImageList(List<omero.model.Image> images)
          Get the pixels from the list of images, these images must have the pixels loaded beforehand.
static List<omero.model.Pixels> getPixelsFromProject(omero.model.Project project)
          Get the pixels from the Project, the pixels must be loaded in the project beforehand.
static Map<Long,omero.model.Pixels> getPixelsImageMap(List<omero.model.Image> images)
          create a map of pixelsId to pixels from the images in the image list.
static Plane1D getPlane1D(omero.model.Pixels pixels, byte[] rawPlane)
          Extracts a 1D plane from the pixels set this object is working for.
static Plane2D getPlane2D(omero.model.Pixels pixels, byte[] rawPlane)
          Extracts a 2D plane from the pixels set this object is working for.
static BufferedImage toBufferedImage(omero.model.Pixels pixels, int[] rawImage)
          Convert the raw integer(4byte colour data) to a bufferedImage, for pixels object pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GatewayUtils

public GatewayUtils()
Method Detail

toBufferedImage

public static BufferedImage toBufferedImage(omero.model.Pixels pixels,
                                            int[] rawImage)
Convert the raw integer(4byte colour data) to a bufferedImage, for pixels object pixels.

Parameters:
pixels - see above.
rawImage - see above.
Returns:

getPlane2D

public static Plane2D getPlane2D(omero.model.Pixels pixels,
                                 byte[] rawPlane)
                          throws omero.ServerError
Extracts a 2D plane from the pixels set this object is working for.

Parameters:
pixels - The pixels object from which the rawPlane was retrieved.
rawPlane - The raw bytes of the plane (z,c,t)
Returns:
A plane 2D object that encapsulates the actual plane pixels.
Throws:
DSAccessException
DSOutOfServiceException
omero.ServerError

getPlane1D

public static Plane1D getPlane1D(omero.model.Pixels pixels,
                                 byte[] rawPlane)
                          throws omero.ServerError
Extracts a 1D plane from the pixels set this object is working for.

Parameters:
pixels - The pixels object from which the rawPlane was retrieved.
rawPlane - The raw bytes of the plane (z,c,t)
Returns:
A plane 1D object that encapsulates the actual plane pixels.
Throws:
DSAccessException
DSOutOfServiceException
omero.ServerError

getDatasetsFromProject

public static List<omero.model.Dataset> getDatasetsFromProject(omero.model.Project project)
                                                        throws omero.ServerError
Get the datasets from the project, the project must have the datasets loaded already. This method makes no calls to the server.

Parameters:
project -
Returns:
see above.
Throws:
omero.ServerError

getPixelsFromProject

public static List<omero.model.Pixels> getPixelsFromProject(omero.model.Project project)
                                                     throws omero.ServerError
Get the pixels from the Project, the pixels must be loaded in the project beforehand. This method makes no calls to the server.

Parameters:
project - see above.
Returns:
see above.
Throws:
omero.ServerError

getPixelsFromImageList

public static List<omero.model.Pixels> getPixelsFromImageList(List<omero.model.Image> images)
Get the pixels from the list of images, these images must have the pixels loaded beforehand. This method makes no calls to the server.

Parameters:
images - see above.
Returns:
see above.

getPixelsImageMap

public static Map<Long,omero.model.Pixels> getPixelsImageMap(List<omero.model.Image> images)
create a map of pixelsId to pixels from the images in the image list. This method makes no calls to the server and relies on the images having the pixels loaded beforehand.

Parameters:
images - see above.
Returns:
see above.

getPixelsFromDataset

public static List<omero.model.Pixels> getPixelsFromDataset(omero.model.Dataset dataset)
                                                     throws omero.ServerError
Get the pixels from the Dataset, the pixels must be loaded in the Dataset beforehand. This method makes no calls to the server.

Parameters:
dataset - see above.
Returns:
see above.
Throws:
omero.ServerError

getImagesFromDataset

public static List<omero.model.Image> getImagesFromDataset(omero.model.Dataset dataset)
                                                    throws omero.ServerError
Get the images from the Dataset, the Dataset must be loaded in the project beforehand. This method makes no calls to the server.

Parameters:
dataset - see above.
Returns:
see above.
Throws:
omero.ServerError

getImagesFromProject

public static List<omero.model.Image> getImagesFromProject(omero.model.Project project)
                                                    throws omero.ServerError
Get the images from the Project, the images must be loaded in the project beforehand. This method makes no calls to the server.

Parameters:
project - see above.
Returns:
see above.
Throws:
omero.ServerError

getBytesPerPixels

public static int getBytesPerPixels(String pixelsType)
Returns the number of bytes per pixel depending on the pixel type.

Parameters:
pixelsType - The pixels Type.
Returns:
See above.

convertClientToServer

public static byte[] convertClientToServer(omero.model.Pixels pixels,
                                           double[][] data)
convert the client data pixels to server byte array, also sets the data pixel size to the size of the pixels in the pixels Id param.

Parameters:
pixels - the pixels in the server.
data - the data on the client.
Returns:
the bytes for server.


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.