IUF-SDK-3
Interventional Ultrasound Library
iufTGC.c File Reference
#include <stdlib.h>
#include <math.h>
#include <iuf.h>
#include <iufTGCPrivate.h>

Data Structures

struct  IufTGC
 

Functions

iutgc_t iufTGCCreate (int numTGCValues)
 Create an empty TGC function of numTGC values. More...
 
int iufTGCDelete (iutgc_t tgc)
 Frees the memory of the TGC object. More...
 
int iufTGCCompare (iutgc_t reference, iutgc_t actual)
 Checks if two TGCs are equal. More...
 
int iufTGCGetNumValues (iutgc_t tgc)
 Get the number of [time,gain] pairs that the TGC function has. More...
 
float iufTGCGetTime (iutgc_t tgc, int index)
 Get the time value of a point in the TGC function at index. More...
 
float iufTGCGetGain (iutgc_t tgc, int index)
 Get the gain value of a point in the TGC function at index. More...
 
int iufTGCSet (iutgc_t tgc, int index, float time, float gain)
 Set a [time,gain] pair of the TGC function at index. More...
 
int iufTGCSave (iutgc_t tgc, hid_t handle)
 
iutgc_t iufTGCLoad (hid_t handle)
 

Data Structure Documentation

◆ IufTGC

struct IufTGC
Data Fields
int numTGCValues
float * pGains
float * pTimes

Function Documentation

◆ iufTGCCompare()

int iufTGCCompare ( iutgc_t  reference,
iutgc_t  actual 
)

Checks if two TGCs are equal.

Returns
Returns IUF_TRUE if the TGCs are equal and IUF_FALSE otherwise
Parameters
referenceThe TGC object to compare to
actualThe TGC object to compare with

◆ iufTGCCreate()

iutgc_t iufTGCCreate ( int  numTGCValues)

Create an empty TGC function of numTGC values.

Returns
Returns the created TGC object or NULL in case of a failure
Parameters
numTGCValuesThe number of [time,gain] pairs to allocate

◆ iufTGCDelete()

int iufTGCDelete ( iutgc_t  tgc)

Frees the memory of the TGC object.

Returns
Returns the created TGC object or NULL in case of a failure
Parameters
tgcThe object to delete

◆ iufTGCGetGain()

float iufTGCGetGain ( iutgc_t  tgc,
int  index 
)

Get the gain value of a point in the TGC function at index.

Returns
The gain value
Parameters
tgcThe TGC object of interest
indexThe index of the TGC function

◆ iufTGCGetNumValues()

int iufTGCGetNumValues ( iutgc_t  tgc)

Get the number of [time,gain] pairs that the TGC function has.

Returns
Returns the number of [time,gain] pairs
Parameters
tgcThe TGC object of interest

◆ iufTGCGetTime()

float iufTGCGetTime ( iutgc_t  tgc,
int  index 
)

Get the time value of a point in the TGC function at index.

Returns
The time value
Parameters
tgcTHe TGC object of interest
indexThe index of the TGC function

◆ iufTGCLoad()

iutgc_t iufTGCLoad ( hid_t  handle)

◆ iufTGCSave()

int iufTGCSave ( iutgc_t  tgc,
hid_t  handle 
)

◆ iufTGCSet()

int iufTGCSet ( iutgc_t  tgc,
int  index,
float  time,
float  gain 
)

Set a [time,gain] pair of the TGC function at index.

Returns
Returns IUF_E_OK in case of success or IUF_ERR_VALUE in case of an error
Parameters
tgcThe TGC function of interest
indexThe index of the TGC function to replace the time, gain pair
timeThe time value to set
gainThe gain value to set