TPCCLIB
Loading...
Searching...
No Matches
tpctacmod.h
Go to the documentation of this file.
1
7#ifndef _TPCTACMOD_H_
8#define _TPCTACMOD_H_
9/*****************************************************************************/
10
11/*****************************************************************************/
12#include "tpcclibConfig.h"
13/*****************************************************************************/
14#include <stdio.h>
15#include <stdlib.h>
16#include <string.h>
17#include <math.h>
18/*****************************************************************************/
19#include "tpcextensions.h"
20#include "tpcli.h"
21#include "tpctac.h"
22#include "tpcmodels.h"
23#include "tpcpar.h"
24#include "tpcfunc.h"
25/*****************************************************************************/
26
27/*****************************************************************************/
31typedef struct DELAYCMFITDATA {
33 unsigned int iNr;
35 unsigned int tNr;
37 double ttac_xmin;
39 double ttac_xmax;
41 double btac_xmin;
43 double btac_xmax;
45 double fitend;
47 double dtmin;
49 double dtmax;
51 double dtstep;
53 unsigned int moveNr;
70 int mode;
72 int model;
74 int llsq_n;
76 int llsq_m;
78 double *llsq_mat;
80 double **llsq_a;
82 double *llsq_b;
84 double *llsq_x;
86 double *llsq_wp;
88 double *llsq_zz;
90 int *llsq_i;
92/*****************************************************************************/
93
94/*****************************************************************************/
95/* litac */
96extern int tacIntegrate(
97 TAC *inp, TAC *out, TPCSTATUS *status
98);
99extern int tacIntegrateFE(
100 TAC *inp, TAC *out, TAC *out2, TPCSTATUS *status
101);
102extern int tacInterpolate(
103 TAC *inp, TAC *xinp, TAC *tac, TAC *itac, TAC *iitac, TPCSTATUS *status
104);
105extern int tacInterpolateInto(
106 TAC *inp, TAC *tac, TAC *itac, TAC *iitac, TPCSTATUS *status
107);
108extern double tacAUC(TAC *tac, int ti, double t1, double t2, TPCSTATUS *status);
109/*****************************************************************************/
110
111/*****************************************************************************/
112/* lisim */
113extern int tacInput2sim(TAC *itac, TAC *ttac, TAC *stac, TPCSTATUS *status);
114extern int tacVb(
115 TAC *ttac, const int i, TAC *btac, double Vb, const int simVb, const int petVolume,
116 TPCSTATUS *status
117);
119 TAC *inp, double minfdur, double maxfdur, TAC *tac, TPCSTATUS *status
120);
121/*****************************************************************************/
122
123/*****************************************************************************/
124/* litacrange */
125//extern int tacInterpolateCheckStart(TAC *inp, TAC *tac, int forgiving, TPCSTATUS *status);
126/*****************************************************************************/
127
128/*****************************************************************************/
129/* tacmodelinput */
130extern int tacFittime(
131 TAC *d, double *startTime, double *endTime, int *first, int *last,
132 TPCSTATUS *status
133);
134extern int tacReadModelingData(
135 const char *tissuefile, const char *inputfile1,
136 const char *inputfile2, const char *inputfile3,
137 double *fitdur, int cutInput, int *fitSampleNr, TAC *tis, TAC *inp,
138 TPCSTATUS *status
139);
140extern int tacReadReference(
141 TAC *tis, const char *reference, TAC *ref, int *refIndex, TPCSTATUS *status
142);
143extern int tacReadModelingInput(
144 const char *inputfile1, const char *inputfile2, const char *inputfile3,
145 TAC *inp, TPCSTATUS *status
146);
147/*****************************************************************************/
148
149/*****************************************************************************/
150/* tacfitplot */
151extern int tacPlotFitSVG(
152 TAC *tac1, TAC *tac2, const char *main_title,
153 const double x1, const double x2, const double y1, const double y2,
154 const char *fname, TPCSTATUS *status
155);
156extern int tacPlotLineSVG(
157 TAC *tac, const char *main_title,
158 const double x1, const double x2, const double y1, const double y2,
159 const char *fname, TPCSTATUS *status
160);
161extern int mtgaPlotSVG(
162 MTAC *mtac, const char *main_title, const char *fname, TPCSTATUS *status
163);
164/*****************************************************************************/
165
166/*****************************************************************************/
167/* histplot */
168extern int tacPlotHistogramSVG(
169 TAC *d, const char *main_title, const double x1, const double x2, const double y1, const double y2,
170 const char *fname, TPCSTATUS *status
171);
172/*****************************************************************************/
173
174/*****************************************************************************/
175/* partac */
176extern int tacAllocateWithPAR(TAC *tac, PAR *par, int sampleNr, TPCSTATUS *status);
177extern int parAllocateWithTAC(PAR *par, TAC *tac, int parNr, TPCSTATUS *status);
178extern int tacToPAR(TAC *tac, PAR *par, TPCSTATUS *status);
179/*****************************************************************************/
180
181/*****************************************************************************/
182/* delay */
183extern int tacDelay(TAC *tac, double dt, int ti, TPCSTATUS *status);
184extern void initDelayCMFitData(DELAYCMFITDATA *d);
185extern void freeDelayCMFitData(DELAYCMFITDATA *d);
186extern int tacDelayCMFit(
187 TAC *btac, TAC *ttac, int ci, double dtmin, double dtmax, double fitend, double dtstep,
188 double *dt, int mode, int model, DELAYCMFITDATA *tdata, TPCSTATUS *status
189);
190/*****************************************************************************/
191
192/*****************************************************************************/
193/* mftac */
194extern int mfCreateTAC(PAR *par, double endx, double dx, TAC *tac, TPCSTATUS *status);
195/*****************************************************************************/
196
197/*****************************************************************************/
198#endif /* _TPCTACMOD_H_ */
unsigned int iNr
Definition tpctacmod.h:33
unsigned int moveNr
Definition tpctacmod.h:53
double ** llsq_a
Definition tpctacmod.h:80
double ttac_xmax
Definition tpctacmod.h:39
double * llsq_b
Definition tpctacmod.h:82
double dtstep
Definition tpctacmod.h:51
unsigned int tNr
Definition tpctacmod.h:35
double ttac_xmin
Definition tpctacmod.h:37
double * llsq_mat
Definition tpctacmod.h:78
double btac_xmax
Definition tpctacmod.h:43
double * llsq_zz
Definition tpctacmod.h:88
double btac_xmin
Definition tpctacmod.h:41
double fitend
Definition tpctacmod.h:45
double * llsq_x
Definition tpctacmod.h:84
double * llsq_wp
Definition tpctacmod.h:86
Definition tpctac.h:149
Definition tpcpar.h:100
Definition tpctac.h:87
Header file for library libtpcextensions.
Header file for libtpcfunc.
Header file for libtpcli.
Header file for libtpcmodels.
Header file for libtpcpar.
Header file for library libtpctac.
void freeDelayCMFitData(DELAYCMFITDATA *d)
After last use, free memory in the data structure for delay time estimation.
Definition delay.c:150
int tacAllocateWithPAR(TAC *tac, PAR *par, int sampleNr, TPCSTATUS *status)
Allocate TAC based on data in PAR.
Definition partac.c:28
int tacInterpolateToEqualLengthFrames(TAC *inp, double minfdur, double maxfdur, TAC *tac, TPCSTATUS *status)
Definition lisim.c:214
int tacFittime(TAC *d, double *startTime, double *endTime, int *first, int *last, TPCSTATUS *status)
int tacVb(TAC *ttac, const int i, TAC *btac, double Vb, const int simVb, const int petVolume, TPCSTATUS *status)
Correct TTACs for vascular blood, or simulate its effect.
Definition lisim.c:138
int tacInterpolateInto(TAC *inp, TAC *tac, TAC *itac, TAC *iitac, TPCSTATUS *status)
Add TACs from one TAC structure into another TAC structure, interpolating the input TACs and allocati...
Definition litac.c:330
int tacReadModelingData(const char *tissuefile, const char *inputfile1, const char *inputfile2, const char *inputfile3, double *fitdur, int cutInput, int *fitSampleNr, TAC *tis, TAC *inp, TPCSTATUS *status)
Read tissue and input data for modelling.
int tacInterpolate(TAC *inp, TAC *xinp, TAC *tac, TAC *itac, TAC *iitac, TPCSTATUS *status)
Interpolate and/or integrate TACs from one TAC structure into a new TAC structure,...
Definition litac.c:141
int tacPlotHistogramSVG(TAC *d, const char *main_title, const double x1, const double x2, const double y1, const double y2, const char *fname, TPCSTATUS *status)
Definition histplot.c:30
int tacReadModelingInput(const char *inputfile1, const char *inputfile2, const char *inputfile3, TAC *inp, TPCSTATUS *status)
Read arterial input data for modelling.
int mtgaPlotSVG(MTAC *mtac, const char *main_title, const char *fname, TPCSTATUS *status)
Definition tacfitplot.c:489
int tacPlotLineSVG(TAC *tac, const char *main_title, const double x1, const double x2, const double y1, const double y2, const char *fname, TPCSTATUS *status)
Definition tacfitplot.c:273
int tacIntegrateFE(TAC *inp, TAC *out, TAC *out2, TPCSTATUS *status)
Integrate TACs from one TAC structure into a new TAC structure. Integrals are calculated at frame end...
Definition litac.c:75
int tacInput2sim(TAC *itac, TAC *ttac, TAC *stac, TPCSTATUS *status)
Modify input TAC based on tissue TAC, for use in simulations.
Definition lisim.c:29
int tacPlotFitSVG(TAC *tac1, TAC *tac2, const char *main_title, const double x1, const double x2, const double y1, const double y2, const char *fname, TPCSTATUS *status)
Definition tacfitplot.c:27
int parAllocateWithTAC(PAR *par, TAC *tac, int parNr, TPCSTATUS *status)
Allocate PAR based on data in TAC.
Definition partac.c:90
int tacDelay(TAC *tac, double dt, int ti, TPCSTATUS *status)
Move TAC y values (concentrations) in time, keeping sample times (x values) intact.
Definition delay.c:29
int tacReadReference(TAC *tis, const char *reference, TAC *ref, int *refIndex, TPCSTATUS *status)
Read reference tissue TAC.
int tacToPAR(TAC *tac, PAR *par, TPCSTATUS *status)
Copy the contents of TAC struct into PAR struct.
Definition partac.c:169
int tacIntegrate(TAC *inp, TAC *out, TPCSTATUS *status)
Integrate TACs from one TAC structure into a new TAC structure.
Definition litac.c:27
int mfCreateTAC(PAR *par, double endx, double dx, TAC *tac, TPCSTATUS *status)
Make TAC(s) based on mathematical functions in PAR format.
Definition mftac.c:26
void initDelayCMFitData(DELAYCMFITDATA *d)
Before first use, initiate the data structure for delay time estimation.
Definition delay.c:131
double tacAUC(TAC *tac, int ti, double t1, double t2, TPCSTATUS *status)
Calculates TAC AUC from t1 to t2.
Definition litac.c:486
int tacDelayCMFit(TAC *btac, TAC *ttac, int ci, double dtmin, double dtmax, double fitend, double dtstep, double *dt, int mode, int model, DELAYCMFITDATA *tdata, TPCSTATUS *status)
Fit time delay between PET tissue and plasma or blood curve.
Definition delay.c:179