IUF-SDK-3
Interventional Ultrasound Library
iufHDF5.c File Reference
#include <stdio.h>
#include <string.h>
#include <hdf5.h>
#include <hdf5_hl.h>
#include <iuf.h>

Functions

herr_t iufHdf5ReadFloat (hid_t handle, const char *pVariableString, float *pValue)
 Reads one or an array of floats from file stored in the variable pVariableString. More...
 
herr_t iufHdf5ReadShort (hid_t handle, const char *pVariableString, short *pValue)
 Reads one or an array of shorts from file stored in the variable pVariableString. More...
 
herr_t iufHdf5ReadInt (hid_t handle, const char *pVariableString, int *pValue)
 Reads one or an array of ints from file stored in the variable pVariableString. More...
 
herr_t iufHdf5ReadLong (hid_t handle, const char *pVariableString, long int *pValue)
 Reads one or an array of longs from file stored in the variable pVariableString. More...
 
herr_t iufHdf5ReadString (hid_t handle, const char *pVariableString, char *ppReturnString)
 Reads a string from file stored in the variable pVariableString. More...
 
herr_t iufHdf5ReadGridSize (hid_t handle, const char *pGridName, int *pDim0, int *pDim1, int *pDim2)
 
herr_t iufHdf5ReadGrid (hid_t handle, const char *pGridName, IufGrid *pGrid)
 Reads the grid from file that is defined by pGridName. More...
 
herr_t iufHdf5WriteFloat (hid_t handle, const char *pVariableString, float *pValues, int numValues)
 Writes one or an array of floats to an Hdf5 handle. More...
 
herr_t iufHdf5WriteInt (hid_t handle, const char *pVariableString, int *pValues, int numValues)
 Writes one or an array of int values to an Hdf5 handle. More...
 
herr_t iufHdf5WriteLong (hid_t handle, const char *pVariableString, long *pValues, int numValues)
 Writes one or an array of long values to an Hdf5 handle. More...
 
herr_t iufHdf5WriteString (hid_t handle, const char *pVariableString, const char *pString)
 Writes a string to an Hdf5 handle. More...
 
herr_t iufHdf5WriteGrid (hid_t handle, const char *pGridName, IufGrid *pGrid)
 Writes a grid to an Hdf5 handle. More...
 

Function Documentation

◆ iufHdf5ReadFloat()

herr_t iufHdf5ReadFloat ( hid_t  handle,
const char *  pVariableString,
float *  pValue 
)

Reads one or an array of floats from file stored in the variable pVariableString.

Precondition
Memory is allocated for pValue, the Hdf5 file has been opened
Postcondition
pValue contains the float(s)
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle containing the variable to be read
pVariableStringthe name of the variable to be read
[out]pValuethe float value or array read from file

◆ iufHdf5ReadGrid()

herr_t iufHdf5ReadGrid ( hid_t  handle,
const char *  pGridName,
IufGrid pGrid 
)

Reads the grid from file that is defined by pGridName.

The grid can be a Polar or Cartesian grid. The grid type is identified by the variable name containing either 'Cartesian' or 'Polar'

Precondition
The Hdf5 file is opened, no memory is allocated yet for the grid arrays, but the grid struct is allocated
Postcondition
*pGrid contains the grid data. Its memory is created and needs to be freed separately
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle containing the dataset to be
pGridNamethe name of the variable to be read
[out]pGridthe grid structure that is filled (memory is allocated for its contents)

◆ iufHdf5ReadGridSize()

herr_t iufHdf5ReadGridSize ( hid_t  handle,
const char *  pGridName,
int *  pDim0,
int *  pDim1,
int *  pDim2 
)

◆ iufHdf5ReadInt()

herr_t iufHdf5ReadInt ( hid_t  handle,
const char *  pVariableString,
int *  pValue 
)

Reads one or an array of ints from file stored in the variable pVariableString.

Precondition
Memory is allocated for pValue, the Hdf5 file has been opened
Postcondition
pValue contains the int(s)
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle containing the variable to be read
pVariableStringthe name of the variable to be read
[out]pValuethe int value or array that is read from file

◆ iufHdf5ReadLong()

herr_t iufHdf5ReadLong ( hid_t  handle,
const char *  pVariableString,
long int *  pValue 
)

Reads one or an array of longs from file stored in the variable pVariableString.

Precondition
Memory is allocated for pValue, the Hdf5 file has been opened
Postcondition
pValue contains the long int(s)
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle containing the variable to be read
pVariableStringthe name of the variable to be read
[out]pValuethe long int value or array that is read from file

◆ iufHdf5ReadShort()

herr_t iufHdf5ReadShort ( hid_t  handle,
const char *  pVariableString,
short *  pValue 
)

Reads one or an array of shorts from file stored in the variable pVariableString.

Precondition
Memory is allocated for pValue, the Hdf5 file has been opened
Postcondition
pValue contains the int(s)
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle containing the
pVariableStringthe name of the variable to be read variable to be read
[out]pValuethe short value or array that is read from file

◆ iufHdf5ReadString()

herr_t iufHdf5ReadString ( hid_t  handle,
const char *  pVariableString,
char *  ppReturnString 
)

Reads a string from file stored in the variable pVariableString.

Precondition
The Hdf5 file is opened, no memory is allocated yet for the return string
Postcondition
*ppReturnString contains the string (char *). Its memory is created and needs to be freed separately
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle containing the variable to be read
pVariableStringthe name of the variable to be read
[out]ppReturnStringthe string (memory is allocated for it)

◆ iufHdf5WriteFloat()

herr_t iufHdf5WriteFloat ( hid_t  handle,
const char *  pVariableString,
float *  pValues,
int  numValues 
)

Writes one or an array of floats to an Hdf5 handle.

Precondition
array with values was allocated and initialized
Postcondition
values have been written to Hdf5 handle
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle for writing
pVariableStringthe name of the variable to be written
pValuesthe float value or array that is to be written
numValuesThe length of the pValues array

◆ iufHdf5WriteGrid()

herr_t iufHdf5WriteGrid ( hid_t  handle,
const char *  pGridName,
IufGrid pGrid 
)

Writes a grid to an Hdf5 handle.

The grid can be a Polar or Cartesian grid. The grid type is identified by the variable name containing either 'Cartesian' or 'Polar'

In-place: n.a.

Precondition
The Hdf5 file is opened, no memory is allocated yet for the grid arrays, but the grid struct is allocated
Postcondition
*pGrid contains the grid data. Its memory is created and needs to be freed separately
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle containing the dataset to be written
pGridName"PolarGrid" or "CartesianGrid"
pGridthe grid structure that will be serialized

◆ iufHdf5WriteInt()

herr_t iufHdf5WriteInt ( hid_t  handle,
const char *  pVariableString,
int *  pValues,
int  numValues 
)

Writes one or an array of int values to an Hdf5 handle.

In-place: n.a.

Precondition
array with values was allocated and initialized
Postcondition
values have been written to Hdf5 handle
Returns
the HDF5 error status of the reading
Parameters
handlehandle : the file or group handle for writing
pVariableStringthe name of the variable to be written
pValuesthe int value or array that is to be written
numValuesThe length of the pValues array

◆ iufHdf5WriteLong()

herr_t iufHdf5WriteLong ( hid_t  handle,
const char *  pVariableString,
long *  pValues,
int  numValues 
)

Writes one or an array of long values to an Hdf5 handle.

In-place: n.a.

Precondition
array with values was allocated and initialized
Postcondition
values have been written to Hdf5 handle
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle for writing
pVariableStringthe name of the variable to be written
pValuesthe long value or array that is to be written
numValuesthe length of the pValues array

◆ iufHdf5WriteString()

herr_t iufHdf5WriteString ( hid_t  handle,
const char *  pVariableString,
const char *  pString 
)

Writes a string to an Hdf5 handle.

In-place: n.a.

Precondition
string was created and initialized
Postcondition
string has been written to Hdf5 handle
Returns
the HDF5 error status of the reading
Parameters
handlethe file or group handle for writing
pVariableStringthe name of the string to be written
pStringthe actual string itself that is to be written