TPCCLIB
|
Miscellaneous functions for PET modelling. More...
#include "libtpcmodext.h"
Go to the source code of this file.
Functions | |
int | dftInterpolateForIMG (DFT *input, IMG *img, int frame_nr, DFT *output, double *ti1, double *ti2, int verbose, char *status) |
int | imgTimeIntegral (IMG *img, float t1, float t2, IMG *iimg, int calc_mode, char *status, int verbose) |
int | dftAllocateWithIMG (DFT *dft, int tacNr, IMG *img) |
int | sif2dft (SIF *sif, DFT *dft) |
int | sifAllocateWithIMG (SIF *sif, IMG *img, int doCounts, int verbose) |
Miscellaneous functions for PET modelling.
Definition in file misc_model.c.
Allocate memory for DFT based on information in IMG.
dft | Pointer to initiated DFT struct which will be allocated here. |
tacNr | Nr of TACs to be allocated in DFT; if zero, then TACs for all IMG pixels is allocated, but it may lead to out of memory error. |
img | Pointer to IMG struct from where necessary information is read. |
Definition at line 296 of file misc_model.c.
Referenced by imgMaskPixelTACs().
int dftInterpolateForIMG | ( | DFT * | input, |
IMG * | img, | ||
int | frame_nr, | ||
DFT * | output, | ||
double * | ti1, | ||
double * | ti2, | ||
int | verbose, | ||
char * | status ) |
Interpolate (and integrate) TAC data to sample times that are given with IMG data. Input frame lengths are taken into account if they are available in DFT or if the framing is the same as in IMG data.
input | Data which is interpolated. |
img | Data to which (sample times) the interpolation is done. |
frame_nr | Number of IMG frames that are needed; can be set to 0 if all frames can be included. |
output | Pointer to initiated DFT into which interpolated values and integrals will be written at input sample times and units. |
ti1 | First time of input data before interpolation (in input time units); use this to check that required time range was measured; NULL if not needed. |
ti2 | Last time of input data before interpolation (in input time units); use this to check that required time range was measured; NULL if not needed. |
verbose | Verbose level; set to zero to not to print any comments. |
status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed. |
Definition at line 17 of file misc_model.c.
Referenced by imgReadModelingData().
int imgTimeIntegral | ( | IMG * | img, |
float | t1, | ||
float | t2, | ||
IMG * | iimg, | ||
int | calc_mode, | ||
char * | status, | ||
int | verbose ) |
Integration of dynamic image from time1 to time2, storing integrals in iimg, which is allocated here. Frames do not have to be continuous in time. Time unit in integral is sec. Raw data (sinogram) must be divided by frame durations before calling this. You may want to test the time range before applying this routine, because this function accepts relatively large extrapolation.
img | IMG data; preferably dynamic, if static, then the specified time range must match with the frame time. |
t1 | Time where to start integration (sec). |
t2 | Time to stop integration (sec); must be higher than t1. |
iimg | Pointer to initiated but empty AUC IMG data. |
calc_mode | Calculate integral or average: 0=integral, 1=average. |
status | Pointer to a string (allocated for at least 128 chars) where error message or other execution status will be written; enter NULL, if not needed. |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 147 of file misc_model.c.
sif | Pointer to SIF struct containing data to be converted. |
dft | Pointer to initiated but empty DFT struct. |
Definition at line 350 of file misc_model.c.
Allocate memory for SIF based on information in IMG.
Frame times are set, 'counts' are optionally set to mean of voxel values times frame lengths, scaled to 0-1E7. Weights are not calculated.
sif | Pointer to initiated SIF struct which will be allocated here. |
img | Pointer to IMG struct from where necessary information is read. |
doCounts | Set (1) or do not set (0) counts, based on sum of all image voxel values and frame lengths. |
verbose | Verbose level; if zero, then only warnings are printed into stderr. |
Definition at line 418 of file misc_model.c.
Referenced by imgSetWeights().