TPCCLIB
|
Header file for libtpccurveio. More...
#include "tpcclibConfig.h"
#include "libtpcmisc.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <math.h>
#include <time.h>
Go to the source code of this file.
Data Structures | |
struct | Voi |
struct | DFT |
struct | ResVOI |
struct | RES |
struct | FitVOI |
struct | FIT |
struct | CSV_item |
struct | CSV |
Macros | |
#define | BACKUP_EXTENSION ".bak" |
#define | MAX_RESPARAMS 100 |
#define | MAX_RESPARNAME_LEN 15 |
#define | MAX_FITPARAMS 100 |
#define | DFT_FORMAT_UNKNOWN -1 |
#define | DFT_FORMAT_PLAIN 0 |
#define | DFT_FORMAT_STANDARD 1 |
#define | DFT_FORMAT_IFT 2 |
#define | DFT_FORMAT_FIT 3 |
#define | DFT_FORMAT_NCI 4 |
#define | DFT_FORMAT_PMOD 5 |
#define | DFT_FORMAT_CSV_INT 6 |
#define | DFT_FORMAT_CSV_UK 7 |
#define | DFT_FORMAT_CPT 8 |
#define | DFT_FORMAT_IDWC 9 |
#define | DFT_FORMAT_IF 10 |
#define | DFT_FORMAT_XML 11 |
#define | DFT_FORMAT_HTML 12 |
#define | DFT_FORMAT_XELERIS 13 |
#define | DFT_TIME_MIDDLE 0 |
#define | DFT_TIME_START 1 |
#define | DFT_TIME_END 2 |
#define | DFT_TIME_STARTEND 3 |
#define | DFT_DECAY_UNKNOWN 0 |
#define | DFT_DECAY_CORRECTED 1 |
#define | DFT_DECAY_NOTCORRECTED 2 |
Enumerations | |
enum | mathfuncs { MF_LEVEL =100 , MF_LINE , MF_POL2 , MF_POL3 , MF_POL4 , MF_POL5 , MF_POL6 , MF_POL7 , MF_POL8 , MF_POL9 , MF_RATF11 =211 , MF_RATF21 =221 , MF_RATF22 =222 , MF_RATF32 =232 , MF_RATF33 =233 , MF_EXP1 =301 , MF_EXP2 , MF_EXP3 , MF_EXP4 , MF_EXP5 , MF_LUNDQVIST =321 , MF_LUNDQVIST2 , MF_LUNDQVIST3 , MF_EXPBOLUSINF =331 , MF_EXPBOLUSINF_RW =332 , MF_MF_EXPBOLUSINF_AZ =334 , MF_PK11195 =351 , MF_PPFIGAM =403 , MF_PF_MU =831 , MF_HILL =841 , MF_1MHILL =842 , MF_1MHILL_ADE =843 , MF_HILL_B =844 , MF_AMHILL =845 , MF_EHILL_PAR =846 , MF_EHILL_MET =847 , MF_EHILL2_PAR =848 , MF_EHILL2_MET =849 , MF_MAMEDE =851 , MF_1MMAMEDE , MF_MAYER_PAR =861 , MF_MAYER_MET , MF_EMAYER_PAR =863 , MF_EMAYER_MET , MF_HILL3M_PAR =871 , MF_HILL3M_M1 , MF_HILL3M_M2 , MF_HILL3M_M3 , MF_PF3M_PAR =881 , MF_PF3M_M1 , MF_PF3M_M2 , MF_PF3M_M3 , MF_STEP =1010 , MF_RATF33D =1232 , MF_FENGM2S =1312 , MF_FENGM2 =1313 , MF_FENGM2E =1314 , MF_GAMMAV =1401 , MF_GAMMAVB =1402 , MF_GAMMAVR =1403 , MF_WEIBULLCDF_D =1421 , MF_WEIBULLCDF_DD =1423 , MF_SURGE =1431 , MF_SURGE_TRAD =1432 , MF_SURGE_RECIRC =1433 , MF_P2B_SRC =1434 , MF_SURGE_FDG =1435 , MF_ERLANGPDF =1441 , MF_HILL_D =1801 , MF_HILL_DD =1811 , MF_HILL_SDD =1821 , MF_IMGPROFILE =2111 , MF_P2B_RF =2233 , MF_P2B_FM2 =2313 , MF_P2B_HILL =2841 , MF_GRAHAM_INP =9501 , MF_GRAHAM_EINP , MF_GRAHAM_INPM , MF_HUANG_MET =9601 , MF_CARSON_EMET , MF_NEW_MET , MF_MLMCM =9701 } |
enum | { CSV_OK , CSV_ERROR , CSV_CANNOTOPEN , CSV_INVALIDFORMAT , CSV_TOOBIG , CSV_OUTOFMEMORY , CSV_NOTABLE } |
Functions | |
int | cptrnameSplit (char *rname, char *name1, char *name2, char *name3, int max_name_len) |
int | cptReadOne (char *cptfile, DFT *dft, int verbose) |
int | cptWrite (DFT *dft, char *filename, int cpt_format) |
void | csvInit (CSV *csv) |
void | csvEmpty (CSV *csv) |
int | csvRead (CSV *csv, char *fname) |
int | csv2dft (CSV *csv, DFT *dft) |
int | csv2dft_a (CSV *csv, DFT *dft) |
int | csv2dft_b (CSV *csv, DFT *dft) |
int | csv2dft_linkset (CSV *csv, DFT *dft) |
int | csv2dft_mat (CSV *csv, DFT *dft) |
int | csvIsRegular (CSV *csv) |
char * | csvCell (CSV *csv, int row, int col) |
void | dftInit (DFT *data) |
void | dftEmpty (DFT *data) |
int | dftSetmem (DFT *data, int frameNr, int voiNr) |
int | dftAddmem (DFT *data, int voiNr) |
int | dftAdd (DFT *data1, DFT *data2, int voi) |
int | dftSelect (DFT *data, char *name) |
int | dftSelectRegions (DFT *dft, char *region_name, int reset) |
int | dftSelectBestReference (DFT *dft) |
void | dftFrametimes (DFT *data) |
int | dftOverflow (DFT *data) |
int | dftCopyvoi (DFT *data, int from, int to) |
int | dftMovevoi (DFT *dft, int from, int to) |
int | dftDelete (DFT *dft, int voi) |
int | dftCopymainhdr (DFT *dft1, DFT *dft2) |
int | dftCopymainhdr2 (DFT *dft1, DFT *dft2, int ow) |
int | dftCopyvoihdr (DFT *dft1, int from, DFT *dft2, int to) |
int | dftdup (DFT *dft1, DFT *dft2) |
int | dftAllocateWithHeader (DFT *dft, int frameNr, int voiNr, DFT *dft_from) |
int | dftAddnullframe (DFT *data) |
int | dftSort (DFT *data) |
int | dftSortPlane (DFT *data) |
int | dft_nr_of_NA (DFT *dft) |
int | dftNAfill (DFT *dft) |
int | dftMinMax (DFT *dft, double *minx, double *maxx, double *miny, double *maxy) |
int | dftMinMaxTAC (DFT *dft, int tacindex, double *minx, double *maxx, double *miny, double *maxy, int *mini, int *maxi, int *mins, int *maxs) |
int | dftMaxY (DFT *dft, double t1, double t2, double *miny, double *maxy) |
double | dft_kBqMin (DFT *data) |
double | dft_kBqMax (DFT *data) |
int | dftSortByFrame (DFT *dft) |
int | dftDeleteFrameOverlap (DFT *dft) |
int | dftDeleteFrameOverlap_old (DFT *dft) |
int | dftRemoveTimeRange (DFT *dft, double startT, double endT) |
void | dftSetComments (DFT *dft) |
int | dftFillInitialGap (DFT *dft) |
int | dftAddSpaceForFrames (DFT *dft, int nr_to_add) |
void | dftRNameSimplify (DFT *dft, int hemisphere, int place) |
int | dftMeanTAC (DFT *dft, DFT *mean) |
int | dftValidNr (DFT *dft, double tstart, double tstop, int index) |
int | dftDecayCorrection (DFT *dft, double hl, int mode, int y, int y2, int y3, char *status, int verbose) |
int | dftRead (char *filename, DFT *data) |
int | dftWrite (DFT *data, char *filename) |
void | dftPrint (DFT *data) |
int | dftFormat (char *fname) |
int | dftType (FILE *fp) |
int | dftWriteHTML (DFT *dft, char *fname, int orientation) |
int | dftWriteXHTML11_doctype (FILE *fp) |
int | dftWriteXHTML11_head (FILE *fp, char *author_name) |
int | dft_fill_hdr_from_IFT (DFT *dft, IFT *ift) |
int | dftGetPmodTitle (DFT *dft, char *title_line) |
int | res_allocate_with_dft (RES *res, DFT *dft) |
int | dftToResult (DFT *dft, RES *res, char *status) |
void | dftUnitToDFT (DFT *dft, int dunit) |
int | dftUnitConversion (DFT *dft, int dunit) |
int | dftTimeunitToDFT (DFT *dft, const char *timeunit) |
int | dftTimeunitConversion (DFT *dft, int tunit) |
void | dftMin2sec (DFT *data) |
void | dftSec2min (DFT *data) |
int | fit_allocate_with_dft (FIT *fit, DFT *dft) |
int | fitToResult (FIT *fit, RES *res, char *status) |
int | idwcWrite (DFT *dft, char *filename) |
int | idwcRead (char *filename, DFT *dft) |
int | ifWrite (DFT *dft, char *filename) |
int | ifRead (char *filename, DFT *dft) |
void | fitEmpty (FIT *fit) |
void | fitInit (FIT *fit) |
int | fitSetmem (FIT *fit, int voiNr) |
void | fitPrint (FIT *fit) |
int | fitWrite (FIT *fit, char *filename) |
int | fitRead (char *filename, FIT *fit, int verbose) |
int | fitEval (FitVOI *r, double x, double *y) |
int | fitEvaltac (FitVOI *r, double *x, double *y, int dataNr) |
int | fitFunctionname (int type, char *str) |
int | fitFunctionformat (int type, char *str) |
int | fitIntegralEval (FitVOI *r, double x, double *yi) |
int | fitIntegralEvaltac (FitVOI *r, double *x, double *yi, int dataNr) |
int | fitDerivEval (FitVOI *r, double x, double *yd) |
int | fitDerivEvaltac (FitVOI *r, double *x, double *yd, int dataNr) |
unsigned int | factorial (unsigned int n) |
unsigned long long int | lfactorial (unsigned long long int n) |
double | igam (double a, double x) |
double | igamc (double a, double x) |
int | roikbqWrite (DFT *dft, char *fname) |
int | roikbqRead (char *fname, DFT *dft) |
int | res2ift (RES *res, IFT *ift, int verbose) |
void | resEmpty (RES *res) |
void | resInit (RES *res) |
int | resSetmem (RES *res, int voiNr) |
void | resFixParnames (RES *res) |
void | resPrint (RES *res) |
int | resRead (char *filename, RES *res, int verbose) |
int | resWrite (RES *res, char *filename, int verbose) |
int | resWriteHTML (RES *res, char *fname, int verbose) |
int | resFName2study (char *fname, char *studyNumber) |
int | resMedian (double *data, int nr, double *median, double *min, double *max) |
int | resMean (double *data, int nr, double *mean, double *sd) |
void | resSortByName (RES *res) |
int | resCopyMHeader (RES *res1, RES *res2) |
int | resDelete (RES *res, int voi) |
int | resSelect (RES *data, char *name) |
int | resSelectRegions (RES *res, char *region_name, int reset) |
int | resParameterPrintType (RES *res, int parIndex) |
int | resWriteXHTML11_doctype (FILE *fp) |
int | resWriteXHTML11_head (FILE *fp, char *author_name) |
int | resWriteHTML_table (RES *res, FILE *fp) |
int | resIsDuplicateNames (RES *res) |
int | resMatchHeader (RES *res1, RES *res2) |
int | resMatchRegions (RES *res1, RES *res2) |
int | resMatchParameternames (RES *res1, RES *res2) |
int | resMatchParameters (RES *res1, RES *res2, int test_par, double test_limit, int test_sd) |
int | resMatchParametersAbs (RES *res1, RES *res2, int test_par, double test_limit, int test_sd) |
int | resRNameSubfieldExists (RES *res) |
int | tsvRead (char *filename, DFT *dft) |
int | xelRead (char *filename, DFT *dft) |
Variables | |
char | cpterrmsg [128] |
int | CSV_TEST |
char | dfterrmsg [64] |
int | DFT_NR_OF_DECIMALS |
int | MATHFUNC_TEST |
char | fiterrmsg [64] |
int | RESULT_TEST |
char | reserrmsg [64] |
Header file for libtpccurveio.
Definition in file libtpccurveio.h.
#define BACKUP_EXTENSION ".bak" |
Backup file extension
Definition at line 27 of file libtpccurveio.h.
Referenced by dftWriteHTML(), ecat63Create(), ecat7Create(), idwcWrite(), ifWrite(), resWriteHTML(), and roikbqWrite().
#define DFT_DECAY_CORRECTED 1 |
Definition for Decay correction status in DFT structure.
Definition at line 443 of file libtpccurveio.h.
Referenced by dft_fill_hdr_from_IFT(), dftDecayCorrection(), dftPrint(), dftSetComments(), and noiseSD4SimulationFromDFT().
#define DFT_DECAY_NOTCORRECTED 2 |
Definition for Decay correction status in DFT structure.
Definition at line 445 of file libtpccurveio.h.
Referenced by dft_fill_hdr_from_IFT(), dftDecayCorrection(), dftPrint(), and dftSetComments().
#define DFT_DECAY_UNKNOWN 0 |
Definition for Decay correction status in DFT structure.
Definition at line 441 of file libtpccurveio.h.
Referenced by dftCopymainhdr2(), dftSetComments(), and noiseSD4SimulationFromDFT().
#define DFT_FORMAT_CPT 8 |
TAC file format (DFT type)
Definition at line 419 of file libtpccurveio.h.
#define DFT_FORMAT_CSV_INT 6 |
TAC file format (DFT type)
Definition at line 415 of file libtpccurveio.h.
Referenced by dftFormat(), and dftRead().
#define DFT_FORMAT_CSV_UK 7 |
TAC file format (DFT type)
Definition at line 417 of file libtpccurveio.h.
Referenced by dftFormat(), and dftRead().
#define DFT_FORMAT_FIT 3 |
TAC file format (DFT type)
Definition at line 409 of file libtpccurveio.h.
Referenced by dftFormat(), dftRead(), dftReadinput(), and dftReadReference().
#define DFT_FORMAT_HTML 12 |
TAC file format (DFT type)
Definition at line 427 of file libtpccurveio.h.
Referenced by dftWrite().
#define DFT_FORMAT_IDWC 9 |
TAC file format (DFT type)
Definition at line 421 of file libtpccurveio.h.
Referenced by dftFormat(), and dftRead().
#define DFT_FORMAT_IF 10 |
TAC file format (DFT type)
Definition at line 423 of file libtpccurveio.h.
Referenced by dftFormat(), and dftRead().
#define DFT_FORMAT_IFT 2 |
#define DFT_FORMAT_NCI 4 |
TAC file format (DFT type)
Definition at line 411 of file libtpccurveio.h.
Referenced by dftFormat(), and dftRead().
#define DFT_FORMAT_PLAIN 0 |
TAC file format (DFT type)
Definition at line 403 of file libtpccurveio.h.
Referenced by csv2dft(), dftAdd(), dftFormat(), dftRead(), dftWrite(), and dftWriteHTML().
#define DFT_FORMAT_PMOD 5 |
TAC file format (DFT type)
Definition at line 413 of file libtpccurveio.h.
Referenced by dftFormat(), dftRead(), dftSetComments(), and dftWrite().
#define DFT_FORMAT_STANDARD 1 |
TAC file format (DFT type)
Definition at line 405 of file libtpccurveio.h.
Referenced by bf_srtm(), csv2dft_a(), csv2dft_b(), csv2dft_linkset(), csv2dft_mat(), dftAllocateWithIMG(), dftFormat(), dftRead(), dftSetComments(), dftTimeIntegral(), dftWrite(), and sif2dft().
#define DFT_FORMAT_UNKNOWN -1 |
TAC file format (DFT type)
Definition at line 401 of file libtpccurveio.h.
Referenced by dftFormat(), dftRead(), and dftReadinput().
#define DFT_FORMAT_XELERIS 13 |
TAC file format (DFT type)
Definition at line 429 of file libtpccurveio.h.
#define DFT_FORMAT_XML 11 |
TAC file format (DFT type)
Definition at line 425 of file libtpccurveio.h.
#define DFT_TIME_END 2 |
Definition for DFT (frame) time type
Definition at line 436 of file libtpccurveio.h.
Referenced by check_times_dft_vs_dft(), check_times_dft_vs_img(), dftEndtime(), dftFrametimes(), dftRead(), and dftWrite().
#define DFT_TIME_MIDDLE 0 |
Definition for DFT (frame) time type
Definition at line 432 of file libtpccurveio.h.
Referenced by check_times_dft_vs_dft(), check_times_dft_vs_img(), csv2dft_a(), csv2dft_linkset(), dftAutointerpolate(), dftDerivative(), dftEndtime(), dftFrametimes(), dftGetPmodTitle(), dftRead(), dftTimeIntegral(), dftWeightByFreq(), dftWrite(), and extrapolate_monoexp().
#define DFT_TIME_START 1 |
Definition for DFT (frame) time type
Definition at line 434 of file libtpccurveio.h.
Referenced by check_times_dft_vs_dft(), check_times_dft_vs_img(), dftEndtime(), dftFrametimes(), dftRead(), and dftWrite().
#define DFT_TIME_STARTEND 3 |
Definition for DFT (frame) time type
Definition at line 438 of file libtpccurveio.h.
Referenced by bfIrr2TCM(), bfRadiowater(), check_times_dft_vs_dft(), check_times_dft_vs_img(), clusterTACs(), copy_times_from_img_to_dft(), csv2dft_a(), csv2dft_b(), csv2dft_mat(), dft_nr_of_NA(), dftAllocateWithIMG(), dftAutointerpolate(), dftDecayCorrection(), dftDeleteFrameOverlap(), dftDeleteFrameOverlap_old(), dftDerivative(), dftDivideFrames(), dftDoubleFrames(), dftEndtime(), dftFillInitialGap(), dftFixPeak(), dftFrametimes(), dftGetPmodTitle(), dftInterpolate(), dftInterpolateCheckEnd(), dftInterpolateCheckStart(), dftInterpolateForIMG(), dftInterpolateInto(), dftMaxY(), dftMinMax(), dftMinMaxTAC(), dftRead(), dftReadinput(), dftReadModelingData(), dftReadReference(), dftRobustMinMaxTAC(), dftTimeIntegral(), dftValidNr(), dftVerifyPeak(), dftWeightByFreq(), dftWrite(), fit_allocate_with_dft(), fittime_from_dft(), res_allocate_with_dft(), sif2dft(), and simMyocDiameterCurve().
#define MAX_FITPARAMS 100 |
Max nr of parameters in FIT
Definition at line 239 of file libtpccurveio.h.
#define MAX_RESPARAMS 100 |
Max nr of parameters
Definition at line 133 of file libtpccurveio.h.
Referenced by dftToResult(), rescoll_tabulate(), resEmpty(), resFixParnames(), resRead(), resSetmem(), resWrite(), and resWriteHTML_table().
#define MAX_RESPARNAME_LEN 15 |
Max length of parameter names and units
Definition at line 137 of file libtpccurveio.h.
Referenced by resFixParnames(), and resRead().
anonymous enum |
CSV structure status.
Definition at line 348 of file libtpccurveio.h.
enum mathfuncs |
FIT functions
Definition at line 243 of file libtpccurveio.h.
|
extern |
Read TACs from CPT file into a DFT.
cptfile | CPT filename |
dft | Pointer to DFT where TACs are read; must be empty and initialized |
verbose | Verbose level; if zero, then only warnings are printed into stderr |
Definition at line 59 of file cpt.c.
|
extern |
Split region name into 1-3 subparts of given max length.
rname | Region name to split (string is not edited) |
name1 | Pointer to 1st subname (anatomical region) |
name2 | Pointer to 2nd subname (usually hemisphere) |
name3 | Pointer to 3rd subname (usually image plane) |
max_name_len | Max lenght of subnames, excluding terminal null |
Definition at line 24 of file cpt.c.
Referenced by cptReadOne().
|
extern |
Write TAC data in CPT (Imagetool) format. If TACs are from different planes, then each plane will be saved in its own file.
dft | TAC data to write |
filename | CPT path and file name without extension, because this function may need to add plane number before .cpt |
cpt_format | Specific CPT format: 0=default, others not yet supported |
Definition at line 308 of file cpt.c.
Reads different CSV formats into DFT struct
csv | Pointer to CSV data to be converted |
dft | Pointer to empty DFT struct which will be allocated and filled here |
Definition at line 200 of file csv.c.
Referenced by dftRead().
Reads simple and Inveon type 1 data into DFT struct
csv | Pointer to CSV data to be converted |
dft | Pointer to empty DFT struct which will be allocated and filled here |
Definition at line 262 of file csv.c.
Referenced by csv2dft().
Reads Inveon type 2 data into DFT struct
csv | Pointer to CSV data to be converted |
dft | Pointer to empty DFT struct which will be allocated and filled here |
Definition at line 458 of file csv.c.
Referenced by csv2dft().
Reads LinkSet data into DFT struct.
csv | Pointer to CSV data to be converted |
dft | Pointer to empty DFT struct which will be allocated and filled here |
Definition at line 584 of file csv.c.
Referenced by csv2dft().
Reads Mat data into DFT struct.
csv | Pointer to CSV data to be converted |
dft | Pointer to empty DFT struct which will be allocated and filled here |
Definition at line 713 of file csv.c.
Referenced by csv2dft().
|
extern |
Get the CVS field contents in specified row and column.
Definition at line 827 of file csv.c.
Referenced by csv2dft_mat().
|
extern |
|
extern |
|
extern |
Check whether CSV is regular, that is, each row contain the same number of columns.
csv | Pointer to CSV |
Definition at line 803 of file csv.c.
Referenced by csv2dft_mat().
|
extern |
Read CSV file.
csv | Pointer to CSV struct |
fname | Filename |
Definition at line 42 of file csv.c.
Referenced by dftFormat(), and dftRead().
Read certain keys from IFT and set DFT fields accordingly.
dft | Pointer to allocated DFT struct where information will be written |
ift | Pointer to IFT struct from where information is retrieved |
Definition at line 971 of file dftio.c.
Referenced by dftRead().
|
extern |
Returns the highest activity value in DFT
data | Pointer to DFT struct |
Definition at line 1148 of file dft.c.
Referenced by dftInterpolateCheckStart().
|
extern |
|
extern |
Check DFT for NA's in sample times and values.
dft | Pointer to DFT struct |
Definition at line 905 of file dft.c.
Referenced by dftInterpolateInto(), dftReadModelingData(), and imgReadModelingData().
Add the specified voi [0,voiNr-1] from data2 to data1. Allocates memory for additional data VOI, if necessary.
data1 | Pointer to DFT struct data |
data2 | Pointer to DFT struct data |
voi | Index of TAC in the 2nd DFT |
Definition at line 188 of file dft.c.
|
extern |
Adds room for additional VOI TAC(s) into DFT data structure.
Old data is left unchanged.
dft | Pointer to DFT data structure |
voiNr | Nr of additional VOI memory blocks |
Definition at line 107 of file dft.c.
Referenced by dftAdd(), dftInterpolateInto(), dftReadModelingData(), and imgReadModelingData().
|
extern |
Include a frame with time 0, unless one already exists.
data | Pointer to DFT struct |
Definition at line 752 of file dft.c.
|
extern |
Add space for additional frames into DFT, keeping the existing data. frameNr is increased by nr_to_add, but new last frame(s) are empty.
dft | Allocated and data-filled DFT where new frame(s) are added to the end |
nr_to_add | Nr of frames to add |
Definition at line 1465 of file dft.c.
Allocates a DFT structure with specified size, containing no TAC data but header information as available in another DFT struct.
Any existing content of dft2 will be deleted. Dft2 must be initiated.
dft | Pointer to initiated DFT struct which will be allocated here; any previous contents will be deleted. |
frameNr | Nr of frames to be allocated |
voiNr | Nr of planes to be allocated |
dft_from | Pointer to DFT struct where header contents will be copied from |
Definition at line 702 of file dft.c.
Referenced by dftInterpolateForIMG(), dftMeanTAC(), and dftTimeIntegral().
Copy main header info from dft1 to dft2.
dft1 | Pointer to DFT struct from where information is copied |
dft2 | Pointer to DFT struct into which information is copied to |
Definition at line 561 of file dft.c.
Referenced by dftAddSpaceForFrames(), dftAllocateWithHeader(), dftAutointerpolate(), dftDivideFrames(), dftDoubleFrames(), dftdup(), dftFillInitialGap(), dftInterpolate(), extrapolate_monoexp(), and plotdata_as_dft().
Copy main header info from dft1 to dft2. Comments are not copied, because those may contain outdated units and other information.
dft1 | Pointer to DFT struct from where information is copied |
dft2 | Pointer to DFT struct into which information is copied to |
ow | Existing header field content is overwritten (1) or kept (0) |
Definition at line 587 of file dft.c.
Referenced by bfIrr2TCM(), and bfRadiowater().
|
extern |
Copy VOI data inside DFT data structure from one place to another.
data | Pointer to DFT struct |
from | TAC index |
to | TAC index |
Definition at line 472 of file dft.c.
Referenced by dftRead().
Copy voi header info from dft1.voi[from] to dft2.voi[to].
Definition at line 623 of file dft.c.
Referenced by dftAdd(), dftAddSpaceForFrames(), dftAllocateWithHeader(), dftAutointerpolate(), dftDivideFrames(), dftDoubleFrames(), dftdup(), dftFillInitialGap(), dftInterpolate(), dftInterpolateInto(), extrapolate_monoexp(), and plotdata_as_dft().
|
extern |
Corrects TAC data for physical decay, or removed the correction.
Weights are not modified.
dft | Pointer to existing DFT data; status of decay correction in DFT is not verified, but set in this function; DFT must contain valid sample time unit. |
hl | Half-life of isotope in minutes; enter <=0, if correct isotope code is given in DFT |
mode | 0=Remove decay correction; 1=Correct for decay |
y | Apply (1) or do not apply (0) correction to y[] data in DFT |
y2 | Apply (1) or do not apply (0) correction to y2[] data in DFT |
y3 | Apply (1) or do not apply (0) correction to y3[] data in DFT |
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 |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout |
Definition at line 16 of file dftdecayc.c.
|
extern |
Delete specified TAC (0..voiNr-1) from the DFT structure.
dft | Pointer to DFT struct |
voi | TAC index |
Definition at line 538 of file dft.c.
Referenced by csv2dft_a(), and dftReadinput().
|
extern |
Correct frame start and end times if frames are slightly overlapping or have small gaps in between. Gap before the first time frame is not corrected. Large gap is not corrected and it does not lead to an error.
dft | Pointer to DFT data. Data must be sorted by increasing time. Time unit does not need to be set. Timetype must be DFT_TIME_STARTEND, i.e. both frame start and end time must be present; if not, then return value is always 0 (passed). |
Definition at line 1237 of file dft.c.
Referenced by dftReadModelingData().
|
extern |
Correct frame start and end times if frames are slightly overlapping or have small gaps in between. Large gap is not corrected and it does not lead to an error.
dft | Pointer to DFT data. Time unit must be set, otherwise no checking is done. Timetype must be DFT_TIME_STARTEND, i.e. both frame start and end time must be present. |
Definition at line 1200 of file dft.c.
Makes a duplicate of DFT structure pointed to by dft1 into dft2.
dft1 | Pointer to DFT struct |
dft2 | Pointer to initiated DFT struct; any existing content of dft2 will be deleted. |
Definition at line 655 of file dft.c.
Referenced by dftAddSpaceForFrames(), dftFillInitialGap(), dftReadinput(), and imgReadModelingData().
|
extern |
Free memory allocated for DFT. All data is cleared.
data | Pointer to initiated DFT struct data |
Definition at line 20 of file dft.c.
Referenced by bfIrr2TCM(), bfRadiowater(), clusterTACs(), cptReadOne(), csv2dft_a(), csv2dft_b(), csv2dft_linkset(), csv2dft_mat(), dftAddnullframe(), dftAddSpaceForFrames(), dftAllocateWithHeader(), dftAutointerpolate(), dftDivideFrames(), dftDoubleFrames(), dftdup(), dftFillInitialGap(), dftInterpolate(), dftInterpolateForIMG(), dftInterpolateInto(), dftMeanTAC(), dftRead(), dftReadinput(), dftReadModelingData(), dftReadReference(), dftSetmem(), extrapolate_monoexp(), idwcRead(), ifRead(), img_k1_using_ki(), img_logan(), img_patlak(), imgMaskPixelTACs(), imgReadModelingData(), noiseSD4SimulationFromDFT(), plotdata_as_dft(), roikbqRead(), and simMyocDiameterCurve().
|
extern |
Check if there is a time gap between time zero and first sample time; if gap does not exist, then nothing is done; if gap exists, then gap is filled with an extra frame.
dft | Pointer to DFT struct |
Definition at line 1385 of file dft.c.
Referenced by dftFixPeak().
|
extern |
Determine the type of DFT file. This will replace dftType().
Note that only some of formats are currently identified, and identification does not mean that dftRead() supports the format.
fname | Pointer to file name; this string is not modified. |
Definition at line 422 of file dftio.c.
Referenced by dftRead(), dftReadinput(), and dftReadReference().
|
extern |
Calculate frame mid or start and end times. Timetype is not changed.
data | Pointer to DFT struct |
Definition at line 340 of file dft.c.
Referenced by csv2dft_a(), dftRead(), and idwcRead().
|
extern |
Read single title line from PMOD files and set DFT fields accordingly. Alternatively, reads the number of regions in PMOD title line.
dft | Pointer to allocated DFT struct where information will be written; Enter NULL, if only the nr of regions is to be returned. |
title_line | Pointer to string containing the title line; string is not modified |
Definition at line 1109 of file dftio.c.
Referenced by dftRead().
|
extern |
Initiate DFT structure. This should be called once before use.
data | Pointer to initiated DFT struct data |
Definition at line 38 of file dft.c.
Referenced by dftAddnullframe(), dftAddSpaceForFrames(), dftFillInitialGap(), dftReadinput(), dftReadModelingData(), dftReadReference(), img_k1_using_ki(), img_logan(), img_patlak(), imgReadModelingData(), noiseSD4SimulationFromDFT(), and plotdata_as_dft().
|
extern |
Search the min and max values of DFT TAC data inside specified time range.
Data may contain NA's.
dft | Pointer to the DFT TAC data to search |
t1 | Start time |
t2 | End time |
miny | Pointer to min Y; set to NULL if not needed |
maxy | Pointer to max Y; set to NULL if not needed |
Definition at line 1090 of file dft.c.
Referenced by plot_fitrange_svg().
Calculates mean TAC of all TACs in DFT struct. Mean is NOT weighted by VOI sizes. Also SD and CV for each sample time are calculated.
dft | Pointer to TAC data from which mean TAC is calculated; missing values (NaN) are allowed |
mean | Pointer to initialized or pre-allocated DFT struct in where mean, SD, and CV will be written in y, y2, and y3, respectively. |
Definition at line 1580 of file dft.c.
Referenced by noiseSD4SimulationFromDFT().
|
extern |
Change time unit from min to sec, without checking original unit.
Definition at line 145 of file dftunit.c.
Referenced by copy_times_from_img_to_dft(), cptWrite(), and dftTimeunitConversion().
|
extern |
Search the min and max values of DFT TAC data. Data may contain NA's.
Note that minx and maxx are the smallest and highest x values in data, not the x values at y minimum and maximum; use dftMinMaxTAC() for that.
dft | Pointer to the DFT TAC data to search |
minx | Pointer to min X; set to NULL if not needed |
maxx | Pointer to max X; set to NULL if not needed |
miny | Pointer to min Y; set to NULL if not needed |
maxy | Pointer to max Y; set to NULL if not needed |
Definition at line 974 of file dft.c.
Referenced by plot_fit_svg(), and plot_fitrange_svg().
|
extern |
Search the min and max values of DFT TAC data. Data may contain NA's. This is not a replacement of dftMinMax() which is needed e.g. in plotting functions.
dft | Pointer to the DFT TAC data to search |
tacindex | Index of the only TAC which is searched for min and max; <0 if all |
minx | Pointer to X at TAC min; set to NULL if not needed |
maxx | Pointer to X at TAC max; set to NULL if not needed |
miny | Pointer to min Y; set to NULL if not needed |
maxy | Pointer to max Y; set to NULL if not needed |
mini | Index of min TAC; set to NULL if not needed |
maxi | Index of max TAC; set to NULL if not needed |
mins | Index of min sample; set to NULL if not needed |
maxs | Index of max sample; set to NULL if not needed |
Definition at line 1024 of file dft.c.
Referenced by dftFixPeak(), and dftVerifyPeak().
|
extern |
Move VOI in DFT structure from one position to another.
dft | Pointer to DFT struct |
from | TAC index |
to | TAC index |
Definition at line 508 of file dft.c.
Referenced by dftDelete(), and dftReadinput().
|
extern |
Replace NA's in basic DFT data with interpolated values. If extrapolation is necessary, then the values (0,0) and (Infinity,last measured) are assumed.
dft | Pointer to DFT struct |
Definition at line 930 of file dft.c.
|
extern |
|
extern |
Prints to stdout the contents of DFT data structure. Mainly for testing purposes.
Definition at line 538 of file dftio.c.
Referenced by csv2dft(), dftRead(), img_k1_using_ki(), img_logan(), and img_patlak().
|
extern |
Read TAC file contents into specified DFT data structure. Reads standard DFT files, plain DFT files, and some other formats.
filename | Name of file to be read. |
data | Pointer to initiated DFT struct where data will be written; any old content is deleted. |
Definition at line 22 of file dftio.c.
Referenced by dftReadinput(), dftReadModelingData(), dftReadReference(), and imgReadModelingData().
|
extern |
Extract specified sample time interval from TAC data.
dft | Pointer to DFT struct from where samples outside time range will be removed. Data must be sorted to increasing frame times before calling this function. |
startT | Start time of data that is preserved (in same units as in DFT) |
endT | End time of data that is preserved (in same units as in DFT) |
Definition at line 1275 of file dft.c.
|
extern |
Simplify TAC names in DFT struct: empty hemisphere and/or place field in case those are the same in all TACs.
dft | Pointer to DFT struct |
hemisphere | Is hemisphere field simplified (1) or not (0), when possible |
place | Is place field simplified (1) or not (0), when possible |
Definition at line 1534 of file dft.c.
|
extern |
Change time unit from sec to min, without checking original unit.
Definition at line 160 of file dftunit.c.
Referenced by copy_times_from_img_to_dft(), cptReadOne(), and dftTimeunitConversion().
|
extern |
Select VOIs (sets sw=1), whose names are matching specified string. If no string is specified, then all VOIs are selected. This function is to replaced by dftSelectRegions().
data | Pointer to DFT struct |
name | String to search in TAC name fields |
Definition at line 239 of file dft.c.
|
extern |
Select the best reference region in case that several were found with dftSelectRegions.
dft | Pointer to DFT struct, after using dftSelectRegions() |
Definition at line 314 of file dft.c.
Referenced by dftReadinput(), and dftReadReference().
|
extern |
Select the VOIs that have matching region name or number. Sets sw=1 or sw=0. This function will replace dftSelect().
dft | Pointer to DFT data where VOIs are selected |
region_name | Name or VOI number which is searched |
reset | 1=Non-matching VOIs are deselected, 0=Old selections are preserved |
Definition at line 285 of file dft.c.
Referenced by dftReadinput(), and dftReadReference().
|
extern |
Overwrites DFT comments with information in current DFT header.
If DFT format specifies that titles are to be saved, that information is not included in comments.
dft | Pointer to DFT struct |
Definition at line 1326 of file dft.c.
Referenced by dftRead().
|
extern |
Allocate memory for DFT data and sets data pointers.
data | Pointer to initiated DFT structure data; any old contents are deleted. |
frameNr | Nr of time frames (samples) to allocate |
voiNr | Nr of concentration arrays (regional TACs) to allocate |
Definition at line 57 of file dft.c.
Referenced by bf_srtm(), bfIrr2TCM(), bfRadiowater(), clusterTACs(), cptReadOne(), csv2dft_a(), csv2dft_b(), csv2dft_linkset(), csv2dft_mat(), dftAddnullframe(), dftAddSpaceForFrames(), dftAllocateWithHeader(), dftAllocateWithIMG(), dftAutointerpolate(), dftDivideFrames(), dftDoubleFrames(), dftdup(), dftFillInitialGap(), dftInterpolate(), dftRead(), extrapolate_monoexp(), idwcRead(), ifRead(), img_k1_using_ki(), img_logan(), img_patlak(), plotdata_as_dft(), roikbqRead(), sif2dft(), simMyocDiameterCurve(), tsvRead(), and xelRead().
|
extern |
|
extern |
Sorts TAC frames by increasing sample time.
dft | Pointer to DFT struct |
Definition at line 1169 of file dft.c.
Referenced by dftReadModelingData(), and dftVerifyPeak().
|
extern |
Sort DFT regions in alphabetical order by their plane.
data | Pointer to DFT struct |
Definition at line 875 of file dft.c.
Referenced by cptWrite().
|
extern |
Conversion of the DFT timeunit. Changes both data values and timeunit code. Currently available conversions are: min <-> sec
dft | Pointer to existing DFT data, whose timeunit is to be changed |
tunit | New timeunit code |
Definition at line 119 of file dftunit.c.
Referenced by dftInterpolateCheckEnd(), dftInterpolateCheckStart(), dftMatchTimeunits(), dftReadinput(), dftReadModelingData(), dftReadReference(), img_logan(), img_patlak(), and imgReadModelingData().
|
extern |
Copy the contents (both header and data) of DFT struct into RES struct.
dft | Regional data from where necessary information is read. |
res | Pointer to initiated RES struct which will be allocated here. |
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 60 of file dftres.c.
|
extern |
Determine the type of DFT file.
Definition at line 503 of file dftio.c.
|
extern |
Conversion of the DFT calibration unit. Changes both data values and unit string. Currently available conversions are: MBq/cc <-> kBq/cc <-> Bq/cc <-> nCi/cc <-> uCi/cc Bq <-> kBq <-> MBq <-> GBq <-> nCi <-> uCi <-> mCi
dft | Pointer to existing DFT data, whose calibration unit is to be changed |
dunit | New unit code |
Definition at line 25 of file dftunit.c.
Referenced by cunit_check_dft_vs_img(), dftReadinput(), dftReadModelingData(), and dftReadReference().
|
extern |
Set DFT calibration unit string
Definition at line 11 of file dftunit.c.
Referenced by csv2dft_a(), csv2dft_b(), csv2dft_linkset(), csv2dft_mat(), dftUnitConversion(), and tsvRead().
|
extern |
Determine the nr of valid data points inside the given time range.
dft | Pointer to DFT struct |
tstart | Time range start |
tstop | Time range stop |
index | Index of TAC to use; enter <0 to use all, in which case the minimum number of valid points is returned. |
Definition at line 1638 of file dft.c.
Referenced by dftValidNr().
|
extern |
Write DFT data, usually containing regional time-activity curves (TACs) into specified file.
The file format specified in data is applied. Number of decimals can be determined by changing global variable DFT_NR_OF_DECIMALS.
data | Pointer to DFT structure which contents are to be written. |
filename | File name where DFT contents are written. If file exists, original file is renamed to a backup file. |
Definition at line 594 of file dftio.c.
Referenced by plotdata_as_dft().
|
extern |
Write DFT contents in HTML table format If file exists, a backup file (+BACKUP_EXTENSION) is written also. If "stdout" is given as filename, output is directed to stdout In case of an error, description is written in dfterrmsg.
dft | Input DFT |
fname | HTML filename |
orientation | Table orientation: 1=original, 2=transposed |
Definition at line 757 of file dftio.c.
Referenced by dftWrite().
|
extern |
Write XHTML 1.1 doctype into an opened file pointer.
Definition at line 908 of file dftio.c.
Referenced by dftWriteHTML().
|
extern |
Write XHTML 1.1 head for DFT file into an opened file pointer.
fp | File pointer where to write |
author_name | Author name, for example software name |
Definition at line 926 of file dftio.c.
Referenced by dftWriteHTML().
|
extern |
Calculate factorial of given number.
n | Integer n, from which the factorial is calculated. |
Definition at line 1678 of file mathfunc.c.
Referenced by factorial().
Allocate memory for regional function fits based on information in DFT.
fit | Pointer to initiated FIT struct which will be allocated here and filled with ROI names etc. |
dft | Regional data from where necessary information is read. |
Definition at line 14 of file fitres.c.
Referenced by dft_end_line().
|
extern |
Evaluates yd=Df(x).
r | Fit parameters of a single region |
x | Time where to evaluate the derivative of the function |
yd | The derivative of the function is returned here |
Definition at line 1540 of file mathfunc.c.
Referenced by fitDerivEvaltac().
|
extern |
Evaluates an array yd[i]=Df(x[i]).
r | Fit parameters of a single region |
x | Times where to evaluate the function derivatives |
yd | Array for the function derivatives |
dataNr | Nr of (x,yd) data |
Definition at line 1655 of file mathfunc.c.
|
extern |
Free memory allocated for FIT. All contents are cleared.
fit | Pointer to FIT struct. |
Definition at line 18 of file mathfunc.c.
Referenced by fitRead(), and fitSetmem().
|
extern |
Evaluate y=f(x).
r | Fit parameters of a single region |
x | Time where to evaluate the function |
y | The value of the function is returned here |
Definition at line 645 of file mathfunc.c.
Referenced by fitEvaltac().
|
extern |
Evaluates an array y[i]=f(x[i]).
r | Fit parameters of a single region |
x | Times where to evaluate the function |
y | Array for the function values |
dataNr | Nr of (x,y) data |
Definition at line 1252 of file mathfunc.c.
|
extern |
Copies the description of a function type to the specified string which must have space for >=128 characters.
type | The number of function |
str | Representation of the format of the function |
Definition at line 381 of file mathfunc.c.
|
extern |
Copies the name of the function to the specified string which must have space for >=128 characters.
type | The number of function |
str | Name of the function |
Definition at line 539 of file mathfunc.c.
|
extern |
Initiate FIT structure. Call this once before first use.
Definition at line 38 of file mathfunc.c.
|
extern |
Evaluates yi=Integral of f(x) between 0 and x.
r | Fit parameters of a single region |
x | Time where to evaluate integral of the function |
yi | The integral value of the function is returned here |
Definition at line 1308 of file mathfunc.c.
Referenced by fitIntegralEvaltac().
|
extern |
Evaluate an array yi[i]=Integral of f(x[i]) between 0 and x.
r | Fit parameters of a single region |
x | Times where to evaluate the function integrals |
yi | Array for the function integral values |
dataNr | Nr of (x,yi) data |
Definition at line 1517 of file mathfunc.c.
|
extern |
Print to stdout the contents of FIT data structure.
Mainly for testing purposes.
fit | Pointer to FIT struct. |
Definition at line 180 of file mathfunc.c.
|
extern |
Read FIT file contents to the specified data structure, emptying its old contents.
filename | Pointer to file name. |
fit | Pointer to initiated FIT struct. |
verbose | Verbose level; if <=0, then nothing is printed into stdout. |
Definition at line 196 of file mathfunc.c.
|
extern |
Allocate memory for FIT data. Any previous contents are destroyed.
fit | Pointer to FIT struct. |
voiNr | Nr of TACs to allocate. |
Definition at line 154 of file mathfunc.c.
Referenced by fit_allocate_with_dft(), and fitRead().
Conversion of FIT contents to RES.
fit | Pointer to FIT structure, contents of which are written to RES struct. |
res | Pointer to initiated RES struct where FIT contents are written; any previous contents are removed. |
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 56 of file fitres.c.
|
extern |
Write function parameters in FIT into specified file.
If necessary, a backup file (+BACKUP_EXTENSION) is created.
fit | Pointer to FIT struct. |
filename | Filename. |
Definition at line 54 of file mathfunc.c.
Referenced by fitPrint().
|
extern |
Read IDWC file into DFT data structure. Any previous content of DFT is deleted.
filename | Name of IDWC file to be read |
dft | Pointer to DFT data where to regional TAC data is read |
Definition at line 77 of file idwc.c.
Referenced by dftRead().
|
extern |
Write DFT data into IDWC file format. If file exists, a backup file (+BACKUP_EXTENSION) is written.
dft | Pointer to DFT data that is written in IDWC format |
filename | Name of IDWC file to be written; also "stdout" is accepted |
Definition at line 18 of file idwc.c.
|
extern |
Read IF file into DFT data structure, metabolite corrected plasma as TAC #1 and whole blood as TAC #2. Any previous content of DFT is deleted.
filename | Name of IDWC file to be read |
dft | Pointer to DFT data where to regional TAC data is read |
Definition at line 78 of file if.c.
Referenced by dftRead().
|
extern |
Write metabolite corrected plasma TAC and blood TAC into IF file format. If file exists, a backup file (+BACKUP_EXTENSION) is written.
dft | Pointer to DFT data that will be written in IF format: first TAC must be the metabolite corrected plasma, and the 2nd TAC must be the whole blood TAC. |
filename | Name of IF file to be written; also "stdout" is accepted |
Definition at line 18 of file if.c.
|
extern |
Cumulative gamma distribution, or Regularized gamma function, more specifically, lower incomplete gamma function divided by gamma function.
Standard gamma distribution is assumed (Beta=1). f(a,x) = (1/Gamma(a)) * Integral(0,x)(e^-t * t^(a-1))dt
a | Shape parameter alpha; must be > 0. |
x | Integral from 0 to x; must be >= 0. |
Definition at line 1715 of file mathfunc.c.
|
extern |
Regularized gamma function, more specifically, upper incomplete gamma function divided by gamma function.
f(a,x) = (1/Gamma(a)) * Integral(x,Inf)(e^-t * t^(a-1))dt Standard gamma distribution is assumed (Beta=1).
a | Shape parameter alpha; must be > 0. |
x | Integral from x to infinity; must be >= 0 |
Definition at line 1756 of file mathfunc.c.
Referenced by igam().
|
extern |
Calculate factorial of given number.
n | Integer n, from which the factorial is calculated. |
Definition at line 1695 of file mathfunc.c.
Referenced by fitEval(), fitIntegralEval(), and lfactorial().
Copy results in RES structure into IFT structure.
res | Pointer to RES structure |
ift | Pointer to initiated IFT structure |
verbose | Verbose level; if zero, then nothing is printed into stdout or stderr |
Definition at line 14 of file resift.c.
Allocate memory for regional results based on information in DFT.
res | Pointer to initiated RES struct which will be allocated here and filled with ROI names etc. |
dft | Regional data from where necessary information is read. |
Definition at line 14 of file dftres.c.
Referenced by dftToResult().
|
extern |
Delete specified region (0..voiNr-1) from the structure.
res | Pointer to the result data. |
voi | TAC index (0..voiNr-1). |
Definition at line 1342 of file result.c.
|
extern |
Free memory allocated for results. All data are cleared.
res | Pointer to RES structure. |
Definition at line 22 of file result.c.
Referenced by fitToResult(), resInit(), resRead(), and resSetmem().
|
extern |
Fix result parameter names and units, so that both representations are filled correctly, that is, the new string lists *parname[] and *parunit[], and the deprecated titleline[] and unitline[].
New representation, if filled, always overwrites the deprecated one. Units are assumed to follow parameter name representation.
res | Pointer to RES struct. |
Definition at line 107 of file result.c.
Referenced by dftToResult(), fitToResult(), resMatchParameternames(), resRead(), resWrite(), and resWriteHTML().
|
extern |
Set study number based on file name.
|
extern |
|
extern |
Check if result structure contains duplicate region names.
res | Pointer to the result data. |
Check whether result header field values are the same.
Fields that are not checked: program, time, titleline.
res1 | Pointers to the result data that are tested |
res2 | Pointers to the result data that are tested |
Definition at line 1494 of file result.c.
Check whether result parameter names are the same.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
Definition at line 1564 of file result.c.
|
extern |
Check whether result parameter values are the same.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
test_par | Parameter index (0..parNr-1) that is verified; <0, if all. |
test_limit | Test limit (how exact match is required). |
test_sd | Test (1) or do not test (0) SD and Confidence limits. |
Definition at line 1600 of file result.c.
|
extern |
Check whether the two sets of result parameter values are similar within a given absolute range.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
test_par | Parameter index (0..parNr-1) that is verified; <0, if all. |
test_limit | Test limit; positive value, below which the absolute difference must be. |
test_sd | Test (1) or do not test (0) SD and Confidence limits. |
Definition at line 1694 of file result.c.
Check whether result region names are the same.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
Definition at line 1531 of file result.c.
|
extern |
Calculate the mean and sd in the specified double array data of length nr.
NULL pointer may be specified to function in place of an unwanted return parameter.
data | Array of data. |
nr | Length of data array. |
mean | Pointer where mean is written. |
sd | Pointer where S.D. is written. |
Definition at line 1222 of file result.c.
Referenced by rescoll_tabulate().
|
extern |
Calculate the median and the lowest and highest value in the specified double array data of length nr.
Note that array is sorted in this function. NULL pointer may be specified to function in place of an unwanted return parameter.
data | Array of data. |
nr | Length of data array. |
median | Pointer where median is written. |
min | Pointer where min is written. |
max | Pointer where max is written. |
Definition at line 1186 of file result.c.
Referenced by rescoll_tabulate().
|
extern |
Determine whether the result parameter should be printed as integer (0), float (1), or exponential (2).
res | Pointer to the result struct. |
parIndex | Index of the parameter to test. |
Definition at line 1447 of file result.c.
Referenced by rescoll_tabulate(), resWrite(), and resWriteHTML_table().
|
extern |
|
extern |
Read RES file contents to the specified data structure.
filename | Result file name. |
res | Pointer to initiated RES structure; any previous contents are deleted. |
verbose | Verbose level; if <=0, then nothing is printed into stdout. |
Definition at line 199 of file result.c.
|
extern |
Check whether region name sub-fields exist in any region.
res | Pointer to RES struct. |
Definition at line 1763 of file result.c.
|
extern |
Select VOIs (sets sw=1), whose names are matching specified string.
If no string is specified, then all VOIs are selected.
data | Pointer to the result data. |
name | Region name string. |
Definition at line 1369 of file result.c.
|
extern |
Select the VOIs that have matching region name or number.
Sets sw=1 or sw=0. This will replace resSelect().
res | Pointer to RES data where VOIs are selected |
region_name | Name or VOI number which is searched |
reset | 1=Non-matching VOIs are deselected, 0=Old selections are preserved |
Definition at line 1417 of file result.c.
|
extern |
Allocate memory for result data. Old data is destroyed.
res | Pointer to initiated and possibly allocated result data. |
voiNr | Nr of regional results. |
Definition at line 70 of file result.c.
Referenced by fitToResult(), res_allocate_with_dft(), and resRead().
|
extern |
|
extern |
Write calculation results into specified file.
If file exists, a backup file (+BACKUP_EXTENSION) is written also. If "stdout" is given as filename, output is directed to stdout. If filename extension is *.htm(l), file is saved in HTML format.
res | Pointer to result data. |
filename | Output file name. |
verbose | Verbose level; if <=0, then nothing is printed into stdout. |
Definition at line 565 of file result.c.
Referenced by resPrint().
|
extern |
Write calculation results into specied XHTML 1.1 file. If file exists, a backup file (+BACKUP_EXTENSION) is written also. If "stdout" is given as filename, output is directed to stdout.
res | Pointer to result data |
fname | Output file name |
verbose | Verbose level; if <=0, then nothing is printed into stdout |
Definition at line 865 of file result.c.
Referenced by resWrite().
|
extern |
Write calculation results as one HTML table into an opened (X)HTML file.
res | Pointer to result data. |
fp | Output file pointer. |
Definition at line 1013 of file result.c.
Referenced by resWriteHTML().
|
extern |
Write XHTML 1.1 doctype into an opened file pointer.
fp | Output file pointer. |
Definition at line 941 of file result.c.
Referenced by resWriteHTML().
|
extern |
Write XHTML 1.1 head for PET results file into an opened file pointer.
fp | File pointer where to write. |
author_name | Author name, for example software name. |
Definition at line 960 of file result.c.
Referenced by resWriteHTML().
|
extern |
Read an old TAC file in *.roi.kbq / *.roi.nci format.
fname | Pointer to filename |
dft | Pointer to an empty but initiated DFT structure where data is written |
Definition at line 95 of file ncifile.c.
Referenced by dftRead().
|
extern |
Write DFT contents in *.roi.kbq format.
dft | Pointer to DFT |
fname | Filename |
Definition at line 26 of file ncifile.c.
|
extern |
Read Amide TAC file (*.tsv) into DFT data structure. Any previous content of DFT is deleted.
filename | Name of Amide TAC file (*.tsv) to be read |
dft | Pointer to DFT data where to regional TAC data is read |
Definition at line 15 of file tsv.c.
|
extern |
Read Xeleris TAC file into DFT data structure. Any previous content of DFT is deleted.
filename | Name of Xeleris TAC file to be read |
dft | Pointer to DFT data where to regional TAC data is read |
Definition at line 14 of file xeleris.c.
|
extern |
Error message from CPT functions.
Definition at line 6 of file cpt.c.
Referenced by cptReadOne(), and cptWrite().
|
extern |
Verbose prints from CSV functions.
Definition at line 6 of file csv.c.
Referenced by csv2dft(), csv2dft_a(), csv2dft_b(), csv2dft_linkset(), csv2dft_mat(), csvRead(), dftFormat(), and dftRead().
|
extern |
Nr of decimals for concentration values.
Nr of decimals for concentration values
Definition at line 13 of file dftio.c.
Referenced by dftRead(), and dftWrite().
|
extern |
Error message from DFT functions.
Definition at line 6 of file dft.c.
Referenced by dftAdd(), dftRead(), dftReadModelingData(), dftWrite(), dftWriteHTML(), idwcRead(), idwcWrite(), ifRead(), ifWrite(), imgReadModelingData(), roikbqRead(), roikbqWrite(), tsvRead(), and xelRead().
|
extern |
Error message from FIT functions
Definition at line 6 of file mathfunc.c.
Referenced by fitRead(), and fitWrite().
|
extern |
Verbose prints from FIT functions
Definition at line 5 of file mathfunc.c.
Referenced by fitEval(), fitPrint(), and fitWrite().
|
extern |
Error message from RES functions
Definition at line 6 of file result.c.
Referenced by resRead(), resWrite(), and resWriteHTML().
|
extern |
Verbose prints from RES functions
Definition at line 5 of file result.c.
Referenced by resFixParnames(), resMatchParameternames(), resMatchParameters(), resMatchParametersAbs(), resMatchRegions(), and resWriteHTML_table().