TPCCLIB
Loading...
Searching...
No Matches
ranoise.c File Reference

PET noise estimation. More...

#include "tpcclibConfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include "tpcisotope.h"

Go to the source code of this file.

Functions

double noiseSD4Frame (double y, double t1, double dt, int isotope, double a)

Detailed Description

PET noise estimation.

Definition in file ranoise.c.

Function Documentation

◆ noiseSD4Frame()

double noiseSD4Frame ( double y,
double t1,
double dt,
int isotope,
double a )

Calculate the standard deviation (SD) of noise for PET radioactivity concentration.

SD of noise can be used in simulations. Reference: Varga & Szabo. J Cereb Blood Flow Metab 2002;22(2):240-244.

See also
isotopeIdentify, drandGaussian, simC3s, simC3p, simRTCM
Returns
Returns the SD, or NaN in case of an error.
Parameters
ySample radioactivity concentration (decay corrected to zero time).
t1Radioactivity measurement (frame) start time in minutes.
dtRadioactivity measurement (frame) duration in minutes.
isotopeIsotope code as enum or index of isotope in isotope table; enter ISOTOPE_UNKNOWN if not to be considered.
aProportionality factor. Note that it should be in relation to the unit of y.

Definition at line 26 of file ranoise.c.

38 {
39 /* Frame start time must be >=0 and frame duration must be >0 */
40 if(isnan(y) || !(t1>=0.0) || !(dt>0.0) || !(a>=0.0)) return(nan(""));
41 /* If concentration is not positive, then its SD is zero */
42 if(!(y>0.0)) return(0.0);
43
44 /* Calculate decay factor (<=1) */
45 double df;
47 df=1.0;
48 } else {
50 if(!(df>0.0 && df<=1.0)) return(nan(""));
51 }
52
53 /* Calculate SD */
54 return(sqrt((a*y)/(dt*df)));
55}
double decayCorrectionFactorFromIsotope(int isotope, double starttime, double duration)
Definition decay.c:107
isotope
Definition tpcisotope.h:50
@ ISOTOPE_UNKNOWN
Unknown.
Definition tpcisotope.h:51