Go to the source code of this file.
Functions | |
| int | interpolate (double *x, double *y, int nr, double *newx, double *newy, double *newyi, double *newyii, int newnr) |
| int | finterpolate (float *x, float *y, int nr, float *newx, float *newy, float *newyi, float *newyii, int newnr) |
| int | integrate (double *x, double *y, int nr, double *yi) |
| int | fintegrate (float *x, float *y, int nr, float *yi) |
| int | petintegrate (double *x1, double *x2, double *y, int nr, double *newyi, double *newyii) |
| int | fpetintegrate (float *x1, float *x2, float *y, int nr, float *newyi, float *newyii) |
| int | interpolate4pet (double *x, double *y, int nr, double *newx1, double *newx2, double *newy, double *newyi, double *newyii, int newnr) |
| int | finterpolate4pet (float *x, float *y, int nr, float *newx1, float *newx2, float *newy, float *newyi, float *newyii, int newnr) |
| int | petintegral (double *x1, double *x2, double *y, int nr, double *ie, double *iie) |
| int | fpetintegral (float *x1, float *x2, float *y, int nr, float *ie, float *iie) |
| int | petintegrate2fe (double *x1, double *x2, double *y, int nr, double *e, double *ie, double *iie) |
| int | fpetintegrate2fe (float *x1, float *x2, float *y, int nr, float *e, float *ie, float *iie) |
| int fintegrate | ( | float * | x, |
| float * | y, | ||
| int | nr, | ||
| float * | yi | ||
| ) |
float version of integrate()
| x | Original x values; duplicates are not allowed, all must be >=0. Data must be sorted by ascending x |
| y | Original y values |
| nr | Nr of values |
| yi | Array for integrals |
Definition at line 368 of file integr.c.
Referenced by test_integr().
| int finterpolate | ( | float * | x, |
| float * | y, | ||
| int | nr, | ||
| float * | newx, | ||
| float * | newy, | ||
| float * | newyi, | ||
| float * | newyii, | ||
| int | newnr | ||
| ) |
float version of interpolate()
| x | Input data x (time) values |
| y | Input data y values |
| nr | Number of values in input data |
| newx | Output data x values |
| newy | Interpolated (extrapolated) y values; NULL can be given if not needed |
| newyi | Integrals; NULL can be given if not needed |
| newyii | 2nd integrals; NULL can be given if not needed |
| newnr | Nr of values in output data |
Definition at line 237 of file integr.c.
References INTEGR_TEST.
Referenced by finterpolate4pet(), and test_integr().
| int finterpolate4pet | ( | float * | x, |
| float * | y, | ||
| int | nr, | ||
| float * | newx1, | ||
| float * | newx2, | ||
| float * | newy, | ||
| float * | newyi, | ||
| float * | newyii, | ||
| int | newnr | ||
| ) |
float version of interpolate4pet()
| x | Times of original data |
| y | Values of original data |
| nr | Number of original data values |
| newx1 | PET frame start times; frames may overlap |
| newx2 | PET frame end times; frames may overlap |
| newy | Mean value during PET frame, or NULL if not needed; calculation may be faster if newyi is calculated too |
| newyi | Integral at frame mid time, or NULL if not needed |
| newyii | 2nd integral at frame mid time, or NULL if not needed |
| newnr | Number of PET frames |
Definition at line 679 of file integr.c.
References finterpolate(), and INTEGR_TEST.
| int fpetintegral | ( | float * | x1, |
| float * | x2, | ||
| float * | y, | ||
| int | nr, | ||
| float * | ie, | ||
| float * | iie | ||
| ) |
float version of petintegral()
| x1 | frame start times |
| x2 | frame end times |
| y | avg value during frame |
| nr | number of frames |
| ie | integrals at frame mid time |
| iie | 2nd integrals at frame mid time |
Definition at line 855 of file integr.c.
References INTEGR_TEST.
| int fpetintegrate | ( | float * | x1, |
| float * | x2, | ||
| float * | y, | ||
| int | nr, | ||
| float * | newyi, | ||
| float * | newyii | ||
| ) |
| x1 | Array of frame start times |
| x2 | Array of frame end times |
| y | Array of y values (avg during each frame) |
| nr | Nr of frames |
| newyi | Output: integral values at frame end times, or NULL |
| newyii | Output: 2nd integral values at frame end times, or NULL |
Definition at line 476 of file integr.c.
References INTEGR_TEST.
Referenced by test_integr().
| int fpetintegrate2fe | ( | float * | x1, |
| float * | x2, | ||
| float * | y, | ||
| int | nr, | ||
| float * | e, | ||
| float * | ie, | ||
| float * | iie | ||
| ) |
float version of petintegrate2fe()
| x1 | frame start times |
| x2 | frame end times |
| y | avg value during frame |
| nr | number of frames |
| e | values at frame end time |
| ie | integrals at frame end time |
| iie | 2nd integrals at frame end time |
Definition at line 980 of file integr.c.
References INTEGR_TEST.
| int integrate | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| double * | yi | ||
| ) |
Linear integration from time 0 to x[0..nr-1]. If x[0] is >0 and x[0]<=(x[1]-x[0]), then the beginning is interpolated from it to (0,0).
| x | Original x values; duplicates are not allowed, all must be >=0. Data must be sorted by ascending x |
| y | Original y values |
| nr | Nr of values |
| yi | Array for integrals |
Definition at line 346 of file integr.c.
Referenced by test_integr().
| int interpolate | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| double * | newx, | ||
| double * | newy, | ||
| double * | newyi, | ||
| double * | newyii, | ||
| int | newnr | ||
| ) |
Linear interpolation and integration.
It is assumed, that both original and new interpolated data represent the actual values at specified time points (not from framed data). The integration is calculated dot-by-dot.
If NULL is spefied for newy[], newyi[] and/or newyii[], their values are not calculated.
Original data and new x values must be sorted by ascending x. Subsequent x values can have equal values, enabling the use of step functions. Negative x (time) values can be processed. If necessary, the data is extrapolated assuming that: 1) y[inf]=y[nr-1] and 2) if x[0]>0, y[0]>0 and x[0]<=x[1]-x[0], then an imaginary line is drawn from (0,0) to (x[0],y[0]).
| x | Input data x (time) values |
| y | Input data y values |
| nr | Number of values in input data |
| newx | Output data x values |
| newy | Interpolated (extrapolated) y values; NULL can be given if not needed |
| newyi | Integrals; NULL can be given if not needed |
| newyii | 2nd integrals; NULL can be given if not needed |
| newnr | Nr of values in output data |
Definition at line 122 of file integr.c.
References INTEGR_TEST.
Referenced by interpolate4pet(), and test_integr().
| int interpolate4pet | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| double * | newx1, | ||
| double * | newx2, | ||
| double * | newy, | ||
| double * | newyi, | ||
| double * | newyii, | ||
| int | newnr | ||
| ) |
Interpolate and integrate TAC to PET frames.
It is assumed, that original data is not from framed data, but that the values represent the actual value at specified time point, which allows the integration to be calculated dot-by-dot.
If NULL is specified for *newy, *newyi and/or *newyii, their values are not calculated.
Original data and new x values must be sorted by ascending x. Subsequent x values can have equal values, enabling the use of step functions. PET frames can overlap, but interpolation may then be slower. Negative x (time) values can be processed. If necessary, the data is extrapolated assuming that 1) y[inf]=y[nr-1] and 2) if x[0]>0 and y[0]>0 and x[0]>x[1]-x[0], then an imaginary line is drawn from (0,0) to (x[0],y[0]).
| x | Times of original data |
| y | Values of original data |
| nr | Number of original data values |
| newx1 | PET frame start times; frames may overlap |
| newx2 | PET frame end times; frames may overlap |
| newy | Mean value during PET frame, or NULL if not needed; calculation may be faster if newyi is calculated too |
| newyi | Integral at frame mid time, or NULL if not needed |
| newyii | 2nd integral at frame mid time, or NULL if not needed |
| newnr | Number of PET frames |
Definition at line 569 of file integr.c.
References INTEGR_TEST, and interpolate().
| int petintegral | ( | double * | x1, |
| double * | x2, | ||
| double * | y, | ||
| int | nr, | ||
| double * | ie, | ||
| double * | iie | ||
| ) |
Integrate PET TAC data to frame mid times. Any of output arrays may be set to NULL if that is not needed. Frames must be in ascending time order. Gaps and small overlap are allowed. If x1[0]>0 and x1[0]<=x2[0]-x1[0], then an imaginary line is drawn from (0,0) to (x[0],y[0]).
| x1 | frame start times |
| x2 | frame end times |
| y | avg value during frame |
| nr | number of frames |
| ie | integrals at frame mid time |
| iie | 2nd integrals at frame mid time |
Definition at line 798 of file integr.c.
References INTEGR_TEST.
| int petintegrate | ( | double * | x1, |
| double * | x2, | ||
| double * | y, | ||
| int | nr, | ||
| double * | newyi, | ||
| double * | newyii | ||
| ) |
Calculates integrals of PET data at frame end times.
Data does not have to be continuous, but it must be increasing in time. For faster performance in repetitive calls, allocate memory for integral[] even if it is not needed. If x1[0] is >0 AND x1[0] is <=(x2[0]-x1[0]), then the beginning is interpolated from (0, 0) to (x1[0], y1[0]*x1[0]/x) where x is midtime of the first frame.
| x1 | Array of frame start times |
| x2 | Array of frame end times |
| y | Array of y values (avg during each frame) |
| nr | Nr of frames |
| newyi | Output: integral values at frame end times, or NULL |
| newyii | Output: 2nd integral values at frame end times, or NULL |
Definition at line 401 of file integr.c.
References INTEGR_TEST.
Referenced by test_integr().
| int petintegrate2fe | ( | double * | x1, |
| double * | x2, | ||
| double * | y, | ||
| int | nr, | ||
| double * | e, | ||
| double * | ie, | ||
| double * | iie | ||
| ) |
Integrate PET TAC data to frame end times. Any of output arrays may be set to NULL if that is not needed. Frames must be in ascending time order. Gaps and small overlap are allowed. If x1[0]>0 and x1[0]<=x2[0]-x1[0], then an imaginary line is drawn from (0,0) to (x[0],y[0]).
| x1 | frame start times |
| x2 | frame end times |
| y | avg value during frame |
| nr | number of frames |
| e | values at frame end time |
| ie | integrals at frame end time |
| iie | 2nd integrals at frame end time |
Definition at line 920 of file integr.c.
References INTEGR_TEST.
1.8.0