IUF-SDK-3
Interventional Ultrasound Library
iufIqFile.c File Reference
#include <stdlib.h>
#include <string.h>
#include <iuf.h>
#include <iufAcquisitionPrivate.h>
#include <iufDataStreamDictPrivate.h>
#include <iufFrameListPrivate.h>
#include <iufHistoryNodePrivate.h>
#include <iufIqFilePrivate.h>
#include <iufIqFileStructure.h>
#include <iufIqPatternListDictPrivate.h>
#include <iufPulseDictPrivate.h>
#include <iufReceiveChannelMapDictPrivate.h>
#include <iufDemodulationDictPrivate.h>
#include <iufSourceDictPrivate.h>
#include <iufTransducerPrivate.h>
#include <iufTransmitApodizationDictPrivate.h>

Data Structures

struct  IufIqFileInstance
 
struct  IufIqFile
 

Macros

#define IUF_IQ_COMPONENT_I   0
 
#define IUF_IQ_COMPONENT_Q   1
 

Functions

iuiqfi_t iufIqFileInstanceCreate (void)
 
int iufIqFileInstanceDelete (iuiqfi_t instance)
 
int iufIqFileDelete (iuiqf_t iqFile)
 Creates a datablock for a single channel (i.e. numSamplesPerLine floats) for the acquisition with the name label. More...
 
iuiqf_t iufIqFileCreate (const char *filename)
 Create an empty file instance with a filename. More...
 
int iufIqFileGetNumFrames (iuiqf_t iqFile)
 Returns the number of frames an iqFile has. More...
 
int iufIqFileGetNumChannels (iuiqf_t iqFile, char *label)
 Gets the number of channels for the patternList type label. More...
 
int iufIqFileGetSamplesPerLine (iuiqf_t iqFile, char *label)
 Gets the number of samples per line for this label. More...
 
int iufIqFileGetNumResponses (iuiqf_t iqFile, char *label)
 Gets the number of responses for the patternList type label. More...
 
iud_t iufIqFileFrameCreate (iuiqf_t iqFile, char *label)
 Creates a datablock for the I or Q Component of a frame for the acquisition with the name label. Typically called on both components. More...
 
iud_t iufIqFileResponseCreate (iuiqf_t iqFile, char *label)
 Creates a datablock for a response (numSamplesPerLine * numChannels) for the acquisition with the name label. Typically called on both components. More...
 
iud_t iufIqFileChannelCreate (iuiqf_t iqFile, char *label)
 Creates a datablock for an single I channel (i.e. numSamplesPerLine floats) for the acquisition with the name label. Typically called on both components. More...
 
void * iufIqFileInstanceLoad (hid_t handle)
 
iuiqf_t iufIqFileNodeLoad (const char *pFilename)
 Load an iqFile instance from a file. More...
 
int iufIqFileSaveInstance (hid_t handle, iuiqfi_t instanceData)
 
int iufIqFileNodeSave (iuiqf_t iqFile)
 Save (serialize) the iqFile instance to file. More...
 
int iufIqFileClose (iuiqf_t iqFile)
 Closes access to the iqFile. More...
 
int iufIqFileCompareInstance (iuiqfi_t reference, iuiqfi_t actual)
 
int iufIqFileCompare (iuiqf_t reference, iuiqf_t actual)
 Compares two iqFile instances with each other. More...
 
iufl_t iufIqFileGetFrameList (iuiqf_t iqFile)
 Gets the IufFrameList object from an iqFile. More...
 
iuiqpald_t iufIqFileGetIqPatternListDict (iuif_t iqFile)
 
iupd_t iufIqFileGetPulseDict (iuiqf_t iqFile)
 Gets the IufPulseDict object from an iqFile. More...
 
iusd_t iufIqFileGetSourceDict (iuiqf_t iqFile)
 Gets the IufSourceDict object from an iqFile. More...
 
iurcmd_t iufIqFileGetReceiveChannelMapDict (iuiqf_t iqFile)
 Gets the IufReceiveChannelMapDict object from an iqFile. More...
 
iutad_t iufIqFileGetTransmitApodizationDict (iuiqf_t iqFile)
 Gets the IufTransmitApodizationDict object from an iqFile. More...
 
iudmd_t iufIqFileGetDemodulationDict (iuiqf_t iqFile)
 Gets the IufReceiveSettingsDict object from an iqFile. More...
 
iua_t iufIqFileGetAcquisition (iuiqf_t iqFile)
 Gets the IufAcquisition object from an iqFile. More...
 
iut_t iufIqFileGetTransducer (iuiqf_t iqFile)
 Gets the IufTransducer object from an iqFile. More...
 
int iufIqFileSetFrameList (iuiqf_t iqFile, iufl_t frameList)
 Sets the frameList of an iqFile. More...
 
int iufIqFileSetPatternListDict (iuiqf_t iqFile, iuiqpald_t patternListDict)
 Sets the patternListDict of an iqFile. More...
 
int iufIqFileSetPulseDict (iuiqf_t iqFile, iupd_t pulseDict)
 Sets the pulseDict of an iqFile. More...
 
int iufIqFileSetSourceDict (iuiqf_t iqFile, iusd_t sourceDict)
 Sets the sourceDict of an iqFile. More...
 
int iufIqFileSetReceiveChannelMapDict (iuiqf_t iqFile, iurcmd_t receiveChannelMapDict)
 Sets the receiveChannelMap of an iqFile. More...
 
int iufIqFileSetTransmitApodizationDict (iuif_t iqFile, iutad_t transmitApodizationDict)
 
int iufIqFileSetDemodulationDict (iuiqf_t iqFile, iudmd_t demodulationDict)
 Sets the receiveSettingsDict of an iqFile. More...
 
int iufIqFileSetAcquisition (iuiqf_t iqFile, iua_t acquisition)
 Sets the acquisition info of an iqFile. More...
 
int iufIqFileSetTransducer (iuiqf_t iqFile, iut_t transducer)
 Sets the transducer of an iqFile. More...
 
int iufIqFileSetFilename (iuiqf_t iqFile, char *fileName)
 
void fillChunkDims (hsize_t *chunkDims, hsize_t *rfDataDims, int numDims, int numItems)
 
int iufIqFileFrameSave (iuiqf_t iqFile, char *label, IufComponent component, iud_t frame, iuo_t frame_offset)
 Saves a frame of data to an iqFile. More...
 
int iufIqFileResponseSave (iuiqf_t iqFile, char *label, IufComponent component, iud_t response, iuo_t response_offset)
 Saves a channel of data to an iqFile. More...
 
int iufIqFileChannelSave (iuiqf_t iqFile, char *label, IufComponent component, iud_t channel, iuo_t channel_offset)
 Saves a channel of data to an iqFile. More...
 
int iufIqFileFrameLoad (iuiqf_t iqFile, char *label, IufComponent component, iud_t frame, iuo_t frame_offset)
 Loads a frame of data to an iqFile. More...
 
int iufIqFileResponseLoad (iuiqf_t iqFile, char *label, IufComponent component, iud_t response, iuo_t response_offset)
 Loads a single response of data from an iqFile. More...
 
int iufIqFileChannelLoad (iuiqf_t iqFile, char *label, IufComponent component, iud_t channel, iuo_t channel_offset)
 Loads a single channel of data from an iqFile. More...
 

Data Structure Documentation

◆ IufIqFileInstance

struct IufIqFileInstance
Data Fields
iua_t acquisition

The description of the performed acquisition

IUF_BOOL deepDelete
iudmd_t demodulationDict

a dictionary of receiveSettings

iufl_t frameList
hid_t handle

HDF5 file handle

iudsd_t iDataStreamDict

Contains dataset administration

iuiqpald_t iqPatternListDict

a dictionary of pattern lists

int IufVersion

The version of iq file format

const char * pFilename

the filename

iupd_t pulseDict

a dictionary of pulses

iusd_t pulseSourceDict

a dictionary of sources

iudsd_t qDataStreamDict

Contains dataset administration

iurcmd_t receiveChannelMapDict

a dictionary of receiveChannelMaps

iut_t transducer

The transducer description

iutad_t transmitApodizationDict

a dictionary of transmitApodizations

◆ IufIqFile

struct IufIqFile
Data Fields
iuhn_t history

Macro Definition Documentation

◆ IUF_IQ_COMPONENT_I

#define IUF_IQ_COMPONENT_I   0

◆ IUF_IQ_COMPONENT_Q

#define IUF_IQ_COMPONENT_Q   1

Function Documentation

◆ fillChunkDims()

void fillChunkDims ( hsize_t *  chunkDims,
hsize_t *  rfDataDims,
int  numDims,
int  numItems 
)

◆ iufIqFileChannelCreate()

iud_t iufIqFileChannelCreate ( iuiqf_t  iqFile,
char *  label 
)

Creates a datablock for an single I channel (i.e. numSamplesPerLine floats) for the acquisition with the name label. Typically called on both components.

Returns
Returns an allocated memory block of a "label"-channel or IUD_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe acquisition type

◆ iufIqFileChannelLoad()

int iufIqFileChannelLoad ( iuiqf_t  iqFile,
char *  label,
IufComponent  component,
iud_t  channel,
iuo_t  channel_offset 
)

Loads a single channel of data from an iqFile.

Returns
Returns IUF_E_OK when succesful or <0 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe label of the patternList
componentIs it an I or a Q component?
channelThe channel data block to be filled
channel_offsetThe offset in the datablock

◆ iufIqFileChannelSave()

int iufIqFileChannelSave ( iuiqf_t  iqFile,
char *  label,
IufComponent  component,
iud_t  channel,
iuo_t  channel_offset 
)

Saves a channel of data to an iqFile.

Returns
Returns IUF_E_OK when succesful or <0 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe label of the patternList
componentIs it an I or a Q component?
channelThe channel data to save
channel_offsetThe offsets in the datablock

◆ iufIqFileClose()

int iufIqFileClose ( iuiqf_t  iqFile)

Closes access to the iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileCompare()

int iufIqFileCompare ( iuiqf_t  reference,
iuiqf_t  actual 
)

Compares two iqFile instances with each other.

Returns
Returns IUF_TRUE when the iqFiles are equal and IUF_FALSE otherwise.
Parameters
referenceThe IufIqFile to compare to
actualThe IufIqFile to compare with

◆ iufIqFileCompareInstance()

int iufIqFileCompareInstance ( iuiqfi_t  reference,
iuiqfi_t  actual 
)

◆ iufIqFileCreate()

iuiqf_t iufIqFileCreate ( const char *  filename)

Create an empty file instance with a filename.

Returns
Returns the empty file instance when succesful or IUIF_INVALID in case of an error.
Parameters
filenameThe filename for the file instance.

◆ iufIqFileDelete()

int iufIqFileDelete ( iuiqf_t  iqFile)

Creates a datablock for a single channel (i.e. numSamplesPerLine floats) for the acquisition with the name label.

Returns
Returns an allocated memory block of a "label"-channel or IUD_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileFrameCreate()

iud_t iufIqFileFrameCreate ( iuiqf_t  iqFile,
char *  label 
)

Creates a datablock for the I or Q Component of a frame for the acquisition with the name label. Typically called on both components.

Returns
Returns an allocated memory block of a "label"-frame or IUD_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe acquisition type

◆ iufIqFileFrameLoad()

int iufIqFileFrameLoad ( iuiqf_t  iqFile,
char *  label,
IufComponent  component,
iud_t  frame,
iuo_t  frame_offset 
)

Loads a frame of data to an iqFile.

Returns
Returns IUF_E_OK when succesful or <0 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe label of the patternList
componentIs it an I or a Q component?
frameThe frame of data
frame_offsetThe offset in the datablock

◆ iufIqFileFrameSave()

int iufIqFileFrameSave ( iuiqf_t  iqFile,
char *  label,
IufComponent  component,
iud_t  frame,
iuo_t  frame_offset 
)

Saves a frame of data to an iqFile.

Returns
Returns IUF_E_OK when succesful or <0 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe label of the patternList
componentIs it an I or a Q component?
frameThe frame of data
frame_offsetThe offset in the datablock

◆ iufIqFileGetAcquisition()

iua_t iufIqFileGetAcquisition ( iuiqf_t  iqFile)

Gets the IufAcquisition object from an iqFile.

Returns
Returns the requested IufAcquisition or NULL in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetDemodulationDict()

iudmd_t iufIqFileGetDemodulationDict ( iuiqf_t  iqFile)

Gets the IufReceiveSettingsDict object from an iqFile.

Returns
Returns the requested IufReceiveSettingsDict or NULL in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetFrameList()

iufl_t iufIqFileGetFrameList ( iuiqf_t  iqFile)

Gets the IufFrameList object from an iqFile.

Returns
Returns the requested IufFrameList or IUFL_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetIqPatternListDict()

iuiqpald_t iufIqFileGetIqPatternListDict ( iuif_t  iqFile)

◆ iufIqFileGetNumChannels()

int iufIqFileGetNumChannels ( iuiqf_t  iqFile,
char *  label 
)

Gets the number of channels for the patternList type label.

Returns
Returns the number of channels or -1 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelthe patternList type

◆ iufIqFileGetNumFrames()

int iufIqFileGetNumFrames ( iuiqf_t  iqFile)

Returns the number of frames an iqFile has.

Returns
Returns the number of frames or 0 if there are no frames, or -1 in case of an invalid argument.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetNumResponses()

int iufIqFileGetNumResponses ( iuiqf_t  iqFile,
char *  label 
)

Gets the number of responses for the patternList type label.

Returns
Returns the number of responses (numPatterns) or -1 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelthe patternList type

◆ iufIqFileGetPulseDict()

iupd_t iufIqFileGetPulseDict ( iuiqf_t  iqFile)

Gets the IufPulseDict object from an iqFile.

Returns
Returns the requested IufPulseDict or IUPD_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetReceiveChannelMapDict()

iurcmd_t iufIqFileGetReceiveChannelMapDict ( iuiqf_t  iqFile)

Gets the IufReceiveChannelMapDict object from an iqFile.

Returns
Returns the requested IufReceiveChannelMapDict or IURCMD_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetSamplesPerLine()

int iufIqFileGetSamplesPerLine ( iuiqf_t  iqFile,
char *  label 
)

Gets the number of samples per line for this label.

Returns
Returns the number of channels or -1 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelthe patternList type

◆ iufIqFileGetSourceDict()

iusd_t iufIqFileGetSourceDict ( iuiqf_t  iqFile)

Gets the IufSourceDict object from an iqFile.

Returns
Returns the requested IufSourceDict or IUFD_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetTransducer()

iut_t iufIqFileGetTransducer ( iuiqf_t  iqFile)

Gets the IufTransducer object from an iqFile.

Returns
Returns the requested IufTransducer or NULL in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileGetTransmitApodizationDict()

iutad_t iufIqFileGetTransmitApodizationDict ( iuiqf_t  iqFile)

Gets the IufTransmitApodizationDict object from an iqFile.

Returns
Returns the requested IufTransmitApodizationDict or NULL in case of an error.
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileInstanceCreate()

iuiqfi_t iufIqFileInstanceCreate ( void  )

◆ iufIqFileInstanceDelete()

int iufIqFileInstanceDelete ( iuiqfi_t  instance)

◆ iufIqFileInstanceLoad()

void* iufIqFileInstanceLoad ( hid_t  handle)

◆ iufIqFileNodeLoad()

iuiqf_t iufIqFileNodeLoad ( const char *  pFilename)

Load an iqFile instance from a file.

Returns
Returns an iq file instance or IUIF_INVALID the file could not be read.
Parameters
pFilenameThe filename of the iqFile

◆ iufIqFileNodeSave()

int iufIqFileNodeSave ( iuiqf_t  iqFile)

Save (serialize) the iqFile instance to file.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error
Parameters
iqFileThe IufIqFile of interest

◆ iufIqFileResponseCreate()

iud_t iufIqFileResponseCreate ( iuiqf_t  iqFile,
char *  label 
)

Creates a datablock for a response (numSamplesPerLine * numChannels) for the acquisition with the name label. Typically called on both components.

Returns
Returns an allocated memory block of a "label"-response or IUD_INVALID in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe acquisition type

◆ iufIqFileResponseLoad()

int iufIqFileResponseLoad ( iuiqf_t  iqFile,
char *  label,
IufComponent  component,
iud_t  response,
iuo_t  response_offset 
)

Loads a single response of data from an iqFile.

Returns
Returns IUF_E_OK when succesful or <0 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe label of the patternList
componentIs it an I or a Q component?
responseThe response data to load
response_offsetThe offset in the datablock

◆ iufIqFileResponseSave()

int iufIqFileResponseSave ( iuiqf_t  iqFile,
char *  label,
IufComponent  component,
iud_t  response,
iuo_t  response_offset 
)

Saves a channel of data to an iqFile.

Returns
Returns IUF_E_OK when succesful or <0 in case of an error.
Parameters
iqFileThe IufIqFile of interest
labelThe label of the patternList
componentIs it an I or a Q component?
responsethe response data to save
response_offsetThe offset in the datablock

◆ iufIqFileSaveInstance()

int iufIqFileSaveInstance ( hid_t  handle,
iuiqfi_t  instanceData 
)

◆ iufIqFileSetAcquisition()

int iufIqFileSetAcquisition ( iuiqf_t  iqFile,
iua_t  acquisition 
)

Sets the acquisition info of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
acquisitionThe IufAcquisition to set

◆ iufIqFileSetDemodulationDict()

int iufIqFileSetDemodulationDict ( iuiqf_t  iqFile,
iudmd_t  demodulationDict 
)

Sets the receiveSettingsDict of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
demodulationDictThe IufTransmitApodizationDict to set

◆ iufIqFileSetFilename()

int iufIqFileSetFilename ( iuiqf_t  iqFile,
char *  fileName 
)

◆ iufIqFileSetFrameList()

int iufIqFileSetFrameList ( iuiqf_t  iqFile,
iufl_t  frameList 
)

Sets the frameList of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
frameListThe IufFrameList to set

◆ iufIqFileSetPatternListDict()

int iufIqFileSetPatternListDict ( iuiqf_t  iqFile,
iuiqpald_t  iqPatternListDict 
)

Sets the patternListDict of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
patternListDictThe IufPatternListDict to set

◆ iufIqFileSetPulseDict()

int iufIqFileSetPulseDict ( iuiqf_t  iqFile,
iupd_t  pulseDict 
)

Sets the pulseDict of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
pulseDictThe IufPulseDict to set

◆ iufIqFileSetReceiveChannelMapDict()

int iufIqFileSetReceiveChannelMapDict ( iuiqf_t  iqFile,
iurcmd_t  receiveChannelMapDict 
)

Sets the receiveChannelMap of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
receiveChannelMapDictThe IufReceiveChannelMapDict to set

◆ iufIqFileSetSourceDict()

int iufIqFileSetSourceDict ( iuiqf_t  iqFile,
iusd_t  sourceDict 
)

Sets the sourceDict of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
sourceDictThe IufSourceDict to set

◆ iufIqFileSetTransducer()

int iufIqFileSetTransducer ( iuiqf_t  iqFile,
iut_t  transducer 
)

Sets the transducer of an iqFile.

Returns
Returns IUF_E_OK when succesful or IUF_ERR_VALUE in case of an error.
Parameters
iqFileThe IufIqFile of interest
transducerThe IufTransducer to set

◆ iufIqFileSetTransmitApodizationDict()

int iufIqFileSetTransmitApodizationDict ( iuif_t  iqFile,
iutad_t  transmitApodizationDict 
)