omerojava.util
Class DataSink

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

public class DataSink
extends Object

Encapsulates access to the image raw data. Contains the logic to interpret a linear byte array as a 5D array. Knows how to extract a 2D-plane from the 5D array, but delegates to the specified 2D-Plane the retrieval of pixel values.

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

Method Summary
 Plane2D getPlane(int z, int t, int w)
          Extracts a 2D plane from the pixels set this object is working for.
 boolean isSame(long pixelsID)
          Returns true if a data source has already been created for the specified pixels set, false otherwise.
static DataSink makeNew(omero.model.Pixels source, ImageService service)
          Factory method to create a new DataSink to handle access to the metadata associated with the specified pixels set.
static double[][] mapServerToClient(byte[] data, int x, int y, String pixelType)
           
static double[][] mapServerToClient(byte[] data, int x, int y, String pixelType, boolean transpose)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeNew

public static DataSink makeNew(omero.model.Pixels source,
                               ImageService service)
Factory method to create a new DataSink to handle access to the metadata associated with the specified pixels set.

Parameters:
source - The pixels set. Mustn't be null.
context - The container's registry. Mustn't be null.
size - The size of the cache.
Returns:
See above.

getPlane

public Plane2D getPlane(int z,
                        int t,
                        int w)
                 throws omero.ServerError
Extracts a 2D plane from the pixels set this object is working for.

Parameters:
z - The z-section at which data is to be fetched.
t - The timepoint at which data is to be fetched.
w - The wavelength at which data is to be fetched.
Returns:
A plane 2D object that encapsulates the actual plane pixels.
Throws:
DSAccessException
DSOutOfServiceException
omero.ServerError

isSame

public boolean isSame(long pixelsID)
Returns true if a data source has already been created for the specified pixels set, false otherwise.

Parameters:
pixelsID - The id of the pixels set.
Returns:
See above.

mapServerToClient

public static double[][] mapServerToClient(byte[] data,
                                           int x,
                                           int y,
                                           String pixelType)

mapServerToClient

public static double[][] mapServerToClient(byte[] data,
                                           int x,
                                           int y,
                                           String pixelType,
                                           boolean transpose)


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

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