Enumerations | Functions | Variables
halflife.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "include/halflife.h"
#include "include/substitutions.h"
Include dependency graph for halflife.c:

Enumerations

enum  {
  TPCISOT_BR_75, TPCISOT_BR_76, TPCISOT_CU_62, TPCISOT_CU_64,
  TPCISOT_FE_52, TPCISOT_GA_68, TPCISOT_GE_68, TPCISOT_NA_22,
  TPCISOT_RB_82, TPCISOT_ZN_62, TPCISOT_F_18, TPCISOT_C_11,
  TPCISOT_N_13, TPCISOT_O_15, TPCISOT_O_14, TPCISOT_I_124,
  TPCISOT_UNKNOWN
}

Functions

char * hlIsotopeCode (int isotope)
double hlFromIsotope (char *isocode)
double hl2lambda (double halflife)
double hlLambda2factor (double lambda, double frametime, double framedur)
float hlLambda2factor_float (float lambda, float frametime, float framedur)
char * hlCorrectIsotopeCode (char *isocode)
int hlIsotopeFromHalflife (double halflife)

Variables

static char * isotope_code []
static double isotope_halflife []

Enumeration Type Documentation

anonymous enum
Enumerator:
TPCISOT_BR_75 
TPCISOT_BR_76 
TPCISOT_CU_62 
TPCISOT_CU_64 
TPCISOT_FE_52 
TPCISOT_GA_68 
TPCISOT_GE_68 
TPCISOT_NA_22 
TPCISOT_RB_82 
TPCISOT_ZN_62 
TPCISOT_F_18 
TPCISOT_C_11 
TPCISOT_N_13 
TPCISOT_O_15 
TPCISOT_O_14 
TPCISOT_I_124 
TPCISOT_UNKNOWN 

Function Documentation

double hl2lambda ( double  halflife)

Calculates the isotope lambda from specified halflife.

Parameters:
halflifehalflife time value
Returns:
A negative value is returned in case of error.

References M_LN2.

char* hlCorrectIsotopeCode ( char *  isocode)

Check that isotope code, e.g. F-18, is in valid format, containing '-' and in this order. Returns the correct isotope code.

Parameters:
isocodePointer to string "C-11", "11c" etc; contents of this string is not changed, and this is not returned in any case
Returns:
pointer to correct isotope code, and NULL if it was not valid and could not be corrected.

References isotope_code.

Referenced by hlFromIsotope().

double hlFromIsotope ( char *  isocode)

Identify the isotope from the specified isotope code string and return the halflife (min). This function checks the validity of the isotope string using hlCorrectIsotopeCode(), but does not change it in any way.

Parameters:
isocodePointer to string "C-11", "18f" etc. This argument is not changed
Returns:
A negative value is returned in case of error.

References hlCorrectIsotopeCode(), isotope_code, and isotope_halflife.

Here is the call graph for this function:

char* hlIsotopeCode ( int  isotope)

Isotope code as a string, based on isotope list number.

Parameters:
isotopeindex of PET isotope in the list in halflife.c
Returns:
pointer to static string or "unknown".

References isotope_code.

int hlIsotopeFromHalflife ( double  halflife)

Identify the isotope based on its halflife (in minutes).

Parameters:
halflifeHalf-life in minutes
Returns:
the isotope list number, or negative value if not identified.

References isotope_halflife.

double hlLambda2factor ( double  lambda,
double  frametime,
double  framedur 
)

Calculate the decay correction factor for specified isotope lambda.

Parameters:
lambdaNegative lambda removes decay correction
frametimeFrame start time, or mid time if framedur<=0
framedurIf unknown, set <0 and give mid time for frametime
Returns:
A negative value is returned in case of error.
float hlLambda2factor_float ( float  lambda,
float  frametime,
float  framedur 
)

Calculate the decay correction factor for specified isotope lambda. Version for floats (mainly image data).

Parameters:
lambdaNegative lambda removes decay correction
frametimeFrame start time, or mid time if framedur<=0
framedurIf unknown, set <0 and give mid time for frametime
Returns:
A negative value is returned in case of error.

Variable Documentation

char* isotope_code[] [static]
Initial value:
 {
  "Br-75", "Br-76", "Cu-62", "Cu-64", "Fe-52",
  "Ga-68", "Ge-68", "Na-22", "Rb-82", "Zn-62",
  "F-18",  "C-11",  "N-13",  "O-15",  "O-14", "I-124",
0}

Valid isotope codes. Note: when adding isotopes, make sure that all isotopes with one letter are AFTER all two letter isotopes with the same initial letter.

Referenced by hlCorrectIsotopeCode(), hlFromIsotope(), and hlIsotopeCode().

double isotope_halflife[] [static]
Initial value:

Isotope half-lives in minutes

Referenced by hlFromIsotope(), and hlIsotopeFromHalflife().