#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "include/halflife.h"
#include "include/substitutions.h"
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 [] |
anonymous enum |
double hl2lambda | ( | double | halflife | ) |
Calculates the isotope lambda from specified halflife.
halflife | halflife time value |
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.
isocode | Pointer to string "C-11", "11c" etc; contents of this string is not changed, and this is not returned in any case |
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.
isocode | Pointer to string "C-11", "18f" etc. This argument is not changed |
References hlCorrectIsotopeCode(), isotope_code, and isotope_halflife.
char* hlIsotopeCode | ( | int | isotope | ) |
Isotope code as a string, based on isotope list number.
isotope | index of PET isotope in the list in halflife.c |
References isotope_code.
int hlIsotopeFromHalflife | ( | double | halflife | ) |
Identify the isotope based on its halflife (in minutes).
halflife | Half-life in minutes |
References isotope_halflife.
double hlLambda2factor | ( | double | lambda, |
double | frametime, | ||
double | framedur | ||
) |
Calculate the decay correction factor for specified isotope lambda.
lambda | Negative lambda removes decay correction |
frametime | Frame start time, or mid time if framedur<=0 |
framedur | If unknown, set <0 and give mid time for frametime |
float hlLambda2factor_float | ( | float | lambda, |
float | frametime, | ||
float | framedur | ||
) |
Calculate the decay correction factor for specified isotope lambda. Version for floats (mainly image data).
lambda | Negative lambda removes decay correction |
frametime | Frame start time, or mid time if framedur<=0 |
framedur | If unknown, set <0 and give mid time for frametime |
|
static |
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().