ome.io.nio
Interface PixelBuffer

All Superinterfaces:
Closeable
All Known Implementing Classes:
BfPixelBuffer, BfPyramidPixelBuffer, InMemoryPlanarPixelBuffer, RomioPixelBuffer

public interface PixelBuffer
extends Closeable

This interface declares the I/O responsibilities of a buffer, file or otherwise, that contains a 5-dimensional Pixel array (XYZCT).

Since:
3.0
Version:
$Revision$
Author:
Chris Allan  callan@blackcat.ca

Method Summary
 byte[] calculateMessageDigest()
          Calculates a SHA-1 message digest for the entire pixel buffer.
 void checkBounds(Integer x, Integer y, Integer z, Integer c, Integer t)
          Checks to ensure that no one particular axis has an offset out of bounds.
 void close()
          Closes the buffer, cleaning up file state.
 int getByteWidth()
          Returns the byte width for the pixel buffer.
 ome.util.PixelData getCol(Integer x, Integer z, Integer c, Integer t)
          Retrieves a particular column from this pixel buffer.
 byte[] getColDirect(Integer x, Integer z, Integer c, Integer t, byte[] buffer)
          Retrieves a particular column from this pixel buffer.
 Integer getColSize()
          Retrieves the in memory size of a column of pixels in this pixel buffer.
 ome.util.PixelData getHypercube(List<Integer> offset, List<Integer> size, List<Integer> step)
          Retrieves a hypercube from this pixel buffer.
 byte[] getHypercubeDirect(List<Integer> offset, List<Integer> size, List<Integer> step, byte[] buffer)
          Retrieves a hypercube from the given pixels directly.
 Integer getHypercubeSize(List<Integer> offset, List<Integer> size, List<Integer> step)
          Retrieves a the size of a hypercube from this pixel buffer.
 long getId()
          Delegates to Pixels.getId().
 String getPath()
          Retrieves the full path to this pixel buffer on disk
 ome.util.PixelData getPlane(Integer z, Integer c, Integer t)
          Retrieves a particular 2D image plane from this pixel buffer.
 byte[] getPlaneDirect(Integer z, Integer c, Integer t, byte[] buffer)
          Retrieves a particular 2D image plane from this pixel buffer.
 Long getPlaneOffset(Integer z, Integer c, Integer t)
          Retrieves the offset for a particular 2D image plane in this pixel buffer.
 ome.util.PixelData getPlaneRegion(Integer x, Integer y, Integer width, Integer height, Integer z, Integer c, Integer t, Integer stride)
          Retrieves a particular region of a 2D image plane from this pixel buffer.
 byte[] getPlaneRegionDirect(Integer z, Integer c, Integer t, Integer count, Integer offset, byte[] buffer)
          Retrieves a region from a given plane directly.
 Integer getPlaneSize()
          Retrieves the in memory size of a 2D image plane in this pixel buffer.
 ome.util.PixelData getRegion(Integer size, Long offset)
          Retrieves a region from this pixel buffer.
 byte[] getRegionDirect(Integer size, Long offset, byte[] buffer)
          Retrieves a region from this pixel buffer directly.
 int getResolutionLevel()
          Retrieves the active resolution level.
 int getResolutionLevels()
          Retrieves the number of resolution levels that the backing pixels pyramid contains.
 ome.util.PixelData getRow(Integer y, Integer z, Integer c, Integer t)
          Retrieves a particular row or scanline from this pixel buffer.
 byte[] getRowDirect(Integer y, Integer z, Integer c, Integer t, byte[] buffer)
          Retrieves a particular row or scanline from this pixel buffer.
 Long getRowOffset(Integer y, Integer z, Integer c, Integer t)
          Retrieves the offset for a particular row or scanline in this pixel buffer.
 Integer getRowSize()
          Retrieves the in memory size of a row or scanline of pixels in this pixel buffer.
 int getSizeC()
          Delegates to Pixels.getSizeC().
 int getSizeT()
          Delegates to Pixels.getSizeT().
 int getSizeX()
          Delegates to Pixels.getSizeX().
 int getSizeY()
          Delegates to Pixels.getSizeY().
 int getSizeZ()
          Delegates to Pixels.getSizeZ().
 ome.util.PixelData getStack(Integer c, Integer t)
          Retrieves the the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.
 byte[] getStackDirect(Integer c, Integer t, byte[] buffer)
          Retrieves the the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.
 Long getStackOffset(Integer c, Integer t)
          Retrieves the offset for the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.
 Integer getStackSize()
          Retrieves the in memory size of the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.
 ome.util.PixelData getTile(Integer z, Integer c, Integer t, Integer x, Integer y, Integer w, Integer h)
          Retrieves a tile from this pixel buffer.
 byte[] getTileDirect(Integer z, Integer c, Integer t, Integer x, Integer y, Integer w, Integer h, byte[] buffer)
          Retrieves a tile from this pixel buffer.
 Dimension getTileSize()
          Retrieves the tile size for the pixel store.
 ome.util.PixelData getTimepoint(Integer t)
          Retrieves the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.
 byte[] getTimepointDirect(Integer t, byte[] buffer)
          Retrieves the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.
 Long getTimepointOffset(Integer t)
          Retrieves the in memory size of the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.
 Integer getTimepointSize()
          Retrieves the in memory size of the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.
 Integer getTotalSize()
          Retrieves the in memory size of the entire pixel buffer.
 boolean isFloat()
          Returns whether or not the pixel buffer has floating point pixels.
 boolean isSigned()
          Returns whether or not the pixel buffer has signed pixels.
 void setPlane(byte[] buffer, Integer z, Integer c, Integer t)
          Sets a particular 2D image plane in this pixel buffer.
 void setPlane(ByteBuffer buffer, Integer z, Integer c, Integer t)
          Sets a particular 2D image plane in this pixel buffer.
 void setRegion(Integer size, Long offset, byte[] buffer)
          Sets a region in this pixel buffer.
 void setRegion(Integer size, Long offset, ByteBuffer buffer)
          Sets a region in this pixel buffer.
 void setResolutionLevel(int resolutionLevel)
          Sets the active resolution level.
 void setRow(ByteBuffer buffer, Integer y, Integer z, Integer c, Integer t)
          Sets a particular row or scanline in this pixel buffer.
 void setStack(byte[] buffer, Integer z, Integer c, Integer t)
          Sets the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.
 void setStack(ByteBuffer buffer, Integer z, Integer c, Integer t)
          Sets the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.
 void setTile(byte[] buffer, Integer z, Integer c, Integer t, Integer x, Integer y, Integer w, Integer h)
          Sets a tile in this pixel buffer.
 void setTimepoint(byte[] buffer, Integer t)
          Sets the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.
 void setTimepoint(ByteBuffer buffer, Integer t)
          Sets the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.
 

Method Detail

close

void close()
           throws IOException
Closes the buffer, cleaning up file state.

Specified by:
close in interface Closeable
Throws:
IOException - if an I/O error occurs.

checkBounds

void checkBounds(Integer x,
                 Integer y,
                 Integer z,
                 Integer c,
                 Integer t)
                 throws DimensionsOutOfBoundsException
Checks to ensure that no one particular axis has an offset out of bounds. null may be passed as the argument to any one of the offsets to ignore it for the purposes of bounds checking.

Parameters:
x - offset across the X-axis of the pixel buffer to check.
y - offset across the Y-axis of the pixel buffer to check.
z - offset across the Z-axis of the pixel buffer to check.
c - offset across the C-axis of the pixel buffer to check.
t - offset across the T-axis of the pixel buffer to check.
Throws:
DimensionsOutOfBoundsException - if y, z, c or t is out of bounds.

getPlaneSize

Integer getPlaneSize()
Retrieves the in memory size of a 2D image plane in this pixel buffer.

Returns:
2D image plane size in bytes (sizeX*sizeY*ByteWidth).

getRowSize

Integer getRowSize()
Retrieves the in memory size of a row or scanline of pixels in this pixel buffer.

Returns:
row or scanline size in bytes (sizeX*ByteWidth)

getColSize

Integer getColSize()
Retrieves the in memory size of a column of pixels in this pixel buffer.

Returns:
column size in bytes (sizeY*ByteWidth)

getStackSize

Integer getStackSize()
Retrieves the in memory size of the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.

Returns:
stack size in bytes (sizeX*sizeY*sizeZ*ByteWidth).

getTimepointSize

Integer getTimepointSize()
Retrieves the in memory size of the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.

Returns:
timepoint size in bytes (sizeX*sizeY*sizeZ*sizeC*ByteWidth).

getTotalSize

Integer getTotalSize()
Retrieves the in memory size of the entire pixel buffer.

Returns:
total size of the pixel size in bytes (sizeX*sizeY*sizeZ*sizeC*sizeT*ByteWidth).

getHypercubeSize

Integer getHypercubeSize(List<Integer> offset,
                         List<Integer> size,
                         List<Integer> step)
                         throws DimensionsOutOfBoundsException
Retrieves a the size of a hypercube from this pixel buffer.

Parameters:
offset - The offset of each dimension of the pixel buffer.
size - The number of pixels to retrieve along each dimension .
step - The step size across each dimension .
Returns:
the size.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException

getRowOffset

Long getRowOffset(Integer y,
                  Integer z,
                  Integer c,
                  Integer t)
                  throws DimensionsOutOfBoundsException
Retrieves the offset for a particular row or scanline in this pixel buffer.

Parameters:
y - offset across the Y-axis of the pixel buffer.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Returns:
offset of the row or scaline.
Throws:
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getPlaneOffset

Long getPlaneOffset(Integer z,
                    Integer c,
                    Integer t)
                    throws DimensionsOutOfBoundsException
Retrieves the offset for a particular 2D image plane in this pixel buffer.

Parameters:
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Returns:
offset of the 2D image plane.
Throws:
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getStackOffset

Long getStackOffset(Integer c,
                    Integer t)
                    throws DimensionsOutOfBoundsException
Retrieves the offset for the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.

Parameters:
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Returns:
offset of the stack.
Throws:
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getTimepointOffset

Long getTimepointOffset(Integer t)
                        throws DimensionsOutOfBoundsException
Retrieves the in memory size of the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.

Parameters:
t - offset across the T-axis of the pixel buffer.
Returns:
offset of the timepoint.
Throws:
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getHypercube

ome.util.PixelData getHypercube(List<Integer> offset,
                                List<Integer> size,
                                List<Integer> step)
                                throws IOException,
                                       DimensionsOutOfBoundsException
Retrieves a hypercube from this pixel buffer.

Parameters:
offset - The offset of each dimension of the pixel buffer.
size - The number of pixels to retrieve along each dimension .
step - The step size across each dimension .
Returns:
buffer containing the data.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException

getHypercubeDirect

byte[] getHypercubeDirect(List<Integer> offset,
                          List<Integer> size,
                          List<Integer> step,
                          byte[] buffer)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Retrieves a hypercube from the given pixels directly.

Parameters:
offset - The offset of each dimension of the pixel buffer.
size - The number of pixels to retrieve along each dimension .
step - The step size across each dimension .
buffer - pre-allocated buffer, count in size.
Returns:
buffer containing the data.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException

getPlaneRegionDirect

byte[] getPlaneRegionDirect(Integer z,
                            Integer c,
                            Integer t,
                            Integer count,
                            Integer offset,
                            byte[] buffer)
                            throws IOException,
                                   DimensionsOutOfBoundsException
Retrieves a region from a given plane directly.

Parameters:
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
count - the number of pixels to retrieve.
offset - the offset at which to retrieve count pixels.
buffer - pre-allocated buffer, count in size.
Returns:
buffer containing the data which comprises the region of the given 2D image plane. It is guaranteed that this buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
See Also:
getRegionDirect()

getTile

ome.util.PixelData getTile(Integer z,
                           Integer c,
                           Integer t,
                           Integer x,
                           Integer y,
                           Integer w,
                           Integer h)
                           throws IOException
Retrieves a tile from this pixel buffer.

Parameters:
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
x - Top left corner of the tile, X offset.
y - Top left corner of the tile, Y offset.
w - Width of the tile.
h - Height of the tile.
Returns:
buffer containing the data which comprises the region of the given 2D image plane. It is guaranteed that this buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
See Also:
getTileDirect()

getTileDirect

byte[] getTileDirect(Integer z,
                     Integer c,
                     Integer t,
                     Integer x,
                     Integer y,
                     Integer w,
                     Integer h,
                     byte[] buffer)
                     throws IOException
Retrieves a tile from this pixel buffer.

Parameters:
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
x - Top left corner of the tile, X offset.
y - Top left corner of the tile, Y offset.
w - Width of the tile.
h - Height of the tile.
buffer - Pre-allocated buffer of the tile's size.
Returns:
buffer containing the data which comprises this region. It is guaranteed that this buffer will have been byte swapped. The buffer is essentially directly from disk.
Throws:
IOException - if there is a problem reading from the pixel buffer.
See Also:
getTile()

getRegion

ome.util.PixelData getRegion(Integer size,
                             Long offset)
                             throws IOException
Retrieves a region from this pixel buffer.

Parameters:
size - byte width of the region to retrieve.
offset - offset within the pixel buffer.
Returns:
buffer containing the data. It is guaranteed that this buffer will have its order set correctly but not that the backing buffer will have been byte swapped. The buffer is essentially directly from disk.
Throws:
IOException - if there is a problem reading from the pixel buffer.
See Also:
getRegionDirect()

getRegionDirect

byte[] getRegionDirect(Integer size,
                       Long offset,
                       byte[] buffer)
                       throws IOException
Retrieves a region from this pixel buffer directly.

Parameters:
size - byte width of the region to retrieve.
offset - offset within the pixel buffer.
buffer - pre-allocated buffer of the row's size.
Returns:
buffer containing the data which comprises this region. It is guaranteed that this buffer will have been byte swapped. The buffer is essentially directly from disk.
Throws:
IOException - if there is a problem reading from the pixel buffer.
See Also:
getRegion()

getRow

ome.util.PixelData getRow(Integer y,
                          Integer z,
                          Integer c,
                          Integer t)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Retrieves a particular row or scanline from this pixel buffer.

Parameters:
y - offset across the Y-axis of the pixel buffer.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Returns:
buffer containing the data which comprises this row or scanline. It is guaranteed that this buffer will have its order set correctly but not that the backing buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
See Also:
getRowDirect()

getCol

ome.util.PixelData getCol(Integer x,
                          Integer z,
                          Integer c,
                          Integer t)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Retrieves a particular column from this pixel buffer.

Parameters:
x - offset across the X-axis of the pixel buffer.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Returns:
buffer containing the data which comprises this column. It is guaranteed that this buffer will have its order set correctly but not that the backing buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
See Also:
getColDirect()

getRowDirect

byte[] getRowDirect(Integer y,
                    Integer z,
                    Integer c,
                    Integer t,
                    byte[] buffer)
                    throws IOException,
                           DimensionsOutOfBoundsException
Retrieves a particular row or scanline from this pixel buffer.

Parameters:
y - offset across the Y-axis of the pixel buffer.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
buffer - pre-allocated buffer of the row's size.
Returns:
buffer containing the data which comprises this row or scanline. It is guaranteed that this buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
See Also:
getRow()

getColDirect

byte[] getColDirect(Integer x,
                    Integer z,
                    Integer c,
                    Integer t,
                    byte[] buffer)
                    throws IOException,
                           DimensionsOutOfBoundsException
Retrieves a particular column from this pixel buffer.

Parameters:
x - offset across the X-axis of the pixel buffer.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
buffer - pre-allocated buffer of the row's size.
Returns:
buffer containing the data which comprises this column. It is guaranteed that this buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
See Also:
getCol()

getPlane

ome.util.PixelData getPlane(Integer z,
                            Integer c,
                            Integer t)
                            throws IOException,
                                   DimensionsOutOfBoundsException
Retrieves a particular 2D image plane from this pixel buffer.

Parameters:
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Returns:
buffer containing the data which comprises this 2D image plane. It is guaranteed that this buffer will have its order set correctly but not that the backing buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getPlaneRegion

ome.util.PixelData getPlaneRegion(Integer x,
                                  Integer y,
                                  Integer width,
                                  Integer height,
                                  Integer z,
                                  Integer c,
                                  Integer t,
                                  Integer stride)
                                  throws IOException,
                                         DimensionsOutOfBoundsException
Retrieves a particular region of a 2D image plane from this pixel buffer.

Parameters:
x - offset across the X-axis of the pixel buffer.
y - offset across the Y-axis of the pixel buffer.
width - The number of pixels to retrieve along the X-axis.
height - The number of pixels to retrieve along the Y-axis.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
stride - The step size.
Returns:
buffer containing the data which comprises this 2D image plane. It is guaranteed that this buffer will have its order set correctly but not that the backing buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getPlaneDirect

byte[] getPlaneDirect(Integer z,
                      Integer c,
                      Integer t,
                      byte[] buffer)
                      throws IOException,
                             DimensionsOutOfBoundsException
Retrieves a particular 2D image plane from this pixel buffer.

Parameters:
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
buffer - pre-allocated buffer of the plane's size.
Returns:
buffer containing the data which comprises this 2D image plane. It is guaranteed that this buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getStack

ome.util.PixelData getStack(Integer c,
                            Integer t)
                            throws IOException,
                                   DimensionsOutOfBoundsException
Retrieves the the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.

Parameters:
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Returns:
buffer containing the data which comprises this stack. It is guaranteed that this buffer will have its order set correctly but not that the backing buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getStackDirect

byte[] getStackDirect(Integer c,
                      Integer t,
                      byte[] buffer)
                      throws IOException,
                             DimensionsOutOfBoundsException
Retrieves the the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.

Parameters:
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
buffer - pre-allocated buffer of the stack's size.
Returns:
buffer containing the data which comprises this stack. It is guaranteed that this buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getTimepoint

ome.util.PixelData getTimepoint(Integer t)
                                throws IOException,
                                       DimensionsOutOfBoundsException
Retrieves the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.

Parameters:
t - offset across the T-axis of the pixel buffer.
Returns:
buffer containing the data which comprises this timepoint. It is guaranteed that this buffer will have its order set correctly but not that the backing buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

getTimepointDirect

byte[] getTimepointDirect(Integer t,
                          byte[] buffer)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Retrieves the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.

Parameters:
t - offset across the T-axis of the pixel buffer.
buffer - pre-allocated buffer of the timepoint's size.
Returns:
buffer containing the data which comprises this timepoint. It is guaranteed that this buffer will have been byte swapped.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().

setTile

void setTile(byte[] buffer,
             Integer z,
             Integer c,
             Integer t,
             Integer x,
             Integer y,
             Integer w,
             Integer h)
             throws IOException,
                    BufferOverflowException
Sets a tile in this pixel buffer.

Parameters:
buffer - A byte array of the data.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
x - Top left corner of the tile, X offset.
y - Top left corner of the tile, Y offset.
w - Width of the tile.
h - Height of the tile.
Throws:
IOException - if there is a problem writing to the pixel buffer.
BufferOverflowException - if an attempt is made to write off the end of the file.

setRegion

void setRegion(Integer size,
               Long offset,
               byte[] buffer)
               throws IOException,
                      BufferOverflowException
Sets a region in this pixel buffer.

Parameters:
size - byte width of the region to set.
offset - offset within the pixel buffer.
buffer - a byte array of the data.
Throws:
IOException - if there is a problem writing to the pixel buffer.
BufferOverflowException - if buffer.length > size.

setRegion

void setRegion(Integer size,
               Long offset,
               ByteBuffer buffer)
               throws IOException,
                      BufferOverflowException
Sets a region in this pixel buffer.

Parameters:
size - byte width of the region to set.
offset - offset within the pixel buffer.
buffer - a byte buffer of the data.
Throws:
IOException - if there is a problem writing to the pixel buffer.
BufferOverflowException - if buffer.length > size.

setRow

void setRow(ByteBuffer buffer,
            Integer y,
            Integer z,
            Integer c,
            Integer t)
            throws IOException,
                   DimensionsOutOfBoundsException,
                   BufferOverflowException
Sets a particular row or scanline in this pixel buffer.

Parameters:
buffer - a byte buffer of the data comprising this row or scanline.
y - offset across the Y-axis of the pixel buffer.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Throws:
IOException - if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
BufferOverflowException - if buffer.length > getRowSize().

setPlane

void setPlane(ByteBuffer buffer,
              Integer z,
              Integer c,
              Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException,
                     BufferOverflowException
Sets a particular 2D image plane in this pixel buffer.

Parameters:
buffer - a byte array of the data comprising this 2D image plane.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Throws:
IOException - if there is a problem writing to the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
BufferOverflowException - if buffer.length > getPlaneSize().

setPlane

void setPlane(byte[] buffer,
              Integer z,
              Integer c,
              Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException,
                     BufferOverflowException
Sets a particular 2D image plane in this pixel buffer.

Parameters:
buffer - a byte buffer of the data comprising this 2D image plane.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Throws:
IOException - if there is a problem writing to the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
BufferOverflowException - if buffer.length > getPlaneSize().

setStack

void setStack(ByteBuffer buffer,
              Integer z,
              Integer c,
              Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException,
                     BufferOverflowException
Sets the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.

Parameters:
buffer - a byte buffer of the data comprising this stack.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Throws:
IOException - if there is a problem writing to the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
BufferOverflowException - if buffer.length > getStackSize().

setStack

void setStack(byte[] buffer,
              Integer z,
              Integer c,
              Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException,
                     BufferOverflowException
Sets the entire number of optical sections for a single wavelength or channel at a particular timepoint in this pixel buffer.

Parameters:
buffer - a byte array of the data comprising this stack.
z - offset across the Z-axis of the pixel buffer.
c - offset across the C-axis of the pixel buffer.
t - offset across the T-axis of the pixel buffer.
Throws:
IOException - if there is a problem writing to the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
BufferOverflowException - if buffer.length > getStackSize()().

setTimepoint

void setTimepoint(ByteBuffer buffer,
                  Integer t)
                  throws IOException,
                         DimensionsOutOfBoundsException,
                         BufferOverflowException
Sets the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.

Parameters:
buffer - a byte buffer of the data comprising this timepoint.
t - offset across the T-axis of the pixel buffer.
Throws:
IOException - if there is a problem writing to the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
BufferOverflowException - if buffer.length > getTimepointSize().

setTimepoint

void setTimepoint(byte[] buffer,
                  Integer t)
                  throws IOException,
                         DimensionsOutOfBoundsException,
                         BufferOverflowException
Sets the entire number of optical sections for all wavelengths or channels at a particular timepoint in this pixel buffer.

Parameters:
buffer - a byte array of the data comprising this timepoint.
t - offset across the T-axis of the pixel buffer.
Throws:
IOException - if there is a problem writing to the pixel buffer.
DimensionsOutOfBoundsException - if offsets are out of bounds after checking with checkBounds().
BufferOverflowException - if buffer.length > getTimepointSize().

calculateMessageDigest

byte[] calculateMessageDigest()
                              throws IOException
Calculates a SHA-1 message digest for the entire pixel buffer.

Returns:
byte array containing the message digest.
Throws:
IOException - if there is a problem reading from the pixel buffer.

getByteWidth

int getByteWidth()
Returns the byte width for the pixel buffer.

Returns:
See above.

isSigned

boolean isSigned()
Returns whether or not the pixel buffer has signed pixels.

Returns:
See above.

isFloat

boolean isFloat()
Returns whether or not the pixel buffer has floating point pixels.

Returns:

getPath

String getPath()
Retrieves the full path to this pixel buffer on disk

Returns:
fully qualified path.

getId

long getId()
Delegates to Pixels.getId().


getSizeX

int getSizeX()
Delegates to Pixels.getSizeX().


getSizeY

int getSizeY()
Delegates to Pixels.getSizeY().


getSizeZ

int getSizeZ()
Delegates to Pixels.getSizeZ().


getSizeC

int getSizeC()
Delegates to Pixels.getSizeC().


getSizeT

int getSizeT()
Delegates to Pixels.getSizeT().


getResolutionLevels

int getResolutionLevels()
Retrieves the number of resolution levels that the backing pixels pyramid contains.

Returns:
The number of resolution levels. This value does not necessarily indicate either the presence or absence of a pixels pyramid.

getResolutionLevel

int getResolutionLevel()
Retrieves the active resolution level.

Returns:
The active resolution level.

setResolutionLevel

void setResolutionLevel(int resolutionLevel)
Sets the active resolution level.

Parameters:
resolutionLevel - The resolution level to be used by the pixel buffer.

getTileSize

Dimension getTileSize()
Retrieves the tile size for the pixel store.

Returns:
The dimension of the tile or null if the pixel buffer is not tiled.


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

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