public class HDF5File
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected H5File |
hdf_file_format |
protected H5Group |
hdf_file_root_group |
protected javax.swing.tree.DefaultMutableTreeNode |
hdf_file_root_node |
static int |
MAX_NUM_CACHED_OBJECTS |
static int |
MAX_NUM_CACHED_OBJECTS_KINETOGRAM |
Modifier | Constructor and Description |
---|---|
protected |
HDF5File(java.io.File file,
int access,
int num_cached_objects) |
Modifier and Type | Method and Description |
---|---|
protected H5ScalarDS |
createEmptyDataset(java.lang.String name,
H5Group pGroup,
H5Datatype data_type,
long[] dims,
long[] chunks)
Creates empty scalar dataset of specific type.
|
H5ScalarDS |
createFilledDataset(java.lang.String name,
H5Group pGroup,
H5Datatype data_type,
long[] dims,
long[] chunks,
java.lang.Object data)
Creates scalar dataset of specific type.
|
H5Group |
createGroup(java.lang.String group_name,
H5Group parent)
Creates a new group under a parent group
|
void |
dispose()
this method must be called after using the file
|
protected java.util.List<?> |
getAllAttributes(DataFormat data)
returns all attributes in dataset or group
|
protected java.util.List<H5ScalarDS> |
getAllChildDatasets(H5Group parent_group)
Searches a parent group for all child datasets
|
protected java.util.List<H5Group> |
getAllChildGroups(H5Group parent_group)
Searches a parent group for all child groups
|
protected float[] |
getAttributeFloatValues(DataFormat data,
java.lang.String target_attribute_name)
Returns array of floating point values from single named attribute
|
protected long[] |
getAttributeLongValues(DataFormat data,
java.lang.String target_attribute_name)
Returns array of longs from single named attribute
Use when HObject element has either int, uint or long attribute with multiple values
|
protected java.lang.String[] |
getAttributeStringValues(DataFormat data,
java.lang.String target_attribute_name)
Returns array of strings from single named attribute
Use when HObject element has a String attribute with multiple values
|
protected H5ScalarDS |
getChildDataset(H5Group parent_group,
java.lang.String child_dataset_name)
Searches a parent group for a named child dataset
|
protected H5Group |
getChildGroup(H5Group parent_group,
java.lang.String child_group_name)
Searches a parent group for a named child group
|
H5ScalarDS |
getDataset(java.lang.String dataset_path)
Searches for a dataset by fully qualified path
|
protected HDF5ChunkInfo |
getDatasetChunkInfo(H5ScalarDS dataset)
Gets chunking info, if chunking was used, of this datasets
|
HDF5HyperslabInfo |
getDatasetHyperslabInfo(H5ScalarDS dataset)
This method returns the default hyperslab selection parameters of the dataset.
|
boolean |
getDataStreamFromDataset(H5ScalarDS dataset,
long start_row,
long end_row,
StreamingDataConsumer consumer)
Main method for random access streaming of data.
|
H5File |
getFileHandle() |
java.lang.String |
getFilePath() |
protected java.lang.Object |
getGroup(java.lang.String group_path)
Searches for a group by fully qualified path
|
protected java.lang.Object |
getNamedRootObject(java.lang.String named_object)
Searches for a named H5Group or H5ScalarDS object located on the root of
the hdf5 hierarchy
|
protected UCharMatrixArray |
getUCharDataChunk(H5ScalarDS dataset,
HDF5HyperslabInfo info)
Reads a chunk of UChar data from a dataset.
|
protected UIntMatrixArray |
getUIntDataChunk(H5ScalarDS dataset,
HDF5HyperslabInfo info)
Reads a chunk of UInt data from a dataset.
|
protected java.lang.Object |
readDatasetHyperslab(H5ScalarDS dataset,
HDF5HyperslabInfo info)
Reads the data from file to a memory buffer and returns the memory buffer.
|
protected java.lang.Object |
readUnsignedDatasetHyperslab(H5ScalarDS dataset,
HDF5HyperslabInfo info)
A convenient but not memory-efficient method to read a hyperslab of unsigned integers.
|
protected void |
testPrintDatasetInfo(H5ScalarDS dataset)
test only method, dumps dataset info
|
java.lang.String |
toString() |
void |
writeChunkToDataset(H5ScalarDS dataset,
HDF5HyperslabInfo info,
java.lang.Object data)
Writes a block of data to the selected dataset.
|
boolean |
writeStringAttribute(HObject h_object,
java.lang.String attribute_name,
java.lang.String value)
Creates a new String attribute in the specified group or dataset and writes
the passed in value.
|
boolean |
writeUIntAttribute(HObject h_object,
java.lang.String attribute_name,
long value)
Creates a new UInt attribute in the specified group or dataset and writes
the passed in value
|
protected H5File hdf_file_format
protected javax.swing.tree.DefaultMutableTreeNode hdf_file_root_node
protected H5Group hdf_file_root_group
public static final int MAX_NUM_CACHED_OBJECTS
public static final int MAX_NUM_CACHED_OBJECTS_KINETOGRAM
protected HDF5File(java.io.File file, int access, int num_cached_objects) throws HDF5ExceptionEx
file
- name of HDF5 fileaccess
- mode: FileFormat.READ, FileFormat.WRITE, FileFormat.CREATEjava.io.FileNotFoundException
HDF5ExceptionEx
protected java.lang.Object getNamedRootObject(java.lang.String named_object)
named_object
- name of object to findprotected java.lang.Object getGroup(java.lang.String group_path)
group_path
- full path to group to search forpublic H5ScalarDS getDataset(java.lang.String dataset_path)
dataset_path
- full path to dataset to search forprotected H5Group getChildGroup(H5Group parent_group, java.lang.String child_group_name)
parent_group
- the group to search for desired objectchild_group_name
- the name of child group to retrieveprotected H5ScalarDS getChildDataset(H5Group parent_group, java.lang.String child_dataset_name)
parent_group
- the group to search for desired objectchild_dataset_name
- the name of child dataset to retrieveprotected java.util.List<H5Group> getAllChildGroups(H5Group parent_group)
parent_group
- the group to search for desired objectsprotected java.util.List<H5ScalarDS> getAllChildDatasets(H5Group parent_group)
parent_group
- the group to search for desired objectsprotected java.util.List<?> getAllAttributes(DataFormat data)
data
- element to search forprotected java.lang.String[] getAttributeStringValues(DataFormat data, java.lang.String target_attribute_name)
target_attribute_name
- name of attribute to get values fromdata
- element to search forprotected long[] getAttributeLongValues(DataFormat data, java.lang.String target_attribute_name)
target_attribute_name
- name of attribute to get values fromdata
- element to search forprotected float[] getAttributeFloatValues(DataFormat data, java.lang.String target_attribute_name)
target_attribute_name
- name of attribute to get values fromdata
- element to search forpublic HDF5HyperslabInfo getDatasetHyperslabInfo(H5ScalarDS dataset)
dataset
- public boolean getDataStreamFromDataset(H5ScalarDS dataset, long start_row, long end_row, StreamingDataConsumer consumer)
dataset
- start_row
- 0-based index of first data row to retrieveend_row
- 0-based index of last data row to retrieveconsumer
- the instance of streamingdataconsumer that will receive data in chunksprotected UIntMatrixArray getUIntDataChunk(H5ScalarDS dataset, HDF5HyperslabInfo info)
ncsa.hdf.object.ScalarDS.convertFromUnsignedC()
protected UCharMatrixArray getUCharDataChunk(H5ScalarDS dataset, HDF5HyperslabInfo info)
ncsa.hdf.object.ScalarDS.convertFromUnsignedC()
public H5Group createGroup(java.lang.String group_name, H5Group parent)
group_name
- name of new groupparent
- Parent group where the new group will be created. Null if new group should be created on rootpublic H5ScalarDS createFilledDataset(java.lang.String name, H5Group pGroup, H5Datatype data_type, long[] dims, long[] chunks, java.lang.Object data)
name
- name of new datasetpGroup
- parent groupdata_type
- data type for datasetdims
- dimensions of datasetchunks
- chuinking infodata
- data to writeprotected H5ScalarDS createEmptyDataset(java.lang.String name, H5Group pGroup, H5Datatype data_type, long[] dims, long[] chunks)
name
- name of new datasetpGroup
- parent groupdata_type
- data type for datasetdims
- dimensions of datasetchunks
- chunking infopublic boolean writeUIntAttribute(HObject h_object, java.lang.String attribute_name, long value)
h_object
- group or dataset to write toattribute_name
- name of new attributevalue
- the value of the attributepublic boolean writeStringAttribute(HObject h_object, java.lang.String attribute_name, java.lang.String value)
h_object
- group or dataset to write toattribute_name
- name of new attributevalue
- the value of the attributepublic void writeChunkToDataset(H5ScalarDS dataset, HDF5HyperslabInfo info, java.lang.Object data)
dataset
- to write toinfo
- hyperslab to write to diskdata
- chunk of data to be writtenprotected java.lang.Object readDatasetHyperslab(H5ScalarDS dataset, HDF5HyperslabInfo info)
dataset
- scalar dataset to read data frominfo
- requested data subsetprotected java.lang.Object readUnsignedDatasetHyperslab(H5ScalarDS dataset, HDF5HyperslabInfo info)
dataset
- scalar dataset to read data frominfo
- requested data subsetreadDatasetHyperslab(H5ScalarDS dataset, HDF5HyperslabInfo info)
public void dispose()
public java.lang.String getFilePath()
public H5File getFileHandle()
public java.lang.String toString()
toString
in class java.lang.Object
protected HDF5ChunkInfo getDatasetChunkInfo(H5ScalarDS dataset)
dataset
- protected void testPrintDatasetInfo(H5ScalarDS dataset)
dataset
- Copyright © 2010-2014 Pacific Biosciences. All Rights Reserved.