Package ome.io.nio
Class RomioPixelBuffer
- java.lang.Object
-
- ome.io.nio.AbstractBuffer
-
- ome.io.nio.RomioPixelBuffer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,PixelBuffer
public class RomioPixelBuffer extends AbstractBuffer implements PixelBuffer
Class implementation of the PixelBuffer interface for standard "proprietary" ROMIO/OMEIS data format.- Since:
- 3.0
- See Also:
PixelBuffer
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAXIMUM_BUFFER_SIZE
Default maximum buffer size for planar data transfer.
-
Constructor Summary
Constructors Constructor Description RomioPixelBuffer(java.lang.String path, ome.model.core.Pixels pixels)
Creates a new instance.RomioPixelBuffer(java.lang.String path, ome.model.core.Pixels pixels, boolean permitModification)
Creates a new instance, with manual setting ofpermitModification
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
calculateMessageDigest()
Implemented as specified byPixelBuffer
I/F.void
checkBounds(java.lang.Integer x, java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.void
close()
Closes the buffer, cleaning up file state.int
getByteWidth()
Implemented as specified byPixelBuffer
I/F.ome.util.PixelData
getCol(java.lang.Integer x, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.byte[]
getColDirect(java.lang.Integer x, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.lang.Integer
getColSize()
Implemented as specified byPixelBuffer
I/F.ome.util.PixelData
getHypercube(java.util.List<java.lang.Integer> offset, java.util.List<java.lang.Integer> size, java.util.List<java.lang.Integer> step)
Implemented as specified byPixelBuffer
I/F.byte[]
getHypercubeDirect(java.util.List<java.lang.Integer> offset, java.util.List<java.lang.Integer> size, java.util.List<java.lang.Integer> step, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getHypercubeSize(java.util.List<java.lang.Integer> offset, java.util.List<java.lang.Integer> size, java.util.List<java.lang.Integer> step)
Retrieves a the size of a hypercube from this pixel buffer.long
getId()
Implemented as specified byPixelBuffer
I/F.ome.util.PixelData
getPlane(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.byte[]
getPlaneDirect(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getPlaneOffset(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.ome.util.PixelData
getPlaneRegion(java.lang.Integer x, java.lang.Integer y, java.lang.Integer width, java.lang.Integer height, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer stride)
Implemented as specified byByteBuffer
I/F.byte[]
getPlaneRegionDirect(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer count, java.lang.Integer offset, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getPlaneSize()
Implemented as specified byPixelBuffer
I/F.ome.util.PixelData
getRegion(java.lang.Integer size, java.lang.Long offset)
Implemented as specified byPixelBuffer
I/F.byte[]
getRegionDirect(java.lang.Integer size, java.lang.Long offset, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.util.List<java.util.List<java.lang.Integer>>
getResolutionDescriptions()
Return a list of lists each of which has sizeX, sizeY for the resolution level matching the index of the outer index.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(java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.byte[]
getRowDirect(java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getRowOffset(java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.java.lang.Integer
getRowSize()
Implemented as specified byPixelBuffer
I/F.java.lang.String
getSha1()
int
getSizeC()
Implemented as specified byPixelBuffer
I/F.int
getSizeT()
Implemented as specified byPixelBuffer
I/F.int
getSizeX()
Implemented as specified byPixelBuffer
I/F.int
getSizeY()
Implemented as specified byPixelBuffer
I/F.int
getSizeZ()
Implemented as specified byPixelBuffer
I/F.ome.util.PixelData
getStack(java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.byte[]
getStackDirect(java.lang.Integer c, java.lang.Integer t, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getStackOffset(java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getStackSize()
Implemented as specified byPixelBuffer
I/F.ome.util.PixelData
getTile(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer x, java.lang.Integer y, java.lang.Integer w, java.lang.Integer h)
Retrieves a tile from this pixel buffer.byte[]
getTileDirect(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer x, java.lang.Integer y, java.lang.Integer w, java.lang.Integer h, byte[] buffer)
Retrieves a tile from this pixel buffer.java.awt.Dimension
getTileSize()
Retrieves the tile size for the pixel store.ome.util.PixelData
getTimepoint(java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.byte[]
getTimepointDirect(java.lang.Integer t, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getTimepointOffset(java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getTimepointSize()
Implemented as specified byPixelBuffer
I/F.java.lang.Long
getTotalSize()
Implemented as specified byPixelBuffer
I/F.boolean
isFloat()
Implemented as specified byPixelBuffer
I/F.boolean
isSigned()
Implemented as specified byPixelBuffer
I/F.static java.lang.Integer
safeLongToInteger(java.lang.Long v)
Converts a Long value to an Integer safely.void
setPlane(byte[] buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.void
setPlane(java.nio.ByteBuffer buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.void
setRegion(java.lang.Integer size, java.lang.Long offset, byte[] buffer)
Implemented as specified byPixelBuffer
I/F.void
setRegion(java.lang.Integer size, java.lang.Long offset, java.nio.ByteBuffer buffer)
Implemented as specified byPixelBuffer
I/F.void
setResolutionLevel(int resolutionLevel)
Sets the active resolution level.void
setRow(java.nio.ByteBuffer buffer, java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.void
setStack(byte[] buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.void
setStack(java.nio.ByteBuffer buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.void
setTile(byte[] buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer x, java.lang.Integer y, java.lang.Integer w, java.lang.Integer h)
Sets a tile in this pixel buffer.void
setTimepoint(byte[] buffer, java.lang.Integer t)
Implemented as specified byPixelBuffer
I/F.void
setTimepoint(java.nio.ByteBuffer buffer, java.lang.Integer t)
Implemented as specified byPixelBuffer
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(java.lang.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(java.lang.String path, ome.model.core.Pixels pixels, boolean permitModification)
Creates a new instance, with manual setting ofpermitModification
.- Parameters:
path
- The path to the file.pixels
- The pixels object to handle.
-
-
Method Detail
-
safeLongToInteger
public static java.lang.Integer safeLongToInteger(java.lang.Long v)
Converts a Long value to an Integer safely.- Parameters:
v
- Long value to convert.- Throws:
ome.conditions.ApiUsageException
- If the conversion would cause an overflow or an underflow.
-
checkBounds
public void checkBounds(java.lang.Integer x, java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
checkBounds
in interfacePixelBuffer
- 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
- ify
,z
,c
ort
is out of bounds.- See Also:
PixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
-
close
public void close() throws java.io.IOException
Closes the buffer, cleaning up file state.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfacePixelBuffer
- Throws:
java.io.IOException
- if an I/O error occurs.
-
getPlaneSize
public java.lang.Long getPlaneSize()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getPlaneSize
in interfacePixelBuffer
- Returns:
- 2D image plane size in bytes (sizeX*sizeY*ByteWidth).
- See Also:
PixelBuffer.getPlaneSize()
-
getRowSize
public java.lang.Integer getRowSize()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getRowSize
in interfacePixelBuffer
- Returns:
- row or scanline size in bytes (sizeX*ByteWidth)
- See Also:
PixelBuffer.getRowSize()
-
getColSize
public java.lang.Integer getColSize()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getColSize
in interfacePixelBuffer
- Returns:
- column size in bytes (sizeY*ByteWidth)
- See Also:
PixelBuffer.getColSize()
-
getStackSize
public java.lang.Long getStackSize()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getStackSize
in interfacePixelBuffer
- Returns:
- stack size in bytes (sizeX*sizeY*sizeZ*ByteWidth).
- See Also:
PixelBuffer.getStackSize()
-
getTimepointSize
public java.lang.Long getTimepointSize()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getTimepointSize
in interfacePixelBuffer
- Returns:
- timepoint size in bytes (sizeX*sizeY*sizeZ*sizeC*ByteWidth).
- See Also:
PixelBuffer.getTimepointSize()
-
getTotalSize
public java.lang.Long getTotalSize()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getTotalSize
in interfacePixelBuffer
- Returns:
- total size of the pixel size in bytes (sizeX*sizeY*sizeZ*sizeC*sizeT*ByteWidth).
- See Also:
PixelBuffer.getTotalSize()
-
getRowOffset
public java.lang.Long getRowOffset(java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getRowOffset
in interfacePixelBuffer
- 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 withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getRowOffset(Integer, Integer, Integer, Integer)
-
getPlaneOffset
public java.lang.Long getPlaneOffset(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getPlaneOffset
in interfacePixelBuffer
- 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 withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getPlaneOffset(Integer, Integer, Integer)
-
getStackOffset
public java.lang.Long getStackOffset(java.lang.Integer c, java.lang.Integer t) throws DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getStackOffset
in interfacePixelBuffer
- 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 withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getStackOffset(Integer, Integer)
-
getTimepointOffset
public java.lang.Long getTimepointOffset(java.lang.Integer t) throws DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getTimepointOffset
in interfacePixelBuffer
- 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 withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getTimepointOffset(Integer)
-
getRegion
public ome.util.PixelData getRegion(java.lang.Integer size, java.lang.Long offset) throws java.io.IOException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getRegion
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.- See Also:
PixelBuffer.getRegion(Integer, Long)
-
getRegionDirect
public byte[] getRegionDirect(java.lang.Integer size, java.lang.Long offset, byte[] buffer) throws java.io.IOException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getRegionDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.- See Also:
PixelBuffer.getRegionDirect(Integer, Long, byte[])
-
getRow
public ome.util.PixelData getRow(java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getRow
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getRow(Integer, Integer, Integer, Integer)
-
getCol
public ome.util.PixelData getCol(java.lang.Integer x, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getCol
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getCol(Integer, Integer, Integer, Integer)
-
getRowDirect
public byte[] getRowDirect(java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, byte[] buffer) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getRowDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getRowDirect(Integer, Integer, Integer, Integer, byte[])
-
getColDirect
public byte[] getColDirect(java.lang.Integer x, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, byte[] buffer) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getColDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getColDirect(Integer, Integer, Integer, Integer, byte[])
-
getHypercube
public ome.util.PixelData getHypercube(java.util.List<java.lang.Integer> offset, java.util.List<java.lang.Integer> size, java.util.List<java.lang.Integer> step) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getHypercube
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- See Also:
PixelBuffer.getHypercube(List, List, List)
-
getHypercubeDirect
public byte[] getHypercubeDirect(java.util.List<java.lang.Integer> offset, java.util.List<java.lang.Integer> size, java.util.List<java.lang.Integer> step, byte[] buffer) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getHypercubeDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- See Also:
PixelBuffer.getHypercubeDirect(List, List, List, byte[])
-
getPlaneRegionDirect
public byte[] getPlaneRegionDirect(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer count, java.lang.Integer offset, byte[] buffer) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getPlaneRegionDirect
in interfacePixelBuffer
- 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 retrievecount
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:
java.io.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(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getPlane
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getPlane(Integer, Integer, Integer)
-
getPlaneRegion
public ome.util.PixelData getPlaneRegion(java.lang.Integer x, java.lang.Integer y, java.lang.Integer width, java.lang.Integer height, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer stride) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byByteBuffer
I/F.- Specified by:
getPlaneRegion
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getPlaneRegion(Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer)
-
getPlaneDirect
public byte[] getPlaneDirect(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, byte[] buffer) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getPlaneDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getPlaneDirect(Integer, Integer, Integer, byte[])
-
getStack
public ome.util.PixelData getStack(java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getStack
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getStack(Integer, Integer)
-
getStackDirect
public byte[] getStackDirect(java.lang.Integer c, java.lang.Integer t, byte[] buffer) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getStackDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getStackDirect(Integer, Integer, byte[])
-
getTimepoint
public ome.util.PixelData getTimepoint(java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getTimepoint
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getTimepoint(Integer)
-
getTimepointDirect
public byte[] getTimepointDirect(java.lang.Integer t, byte[] buffer) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
getTimepointDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.getTimepointDirect(Integer, byte[])
-
setRegion
public void setRegion(java.lang.Integer size, java.lang.Long offset, byte[] buffer) throws java.io.IOException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setRegion
in interfacePixelBuffer
- Parameters:
size
- byte width of the region to set.offset
- offset within the pixel buffer.buffer
- a byte array of the data.- Throws:
java.io.IOException
- if there is a problem writing to the pixel buffer.- See Also:
PixelBuffer.setRegion(Integer, Long, byte[])
-
setRegion
public void setRegion(java.lang.Integer size, java.lang.Long offset, java.nio.ByteBuffer buffer) throws java.io.IOException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setRegion
in interfacePixelBuffer
- Parameters:
size
- byte width of the region to set.offset
- offset within the pixel buffer.buffer
- a byte buffer of the data.- Throws:
java.io.IOException
- if there is a problem writing to the pixel buffer.- See Also:
PixelBuffer.setRegion(Integer, Long, ByteBuffer)
-
setRow
public void setRow(java.nio.ByteBuffer buffer, java.lang.Integer y, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setRow
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.setRow(ByteBuffer, Integer, Integer, Integer, Integer)
-
setPlane
public void setPlane(java.nio.ByteBuffer buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setPlane
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem writing to the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.setPlane(ByteBuffer, Integer, Integer, Integer)
-
setPlane
public void setPlane(byte[] buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setPlane
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem writing to the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.setPlane(byte[], Integer, Integer, Integer)
-
setStack
public void setStack(java.nio.ByteBuffer buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setStack
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem writing to the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.setStack(ByteBuffer, Integer, Integer, Integer)
-
setStack
public void setStack(byte[] buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setStack
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem writing to the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.setStack(byte[], Integer, Integer, Integer)
-
setTimepoint
public void setTimepoint(java.nio.ByteBuffer buffer, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setTimepoint
in interfacePixelBuffer
- Parameters:
buffer
- a byte buffer of the data comprising this timepoint.t
- offset across the T-axis of the pixel buffer.- Throws:
java.io.IOException
- if there is a problem writing to the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.setTimepoint(ByteBuffer, Integer)
-
setTimepoint
public void setTimepoint(byte[] buffer, java.lang.Integer t) throws java.io.IOException, DimensionsOutOfBoundsException
Implemented as specified byPixelBuffer
I/F.- Specified by:
setTimepoint
in interfacePixelBuffer
- Parameters:
buffer
- a byte array of the data comprising this timepoint.t
- offset across the T-axis of the pixel buffer.- Throws:
java.io.IOException
- if there is a problem writing to the pixel buffer.DimensionsOutOfBoundsException
- if offsets are out of bounds after checking withPixelBuffer.checkBounds(Integer, Integer, Integer, Integer, Integer)
.- See Also:
PixelBuffer.setTimepoint(ByteBuffer, Integer)
-
calculateMessageDigest
public byte[] calculateMessageDigest() throws java.io.IOException
Implemented as specified byPixelBuffer
I/F.- Specified by:
calculateMessageDigest
in interfacePixelBuffer
- Returns:
- byte array containing the message digest.
- Throws:
java.io.IOException
- if there is a problem reading from the pixel buffer.- See Also:
PixelBuffer.calculateMessageDigest()
-
getByteWidth
public int getByteWidth()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getByteWidth
in interfacePixelBuffer
- Returns:
- See above.
- See Also:
PixelBuffer.getByteWidth()
-
isSigned
public boolean isSigned()
Implemented as specified byPixelBuffer
I/F.- Specified by:
isSigned
in interfacePixelBuffer
- Returns:
- See above.
- See Also:
PixelBuffer.isSigned()
-
isFloat
public boolean isFloat()
Implemented as specified byPixelBuffer
I/F.- Specified by:
isFloat
in interfacePixelBuffer
- Returns:
true
if the pixel buffer as floating point,false
otherwise- See Also:
PixelBuffer.isFloat()
-
getSizeC
public int getSizeC()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getSizeC
in interfacePixelBuffer
- See Also:
PixelBuffer.getSizeC()
-
getSizeT
public int getSizeT()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getSizeT
in interfacePixelBuffer
- See Also:
PixelBuffer.getSizeT()
-
getSizeX
public int getSizeX()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getSizeX
in interfacePixelBuffer
- See Also:
PixelBuffer.getSizeX()
-
getSizeY
public int getSizeY()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getSizeY
in interfacePixelBuffer
- See Also:
PixelBuffer.getSizeY()
-
getSizeZ
public int getSizeZ()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getSizeZ
in interfacePixelBuffer
- See Also:
PixelBuffer.getSizeZ()
-
getId
public long getId()
Implemented as specified byPixelBuffer
I/F.- Specified by:
getId
in interfacePixelBuffer
- See Also:
PixelBuffer.getId()
-
getSha1
public java.lang.String getSha1()
-
getTile
public ome.util.PixelData getTile(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer x, java.lang.Integer y, java.lang.Integer w, java.lang.Integer h) throws java.io.IOException
Description copied from interface:PixelBuffer
Retrieves a tile from this pixel buffer.- Specified by:
getTile
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.- See Also:
PixelBuffer.getTileDirect(Integer, Integer, Integer, Integer, Integer, Integer, Integer, byte[])
-
getTileDirect
public byte[] getTileDirect(java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer x, java.lang.Integer y, java.lang.Integer w, java.lang.Integer h, byte[] buffer) throws java.io.IOException
Description copied from interface:PixelBuffer
Retrieves a tile from this pixel buffer.- Specified by:
getTileDirect
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem reading from the pixel buffer.- See Also:
PixelBuffer.getTile(Integer, Integer, Integer, Integer, Integer, Integer, Integer)
-
setTile
public void setTile(byte[] buffer, java.lang.Integer z, java.lang.Integer c, java.lang.Integer t, java.lang.Integer x, java.lang.Integer y, java.lang.Integer w, java.lang.Integer h) throws java.io.IOException, java.nio.BufferOverflowException
Description copied from interface:PixelBuffer
Sets a tile in this pixel buffer.- Specified by:
setTile
in interfacePixelBuffer
- 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:
java.io.IOException
- if there is a problem writing to the pixel buffer.java.nio.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 interfacePixelBuffer
- Returns:
- The active resolution level. The level will be non-negative and less
than
PixelBuffer.getResolutionLevels()
. Resolution level 0 is the smallest resolution and resolution levelgetResolutionLevels() - 1
is the largest resolution. This is the inverse of how Bio-Formats indexes resolutions.
-
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 interfacePixelBuffer
- Returns:
- The number of resolution levels. This value does not necessarily indicate either the presence or absence of a pixels pyramid.
-
getResolutionDescriptions
public java.util.List<java.util.List<java.lang.Integer>> getResolutionDescriptions()
Description copied from interface:PixelBuffer
Return a list of lists each of which has sizeX, sizeY for the resolution level matching the index of the outer index. For example, if an image has 2 resolution levels of size 2048x1024 and 1024x512 then this returns: [[2048,1024],[1024,512]]- Specified by:
getResolutionDescriptions
in interfacePixelBuffer
- Returns:
- a list of lists containing sizeX, sizeY for each resolution level
-
getTileSize
public java.awt.Dimension getTileSize()
Description copied from interface:PixelBuffer
Retrieves the tile size for the pixel store.- Specified by:
getTileSize
in interfacePixelBuffer
- 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 interfacePixelBuffer
- Parameters:
resolutionLevel
- The resolution level to be used by the pixel buffer. The level should be non-negative and less thanPixelBuffer.getResolutionLevels()
. Resolution level 0 is the smallest resolution and resolution levelgetResolutionLevels() - 1
is the largest resolution. This is the inverse of how Bio-Formats indexes resolutions.
-
getHypercubeSize
public java.lang.Long getHypercubeSize(java.util.List<java.lang.Integer> offset, java.util.List<java.lang.Integer> size, java.util.List<java.lang.Integer> step) throws DimensionsOutOfBoundsException
Description copied from interface:PixelBuffer
Retrieves a the size of a hypercube from this pixel buffer.- Specified by:
getHypercubeSize
in interfacePixelBuffer
- 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
-
-