|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PixelBuffer
This interface declares the I/O responsibilities of a buffer, file or otherwise, that contains a 5-dimensional Pixel array (XYZCT).
Method Summary | |
---|---|
byte[] |
calculateMessageDigest()
Calculates a SHA-1 message digest for the entire pixel buffer. |
void |
checkBounds(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. |
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. |
long |
getId()
Delegates to Pixels.getId() . |
String |
getPath()
Retrieves the full path to this pixel buffer on disk |
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. |
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. |
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. |
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() . |
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. |
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 |
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 |
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 |
---|
void close() throws IOException
IOException
- if an I/O error occurs.void checkBounds(Integer y, Integer z, Integer c, Integer t) throws DimensionsOutOfBoundsException
null
may be passed as the argument to any one of the offsets
to ignore it for the purposes of bounds checking.
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.
DimensionsOutOfBoundsException
- if y
,
z
, c
or t
is out of bounds.Integer getPlaneSize()
Integer getRowSize()
Integer getColSize()
Integer getStackSize()
Integer getTimepointSize()
Integer getTotalSize()
Long getRowOffset(Integer y, Integer z, Integer c, Integer t) throws DimensionsOutOfBoundsException
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.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.Long getPlaneOffset(Integer z, Integer c, Integer t) throws DimensionsOutOfBoundsException
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.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.Long getStackOffset(Integer c, Integer t) throws DimensionsOutOfBoundsException
c
- offset across the C-axis of the pixel buffer.t
- offset across the T-axis of the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.Long getTimepointOffset(Integer t) throws DimensionsOutOfBoundsException
t
- offset across the T-axis of the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.byte[] getPlaneRegionDirect(Integer z, Integer c, Integer t, Integer count, Integer offset, byte[] buffer) throws IOException, DimensionsOutOfBoundsException
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.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
getRegionDirect()
PixelData getRegion(Integer size, Long offset) throws IOException
size
- byte width of the region to retrieve.offset
- offset within the pixel buffer.
order
set correctly but not that the
backing buffer will have been byte swapped. The buffer is essentially
directly from disk.
IOException
- if there is a problem reading from the pixel buffer.getRegionDirect()
byte[] getRegionDirect(Integer size, Long offset, byte[] buffer) throws IOException
size
- byte width of the region to retrieve.offset
- offset within the pixel buffer.buffer
- pre-allocated buffer of the row's size.
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.
IOException
- if there is a problem reading from the pixel buffer.getRegion()
PixelData getRow(Integer y, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException
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.
order
set
correctly but not that the backing buffer will have been byte
swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.getRowDirect()
PixelData getCol(Integer x, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException
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.
order
set
correctly but not that the backing buffer will have been byte
swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.getColDirect()
byte[] getRowDirect(Integer y, Integer z, Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException
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.
buffer
containing the data which comprises this row
or scanline. It is guaranteed that this buffer will have been byte
swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.getRow()
byte[] getColDirect(Integer x, Integer z, Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException
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.
buffer
containing the data which comprises this
column. It is guaranteed that this buffer will have been byte swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.getCol()
PixelData getPlane(Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException
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.
order
set
correctly but not that the backing buffer will have been byte
swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.byte[] getPlaneDirect(Integer z, Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException
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.
buffer
containing the data which comprises this 2D
image plane. It is guaranteed that this buffer will have been byte
swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.PixelData getStack(Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException
c
- offset across the C-axis of the pixel buffer.t
- offset across the T-axis of the pixel buffer.
order
set
correctly but not that the backing buffer will have been byte
swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.byte[] getStackDirect(Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException
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.
buffer
containing the data which comprises this
stack. It is guaranteed that this buffer will have been byte swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.PixelData getTimepoint(Integer t) throws IOException, DimensionsOutOfBoundsException
t
- offset across the T-axis of the pixel buffer.
order
set
correctly but not that the backing buffer will have been byte
swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.byte[] getTimepointDirect(Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException
t
- offset across the T-axis of the pixel buffer.buffer
- pre-allocated buffer of the timepoint's size.
buffer
containing the data which comprises this
timepoint. It is guaranteed that this buffer will have been byte swapped.
IOException
- if there is a problem reading from the pixel buffer.
DimensionsOutOfBoundsException
- if offsets are out of bounds
after checking with checkBounds()
.void setRegion(Integer size, Long offset, byte[] buffer) throws IOException, BufferOverflowException
size
- byte width of the region to set.offset
- offset within the pixel buffer.buffer
- a byte array of the data.
IOException
- if there is a problem writing to the pixel buffer.
BufferOverflowException
- if buffer.length > size
.void setRegion(Integer size, Long offset, ByteBuffer buffer) throws IOException, BufferOverflowException
size
- byte width of the region to set.offset
- offset within the pixel buffer.buffer
- a byte buffer of the data.
IOException
- if there is a problem writing to the pixel buffer.
BufferOverflowException
- if buffer.length > size
.void setRow(ByteBuffer buffer, Integer y, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException, BufferOverflowException
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.
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()
.void setPlane(ByteBuffer buffer, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException, BufferOverflowException
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.
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()
.void setPlane(byte[] buffer, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException, BufferOverflowException
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.
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()
.void setStack(ByteBuffer buffer, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException, BufferOverflowException
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.
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()
.void setStack(byte[] buffer, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException, BufferOverflowException
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.
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()()
.void setTimepoint(ByteBuffer buffer, Integer t) throws IOException, DimensionsOutOfBoundsException, BufferOverflowException
buffer
- a byte buffer of the data comprising this timepoint.t
- offset across the T-axis of the pixel buffer.
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()
.void setTimepoint(byte[] buffer, Integer t) throws IOException, DimensionsOutOfBoundsException, BufferOverflowException
buffer
- a byte array of the data comprising this timepoint.t
- offset across the T-axis of the pixel buffer.
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()
.byte[] calculateMessageDigest() throws IOException
IOException
- if there is a problem reading from the pixel buffer.int getByteWidth()
boolean isSigned()
boolean isFloat()
String getPath()
long getId()
Pixels.getId()
.
int getSizeX()
Pixels.getSizeX()
.
int getSizeY()
Pixels.getSizeY()
.
int getSizeZ()
Pixels.getSizeZ()
.
int getSizeC()
Pixels.getSizeC()
.
int getSizeT()
Pixels.getSizeT()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.