5#include "tpcclibConfig.h"
70 int verbose=0;
if(status!=NULL) verbose=status->
verbose;
71 if(verbose>0) printf(
"%s()\n", __func__);
90 if(!isnan(f)) halflife*=f;
93 if(mode==0) lambda=-lambda;
95 printf(
"halflife := %g\n", halflife);
96 printf(
"lambda := %g\n", lambda);
104 if(mode!=0) printf(
"decay correction\n");
else printf(
"removing decay correction\n");
107 for(
int i=0; i<tac->
sampleNr; i++) {
110 if(isnan(tac->
x1[i]) || isnan(tac->
x2[i]))
continue;
113 if(isnan(tac->
x[i]))
continue;
116 if(verbose>6) printf(
" %10.4f -> %e\n", tac->
x[i], f);
118 for(
int j=0; j<tac->
tacNr; j++) tac->
c[j].
y[i]*=f;
double lambdaFromHalflife(double halflife)
double decayCorrectionFactorFromLambda(double lambda, double starttime, double duration)
char * isotopeName(int isotope_code)
double isotopeHalflife(int isotope_code)
int isotopeIdentify(const char *isotope)
void statusSet(TPCSTATUS *s, const char *func, const char *srcfile, int srcline, tpcerror error)
IFT h
Optional (but often useful) header information.
int verbose
Verbose level, used by statusPrint() etc.
int tacGetIsotope(TAC *tac)
int tacDecayCorrection(TAC *tac, int isotope, int mode, TPCSTATUS *status)
void tacSetIsotope(TAC *tac, int isotope)
int tacSetHeaderDecayCorrection(IFT *h, decaycorrection dc)
int tacSetHeaderIsotope(IFT *h, const char *s)
int tacGetHeaderIsotope(IFT *h, char *s, TPCSTATUS *status)
int tacIsWeighted(TAC *tac)
int tacWeightNorm(TAC *tac, TPCSTATUS *status)
@ WEIGHTING_ON_FD
Weights based on decay and sample frequency or frame length (Thiele et al, 2008).
@ WEIGHTING_ON_GENERAL
Weighted or weights are available, but not specified.
@ WEIGHTING_ON_COUNTS
Weights based on counts (Mazoyer et al, 1986).
@ TPCERROR_UNKNOWN_UNIT
Unknown data unit.
@ TPCERROR_UNKNOWN_ISOTOPE
Unknown isotope.
@ TPCERROR_NO_DATA
File contains no data.
double unitConversionFactor(const int u1, const int u2)
Header file for library libtpcift.
Header file for library libtpcisotope.
#define MAX_ISOTOPE_LEN
Max string length for PET isotope.
@ DECAY_NOTCORRECTED
Data is not corrected for physical decay.
@ DECAY_CORRECTED
Data is corrected for physical decay.
@ ISOTOPE_UNKNOWN
Unknown.
Header file for library libtpctac.