public class JHDFServiceImpl extends loci.common.services.AbstractService implements JHDFService
Modifier and Type | Field and Description |
---|---|
private 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 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(String path)
Writes an array as sub-slice into an existing HDF5 dataset
|
boolean |
exists(String path)
Checks if path in HDF5 file exists.
|
int |
getElementSize(String path)
Retrieves the Element Size of a dataset in Byte.
|
String |
getFile()
Retrieves the current initialized file path.
|
List<String> |
getMember(String path)
Retrieves the all members of a group.
|
int[] |
getShape(String path)
Retrieves the shape of a dataset.
|
void |
initIntArray(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(String path)
Reads a multi-dimensional byte array from path.
|
ch.systemsx.cisd.base.mdarray.MDByteArray |
readByteBlockArray(String path,
int[] offset,
int[] size)
Reads a multi-dimensional sub-block byte array from path.
|
ch.systemsx.cisd.hdf5.HDF5CompoundDataMap[] |
readCompoundArrayDataMap(String path)
Reads Compound array of any type
|
ch.systemsx.cisd.base.mdarray.MDIntArray |
readIntArray(String path)
Reads a multi-dimensional int array from path.
|
ch.systemsx.cisd.base.mdarray.MDIntArray |
readIntBlockArray(String path,
int[] offset,
int[] size)
Reads a multi-dimensional sub-block int array from path.
|
ch.systemsx.cisd.base.mdarray.MDShortArray |
readShortBlockArray(String path,
int[] offset,
int[] size)
Reads a multi-dimensional sub-block short array from path.
|
String[] |
readStringArray(String path)
Reads String array array from path.
|
void |
setFile(String file)
Initializes the service on a given file path.
|
void |
setFileForWrite(String file)
Initializes the service on a given file path.
|
void |
writeArraySlice(String path,
ch.systemsx.cisd.base.mdarray.MDByteArray image,
long[] offset)
Writes an array as sub-slice into an existing HDF5 dataset
|
void |
writeArraySlice(String path,
ch.systemsx.cisd.base.mdarray.MDIntArray image,
long[] offset)
Writes an array as sub-slice into an existing HDF5 dataset
|
void |
writeArraySlice(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 String NO_JHDF_MSG
private String currentFile
private ch.systemsx.cisd.hdf5.IHDF5Reader hdfReader
private ch.systemsx.cisd.hdf5.IHDF5Writer hdfWriter
public void setFile(String file) throws IOException
JHDFService
setFile
in interface JHDFService
file
- Path to initialize the service with.IOException
- If there is an error initializing the service with
file
.public void setFileForWrite(String file) throws IOException
JHDFService
setFileForWrite
in interface JHDFService
file
- Path to initialize the service with.IOException
- If there is an error initializing the service with
file
.public String getFile()
JHDFService
getFile
in interface JHDFService
null
if the service
has yet to be initialized or is closed.public List<String> getMember(String path)
JHDFService
getMember
in interface JHDFService
path
- HDF path to the group.public int[] getShape(String path)
JHDFService
getShape
in interface JHDFService
path
- HDF path to the dataset.public ch.systemsx.cisd.base.mdarray.MDByteArray readByteArray(String path)
JHDFService
readByteArray
in interface JHDFService
path
- HDF path to the dataset.public ch.systemsx.cisd.base.mdarray.MDIntArray readIntArray(String path)
JHDFService
readIntArray
in interface JHDFService
path
- HDF path to the dataset.public ch.systemsx.cisd.base.mdarray.MDIntArray readIntBlockArray(String path, int[] offset, int[] size)
JHDFService
readIntBlockArray
in interface JHDFService
path
- 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(String path, int[] offset, int[] size)
JHDFService
readByteBlockArray
in interface JHDFService
path
- 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(String path, int[] offset, int[] size)
JHDFService
readShortBlockArray
in interface JHDFService
path
- HDF path to the dataset.offset
- Offset of the block to read.size
- Output size of the array.public String[] readStringArray(String path)
JHDFService
readStringArray
in interface JHDFService
path
- HDF path to the dataset.public ch.systemsx.cisd.hdf5.HDF5CompoundDataMap[] readCompoundArrayDataMap(String path)
JHDFService
readCompoundArrayDataMap
in interface JHDFService
path
- HDF path to the dataset.public int getElementSize(String path)
JHDFService
getElementSize
in interface JHDFService
path
- HDF path to the group.public void initIntArray(String path, long[] dimensions, long bpp)
JHDFService
initIntArray
in interface JHDFService
path
- 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(String path, ch.systemsx.cisd.base.mdarray.MDByteArray image, long[] offset)
JHDFService
writeArraySlice
in interface JHDFService
path
- 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(String path, ch.systemsx.cisd.base.mdarray.MDShortArray image, long[] offset)
JHDFService
writeArraySlice
in interface JHDFService
path
- 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(String path, ch.systemsx.cisd.base.mdarray.MDIntArray image, long[] offset)
JHDFService
writeArraySlice
in interface JHDFService
path
- 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(String path) throws IOException
JHDFService
createGroup
in interface JHDFService
path
- path of the HDF5 group.IOException
public boolean exists(String path)
JHDFService
exists
in interface JHDFService
path
- path to HDF5 group or dataset.public void close() throws IOException
JHDFService
close
in interface JHDFService
IOException
- If there is an error closing the file.Copyright © 2017 Open Microscopy Environment