public class JHDFServiceImpl extends loci.common.services.AbstractService implements JHDFService
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
currentFile |
private ch.systemsx.cisd.hdf5.IHDF5Reader |
hdfReader
Root of the HDF5 file.
|
private ch.systemsx.cisd.hdf5.IHDF5Writer |
hdfWriter
Root of the HDF5 file.
|
static java.lang.String |
NO_JHDF_MSG |
| Constructor and Description |
|---|
JHDFServiceImpl()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes and resets the service.
|
void |
createGroup(java.lang.String path)
Writes an array as sub-slice into an existing HDF5 dataset
|
boolean |
exists(java.lang.String path)
Checks if path in HDF5 file exists.
|
int |
getElementSize(java.lang.String path)
Retrieves the Element Size of a dataset in Byte.
|
java.lang.String |
getFile()
Retrieves the current initialized file path.
|
java.util.List<java.lang.String> |
getMember(java.lang.String path)
Retrieves the all members of a group.
|
int[] |
getShape(java.lang.String path)
Retrieves the shape of a dataset.
|
void |
initIntArray(java.lang.String path,
long[] dimensions,
long bpp)
Creates an HDF5 dataset in path consisting of integers specified
by bytes per pixel bpp.
|
ch.systemsx.cisd.base.mdarray.MDByteArray |
readByteArray(java.lang.String path)
Reads a multi-dimensional byte array from path.
|
ch.systemsx.cisd.base.mdarray.MDByteArray |
readByteBlockArray(java.lang.String path,
int[] offset,
int[] size)
Reads a multi-dimensional sub-block byte array from path.
|
ch.systemsx.cisd.hdf5.HDF5CompoundDataMap[] |
readCompoundArrayDataMap(java.lang.String path)
Reads Compound array of any type
|
ch.systemsx.cisd.base.mdarray.MDIntArray |
readIntArray(java.lang.String path)
Reads a multi-dimensional int array from path.
|
ch.systemsx.cisd.base.mdarray.MDIntArray |
readIntBlockArray(java.lang.String path,
int[] offset,
int[] size)
Reads a multi-dimensional sub-block int array from path.
|
ch.systemsx.cisd.base.mdarray.MDShortArray |
readShortBlockArray(java.lang.String path,
int[] offset,
int[] size)
Reads a multi-dimensional sub-block short array from path.
|
java.lang.String[] |
readStringArray(java.lang.String path)
Reads String array array from path.
|
void |
setFile(java.lang.String file)
Initializes the service on a given file path.
|
void |
setFileForWrite(java.lang.String file)
Initializes the service on a given file path.
|
void |
writeArraySlice(java.lang.String path,
ch.systemsx.cisd.base.mdarray.MDByteArray image,
long[] offset)
Writes an array as sub-slice into an existing HDF5 dataset
|
void |
writeArraySlice(java.lang.String path,
ch.systemsx.cisd.base.mdarray.MDIntArray image,
long[] offset)
Writes an array as sub-slice into an existing HDF5 dataset
|
void |
writeArraySlice(java.lang.String path,
ch.systemsx.cisd.base.mdarray.MDShortArray image,
long[] offset)
Writes an array as sub-slice into an existing HDF5 dataset
|
public static final java.lang.String NO_JHDF_MSG
private java.lang.String currentFile
private ch.systemsx.cisd.hdf5.IHDF5Reader hdfReader
private ch.systemsx.cisd.hdf5.IHDF5Writer hdfWriter
public void setFile(java.lang.String file)
throws java.io.IOException
JHDFServicesetFile in interface JHDFServicefile - Path to initialize the service with.java.io.IOException - If there is an error initializing the service with
file.public void setFileForWrite(java.lang.String file)
throws java.io.IOException
JHDFServicesetFileForWrite in interface JHDFServicefile - Path to initialize the service with.java.io.IOException - If there is an error initializing the service with
file.public java.lang.String getFile()
JHDFServicegetFile in interface JHDFServicenull if the service
has yet to be initialized or is closed.public java.util.List<java.lang.String> getMember(java.lang.String path)
JHDFServicegetMember in interface JHDFServicepath - HDF path to the group.public int[] getShape(java.lang.String path)
JHDFServicegetShape in interface JHDFServicepath - HDF path to the dataset.public ch.systemsx.cisd.base.mdarray.MDByteArray readByteArray(java.lang.String path)
JHDFServicereadByteArray in interface JHDFServicepath - HDF path to the dataset.public ch.systemsx.cisd.base.mdarray.MDIntArray readIntArray(java.lang.String path)
JHDFServicereadIntArray in interface JHDFServicepath - HDF path to the dataset.public ch.systemsx.cisd.base.mdarray.MDIntArray readIntBlockArray(java.lang.String path,
int[] offset,
int[] size)
JHDFServicereadIntBlockArray in interface JHDFServicepath - HDF path to the dataset.offset - Offset of the block to read.size - Output size of the array.public ch.systemsx.cisd.base.mdarray.MDByteArray readByteBlockArray(java.lang.String path,
int[] offset,
int[] size)
JHDFServicereadByteBlockArray in interface JHDFServicepath - HDF path to the dataset.offset - Offset of the block to read.size - Output size of the array.public ch.systemsx.cisd.base.mdarray.MDShortArray readShortBlockArray(java.lang.String path,
int[] offset,
int[] size)
JHDFServicereadShortBlockArray in interface JHDFServicepath - HDF path to the dataset.offset - Offset of the block to read.size - Output size of the array.public java.lang.String[] readStringArray(java.lang.String path)
JHDFServicereadStringArray in interface JHDFServicepath - HDF path to the dataset.public ch.systemsx.cisd.hdf5.HDF5CompoundDataMap[] readCompoundArrayDataMap(java.lang.String path)
JHDFServicereadCompoundArrayDataMap in interface JHDFServicepath - HDF path to the dataset.public int getElementSize(java.lang.String path)
JHDFServicegetElementSize in interface JHDFServicepath - HDF path to the group.public void initIntArray(java.lang.String path,
long[] dimensions,
long bpp)
JHDFServiceinitIntArray in interface JHDFServicepath - path to HDF5 a dataset.bpp - bytes per pixel for the integer data type
bpp \in {1,2,4} == {Byte, Short, Integer}public void writeArraySlice(java.lang.String path,
ch.systemsx.cisd.base.mdarray.MDByteArray image,
long[] offset)
JHDFServicewriteArraySlice in interface JHDFServicepath - path to the (existing) HDF5 dataset.image - the data stored as MDArray of pixel type Byteoffset - dimensions, where to start writing the image. The image
will be written from offset to offset + image.dimensions()public void writeArraySlice(java.lang.String path,
ch.systemsx.cisd.base.mdarray.MDShortArray image,
long[] offset)
JHDFServicewriteArraySlice in interface JHDFServicepath - path to the (existing) HDF5 dataset.image - the data stored as MDArray of pixel type Shortoffset - dimensions, where to start writing the image. The image
will be written from offset to offset + image.dimensions()public void writeArraySlice(java.lang.String path,
ch.systemsx.cisd.base.mdarray.MDIntArray image,
long[] offset)
JHDFServicewriteArraySlice in interface JHDFServicepath - path to the (existing) HDF5 dataset.image - the data stored as MDArray of pixel type intoffset - dimensions, where to start writing the image. The image
will be written from offset to offset + image.dimensions()public void createGroup(java.lang.String path)
throws java.io.IOException
JHDFServicecreateGroup in interface JHDFServicepath - path of the HDF5 group.java.io.IOExceptionpublic boolean exists(java.lang.String path)
JHDFServiceexists in interface JHDFServicepath - path to HDF5 group or dataset.public void close()
throws java.io.IOException
JHDFServiceclose in interface JHDFServicejava.io.IOException - If there is an error closing the file.Copyright © 2023 Open Microscopy Environment