ome.io.nio
Class RomioPixelBuffer

java.lang.Object
  extended by ome.io.nio.AbstractBuffer
      extended by ome.io.nio.RomioPixelBuffer
All Implemented Interfaces:
Closeable, PixelBuffer

public class RomioPixelBuffer
extends AbstractBuffer
implements PixelBuffer

Class implementation of the PixelBuffer interface for standard "proprietary" ROMIO/OMEIS data format.

Since:
3.0
Version:
$Revision$
Author:
Chris Allan      chris@glencoesoftware.com
See Also:
PixelBuffer

Field Summary
static int MAXIMUM_BUFFER_SIZE
          Default maximum buffer size for planar data transfer. (1MB)
 
Constructor Summary
RomioPixelBuffer(String path, ome.model.core.Pixels pixels)
          Creates a new instance.
RomioPixelBuffer(String path, ome.model.core.Pixels pixels, boolean permitModification)
          Creates a new instance, with manual setting of permitModification.
 
Method Summary
 byte[] calculateMessageDigest()
          Implemented as specified by PixelBuffer I/F.
 void checkBounds(Integer x, Integer y, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 void close()
          Closes the buffer, cleaning up file state.
 int getByteWidth()
          Implemented as specified by PixelBuffer I/F.
 ome.util.PixelData getCol(Integer x, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 byte[] getColDirect(Integer x, Integer z, Integer c, Integer t, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 Integer getColSize()
          Implemented as specified by PixelBuffer I/F.
 ome.util.PixelData getHypercube(List<Integer> offset, List<Integer> size, List<Integer> step)
          Implemented as specified by PixelBuffer I/F.
 byte[] getHypercubeDirect(List<Integer> offset, List<Integer> size, List<Integer> step, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 Integer getHypercubeSize(List<Integer> offset, List<Integer> size, List<Integer> step)
          Retrieves a the size of a hypercube from this pixel buffer.
 long getId()
          Implemented as specified by PixelBuffer I/F.
 ome.util.PixelData getPlane(Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 byte[] getPlaneDirect(Integer z, Integer c, Integer t, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 Long getPlaneOffset(Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 ome.util.PixelData getPlaneRegion(Integer x, Integer y, Integer width, Integer height, Integer z, Integer c, Integer t, Integer stride)
          Implemented as specified by PixelBuffer I/F.
 byte[] getPlaneRegionDirect(Integer z, Integer c, Integer t, Integer count, Integer offset, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 Integer getPlaneSize()
          Implemented as specified by PixelBuffer I/F.
 ome.util.PixelData getRegion(Integer size, Long offset)
          Implemented as specified by PixelBuffer I/F.
 byte[] getRegionDirect(Integer size, Long offset, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 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)
          Implemented as specified by PixelBuffer I/F.
 byte[] getRowDirect(Integer y, Integer z, Integer c, Integer t, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 Long getRowOffset(Integer y, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 Integer getRowSize()
          Implemented as specified by PixelBuffer I/F.
 String getSha1()
           
 int getSizeC()
          Implemented as specified by PixelBuffer I/F.
 int getSizeT()
          Implemented as specified by PixelBuffer I/F.
 int getSizeX()
          Implemented as specified by PixelBuffer I/F.
 int getSizeY()
          Implemented as specified by PixelBuffer I/F.
 int getSizeZ()
          Implemented as specified by PixelBuffer I/F.
 ome.util.PixelData getStack(Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 byte[] getStackDirect(Integer c, Integer t, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 Long getStackOffset(Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 Integer getStackSize()
          Implemented as specified by PixelBuffer I/F.
 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)
          Implemented as specified by PixelBuffer I/F.
 byte[] getTimepointDirect(Integer t, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 Long getTimepointOffset(Integer t)
          Implemented as specified by PixelBuffer I/F.
 Integer getTimepointSize()
          Implemented as specified by PixelBuffer I/F.
 Integer getTotalSize()
          Implemented as specified by PixelBuffer I/F.
 boolean isFloat()
          Implemented as specified by PixelBuffer I/F.
 boolean isSigned()
          Implemented as specified by PixelBuffer I/F.
 void setPlane(byte[] buffer, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 void setPlane(ByteBuffer buffer, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 void setRegion(Integer size, Long offset, byte[] buffer)
          Implemented as specified by PixelBuffer I/F.
 void setRegion(Integer size, Long offset, ByteBuffer buffer)
          Implemented as specified by PixelBuffer I/F.
 void setResolutionLevel(int resolutionLevel)
          Sets the active resolution level.
 void setRow(ByteBuffer buffer, Integer y, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 void setStack(byte[] buffer, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 void setStack(ByteBuffer buffer, Integer z, Integer c, Integer t)
          Implemented as specified by PixelBuffer I/F.
 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)
          Implemented as specified by PixelBuffer I/F.
 void setTimepoint(ByteBuffer buffer, Integer t)
          Implemented as specified by PixelBuffer I/F.
 
Methods inherited from class ome.io.nio.AbstractBuffer
getPath, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ome.io.nio.PixelBuffer
getPath
 

Field Detail

MAXIMUM_BUFFER_SIZE

public static final int MAXIMUM_BUFFER_SIZE
Default maximum buffer size for planar data transfer. (1MB)

See Also:
Constant Field Values
Constructor Detail

RomioPixelBuffer

public RomioPixelBuffer(String path,
                        ome.model.core.Pixels pixels)
Creates a new instance. permitModification defaults to false.

Parameters:
path - The path to the file.
pixels - The pixels object to handle.

RomioPixelBuffer

public RomioPixelBuffer(String path,
                        ome.model.core.Pixels pixels,
                        boolean permitModification)
Creates a new instance, with manual setting of permitModification.

Parameters:
path - The path to the file.
pixels - The pixels object to handle.
Method Detail

checkBounds

public void checkBounds(Integer x,
                        Integer y,
                        Integer z,
                        Integer c,
                        Integer t)
                 throws DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
checkBounds in interface PixelBuffer
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.
See Also:
PixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)

close

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

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

getPlaneSize

public Integer getPlaneSize()
Implemented as specified by PixelBuffer I/F.

Specified by:
getPlaneSize in interface PixelBuffer
Returns:
2D image plane size in bytes (sizeX*sizeY*ByteWidth).
See Also:
PixelBuffer.getPlaneSize()

getRowSize

public Integer getRowSize()
Implemented as specified by PixelBuffer I/F.

Specified by:
getRowSize in interface PixelBuffer
Returns:
row or scanline size in bytes (sizeX*ByteWidth)
See Also:
PixelBuffer.getRowSize()

getColSize

public Integer getColSize()
Implemented as specified by PixelBuffer I/F.

Specified by:
getColSize in interface PixelBuffer
Returns:
column size in bytes (sizeY*ByteWidth)
See Also:
PixelBuffer.getColSize()

getStackSize

public Integer getStackSize()
Implemented as specified by PixelBuffer I/F.

Specified by:
getStackSize in interface PixelBuffer
Returns:
stack size in bytes (sizeX*sizeY*sizeZ*ByteWidth).
See Also:
PixelBuffer.getStackSize()

getTimepointSize

public Integer getTimepointSize()
Implemented as specified by PixelBuffer I/F.

Specified by:
getTimepointSize in interface PixelBuffer
Returns:
timepoint size in bytes (sizeX*sizeY*sizeZ*sizeC*ByteWidth).
See Also:
PixelBuffer.getTimepointSize()

getTotalSize

public Integer getTotalSize()
Implemented as specified by PixelBuffer I/F.

Specified by:
getTotalSize in interface PixelBuffer
Returns:
total size of the pixel size in bytes (sizeX*sizeY*sizeZ*sizeC*sizeT*ByteWidth).
See Also:
PixelBuffer.getTotalSize()

getRowOffset

public Long getRowOffset(Integer y,
                         Integer z,
                         Integer c,
                         Integer t)
                  throws DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getRowOffset in interface PixelBuffer
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().
See Also:
PixelBuffer.getRowOffset(Integer, Integer, Integer, Integer)

getPlaneOffset

public Long getPlaneOffset(Integer z,
                           Integer c,
                           Integer t)
                    throws DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getPlaneOffset in interface PixelBuffer
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().
See Also:
PixelBuffer.getPlaneOffset(Integer, Integer, Integer)

getStackOffset

public Long getStackOffset(Integer c,
                           Integer t)
                    throws DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getStackOffset in interface PixelBuffer
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().
See Also:
PixelBuffer.getStackOffset(Integer, Integer)

getTimepointOffset

public Long getTimepointOffset(Integer t)
                        throws DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getTimepointOffset in interface PixelBuffer
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().
See Also:
PixelBuffer.getTimepointOffset(Integer)

getRegion

public ome.util.PixelData getRegion(Integer size,
                                    Long offset)
                             throws IOException
Implemented as specified by PixelBuffer I/F.

Specified by:
getRegion in interface PixelBuffer
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:
PixelBuffer.getRegion(Integer, Long)

getRegionDirect

public byte[] getRegionDirect(Integer size,
                              Long offset,
                              byte[] buffer)
                       throws IOException
Implemented as specified by PixelBuffer I/F.

Specified by:
getRegionDirect in interface PixelBuffer
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:
PixelBuffer.getRegionDirect(Integer, Long, byte[])

getRow

public ome.util.PixelData getRow(Integer y,
                                 Integer z,
                                 Integer c,
                                 Integer t)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getRow in interface PixelBuffer
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:
PixelBuffer.getRow(Integer, Integer, Integer, Integer)

getCol

public ome.util.PixelData getCol(Integer x,
                                 Integer z,
                                 Integer c,
                                 Integer t)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getCol in interface PixelBuffer
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:
PixelBuffer.getCol(Integer, Integer, Integer, Integer)

getRowDirect

public byte[] getRowDirect(Integer y,
                           Integer z,
                           Integer c,
                           Integer t,
                           byte[] buffer)
                    throws IOException,
                           DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getRowDirect in interface PixelBuffer
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:
PixelBuffer.getRowDirect(Integer, Integer, Integer, Integer, byte[])

getColDirect

public byte[] getColDirect(Integer x,
                           Integer z,
                           Integer c,
                           Integer t,
                           byte[] buffer)
                    throws IOException,
                           DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getColDirect in interface PixelBuffer
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:
PixelBuffer.getColDirect(Integer, Integer, Integer, Integer, byte[])

getHypercube

public ome.util.PixelData getHypercube(List<Integer> offset,
                                       List<Integer> size,
                                       List<Integer> step)
                                throws IOException,
                                       DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getHypercube in interface PixelBuffer
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
See Also:
PixelBuffer#getHypercube(List, IList, List)

getHypercubeDirect

public byte[] getHypercubeDirect(List<Integer> offset,
                                 List<Integer> size,
                                 List<Integer> step,
                                 byte[] buffer)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getHypercubeDirect in interface PixelBuffer
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
See Also:
PixelBuffer#getHypercubeDirect(List, IList, List, byte[])

getPlaneRegionDirect

public byte[] getPlaneRegionDirect(Integer z,
                                   Integer c,
                                   Integer t,
                                   Integer count,
                                   Integer offset,
                                   byte[] buffer)
                            throws IOException,
                                   DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getPlaneRegionDirect in interface PixelBuffer
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:
PixelBuffer.getPlaneRegionDirect(Integer, Integer, Integer, Integer, Integer, byte[])

getPlane

public ome.util.PixelData getPlane(Integer z,
                                   Integer c,
                                   Integer t)
                            throws IOException,
                                   DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getPlane in interface PixelBuffer
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().
See Also:
PixelBuffer.getPlane(Integer, Integer, Integer)

getPlaneRegion

public ome.util.PixelData getPlaneRegion(Integer x,
                                         Integer y,
                                         Integer width,
                                         Integer height,
                                         Integer z,
                                         Integer c,
                                         Integer t,
                                         Integer stride)
                                  throws IOException,
                                         DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getPlaneRegion in interface PixelBuffer
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().
See Also:
PixelBuffer.getPlaneRegion(Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer)

getPlaneDirect

public byte[] getPlaneDirect(Integer z,
                             Integer c,
                             Integer t,
                             byte[] buffer)
                      throws IOException,
                             DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getPlaneDirect in interface PixelBuffer
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().
See Also:
PixelBuffer.getPlaneDirect(Integer, Integer, Integer, byte[])

getStack

public ome.util.PixelData getStack(Integer c,
                                   Integer t)
                            throws IOException,
                                   DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getStack in interface PixelBuffer
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().
See Also:
PixelBuffer.getStack(Integer, Integer)

getStackDirect

public byte[] getStackDirect(Integer c,
                             Integer t,
                             byte[] buffer)
                      throws IOException,
                             DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getStackDirect in interface PixelBuffer
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().
See Also:
PixelBuffer.getStackDirect(Integer, Integer, byte[])

getTimepoint

public ome.util.PixelData getTimepoint(Integer t)
                                throws IOException,
                                       DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getTimepoint in interface PixelBuffer
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().
See Also:
PixelBuffer.getTimepoint(Integer)

getTimepointDirect

public byte[] getTimepointDirect(Integer t,
                                 byte[] buffer)
                          throws IOException,
                                 DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
getTimepointDirect in interface PixelBuffer
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().
See Also:
PixelBuffer.getTimepointDirect(Integer, byte[])

setRegion

public void setRegion(Integer size,
                      Long offset,
                      byte[] buffer)
               throws IOException
Implemented as specified by PixelBuffer I/F.

Specified by:
setRegion in interface PixelBuffer
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.
See Also:
PixelBuffer.setRegion(Integer, Long, byte[])

setRegion

public void setRegion(Integer size,
                      Long offset,
                      ByteBuffer buffer)
               throws IOException
Implemented as specified by PixelBuffer I/F.

Specified by:
setRegion in interface PixelBuffer
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.
See Also:
PixelBuffer.setRegion(Integer, Long, ByteBuffer)

setRow

public void setRow(ByteBuffer buffer,
                   Integer y,
                   Integer z,
                   Integer c,
                   Integer t)
            throws IOException,
                   DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
setRow in interface PixelBuffer
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().
See Also:
PixelBuffer.setRow(ByteBuffer, Integer, Integer, Integer, Integer)

setPlane

public void setPlane(ByteBuffer buffer,
                     Integer z,
                     Integer c,
                     Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
setPlane in interface PixelBuffer
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().
See Also:
PixelBuffer.setPlane(ByteBuffer, Integer, Integer, Integer)

setPlane

public void setPlane(byte[] buffer,
                     Integer z,
                     Integer c,
                     Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
setPlane in interface PixelBuffer
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().
See Also:
PixelBuffer.setPlane(byte[], Integer, Integer, Integer)

setStack

public void setStack(ByteBuffer buffer,
                     Integer z,
                     Integer c,
                     Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
setStack in interface PixelBuffer
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().
See Also:
PixelBuffer.setStack(ByteBuffer, Integer, Integer, Integer)

setStack

public void setStack(byte[] buffer,
                     Integer z,
                     Integer c,
                     Integer t)
              throws IOException,
                     DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
setStack in interface PixelBuffer
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().
See Also:
PixelBuffer.setStack(byte[], Integer, Integer, Integer)

setTimepoint

public void setTimepoint(ByteBuffer buffer,
                         Integer t)
                  throws IOException,
                         DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
setTimepoint in interface PixelBuffer
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().
See Also:
PixelBuffer.setTimepoint(ByteBuffer, Integer)

setTimepoint

public void setTimepoint(byte[] buffer,
                         Integer t)
                  throws IOException,
                         DimensionsOutOfBoundsException
Implemented as specified by PixelBuffer I/F.

Specified by:
setTimepoint in interface PixelBuffer
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().
See Also:
PixelBuffer.setTimepoint(ByteBuffer, Integer)

calculateMessageDigest

public byte[] calculateMessageDigest()
                              throws IOException
Implemented as specified by PixelBuffer I/F.

Specified by:
calculateMessageDigest in interface PixelBuffer
Returns:
byte array containing the message digest.
Throws:
IOException - if there is a problem reading from the pixel buffer.
See Also:
PixelBuffer.calculateMessageDigest()

getByteWidth

public int getByteWidth()
Implemented as specified by PixelBuffer I/F.

Specified by:
getByteWidth in interface PixelBuffer
Returns:
See above.
See Also:
PixelBuffer.getByteWidth()

isSigned

public boolean isSigned()
Implemented as specified by PixelBuffer I/F.

Specified by:
isSigned in interface PixelBuffer
Returns:
See above.
See Also:
PixelBuffer.isSigned()

isFloat

public boolean isFloat()
Implemented as specified by PixelBuffer I/F.

Specified by:
isFloat in interface PixelBuffer
Returns:
See Also:
PixelBuffer.isFloat()

getSizeC

public int getSizeC()
Implemented as specified by PixelBuffer I/F.

Specified by:
getSizeC in interface PixelBuffer
See Also:
PixelBuffer.getSizeC()

getSizeT

public int getSizeT()
Implemented as specified by PixelBuffer I/F.

Specified by:
getSizeT in interface PixelBuffer
See Also:
PixelBuffer.getSizeT()

getSizeX

public int getSizeX()
Implemented as specified by PixelBuffer I/F.

Specified by:
getSizeX in interface PixelBuffer
See Also:
PixelBuffer.getSizeX()

getSizeY

public int getSizeY()
Implemented as specified by PixelBuffer I/F.

Specified by:
getSizeY in interface PixelBuffer
See Also:
PixelBuffer.getSizeY()

getSizeZ

public int getSizeZ()
Implemented as specified by PixelBuffer I/F.

Specified by:
getSizeZ in interface PixelBuffer
See Also:
PixelBuffer.getSizeZ()

getId

public long getId()
Implemented as specified by PixelBuffer I/F.

Specified by:
getId in interface PixelBuffer
See Also:
PixelBuffer.getId()

getSha1

public String getSha1()

getTile

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

Specified by:
getTile in interface PixelBuffer
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

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

Specified by:
getTileDirect in interface PixelBuffer
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()

setTile

public void setTile(byte[] buffer,
                    Integer z,
                    Integer c,
                    Integer t,
                    Integer x,
                    Integer y,
                    Integer w,
                    Integer h)
             throws IOException,
                    BufferOverflowException
Description copied from interface: PixelBuffer
Sets a tile in this pixel buffer.

Specified by:
setTile in interface PixelBuffer
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.

getResolutionLevel

public int getResolutionLevel()
Description copied from interface: PixelBuffer
Retrieves the active resolution level.

Specified by:
getResolutionLevel in interface PixelBuffer
Returns:
The active resolution level.

getResolutionLevels

public int getResolutionLevels()
Description copied from interface: PixelBuffer
Retrieves the number of resolution levels that the backing pixels pyramid contains.

Specified by:
getResolutionLevels in interface PixelBuffer
Returns:
The number of resolution levels. This value does not necessarily indicate either the presence or absence of a pixels pyramid.

getTileSize

public Dimension getTileSize()
Description copied from interface: PixelBuffer
Retrieves the tile size for the pixel store.

Specified by:
getTileSize in interface PixelBuffer
Returns:
The dimension of the tile or null if the pixel buffer is not tiled.

setResolutionLevel

public void setResolutionLevel(int resolutionLevel)
Description copied from interface: PixelBuffer
Sets the active resolution level.

Specified by:
setResolutionLevel in interface PixelBuffer
Parameters:
resolutionLevel - The resolution level to be used by the pixel buffer.

getHypercubeSize

public Integer getHypercubeSize(List<Integer> offset,
                                List<Integer> size,
                                List<Integer> step)
                         throws DimensionsOutOfBoundsException
Description copied from interface: PixelBuffer
Retrieves a the size of a hypercube from this pixel buffer.

Specified by:
getHypercubeSize in interface PixelBuffer
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:
DimensionsOutOfBoundsException


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

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