|
TPCCLIB
|
Functions for setting weight factors based on SIF. More...
#include "libtpcimgio.h"Go to the source code of this file.
Functions | |
| void | sifWeight (SIF *data, double halflife) |
| Calculate weights for frames in SIF data based on true counts. Weights are normalized to have an average of 1.0. | |
| void | sifWeightByFrames (SIF *data, double halflife) |
| Calculate weights for frames in SIF data based on frame lengths. Weights are normalized to have an average of 1.0. | |
| void | sifWeightNorm (SIF *d) |
| void | sifModerateTrues (SIF *sif, double limit) |
| void | sifModerateWeights (SIF *sif, double limit) |
| int | sifExistentCounts (SIF *sif) |
| int sifExistentCounts | ( | SIF * | sif | ) |
Verify that SIF contains prompts and randoms.
| sif | Pointer to SIF struct |
Definition at line 207 of file weight.c.
| void sifModerateTrues | ( | SIF * | sif, |
| double | limit ) |
Moderate the trues in SIF.
True values in SIF are used to calculate weight factors for time frames. If trues are very low in certain frames, the weight factors in other frames may become very low. This function finds the maximum trues, and adds max/limit to each trues value, if min trues < max trues / limit. Negative trues are always eliminated.
| sif | Pointer to SIF in which the trues are moderated |
| limit | Max trues / limit is added to all trues values; 100.0 might be good |
Definition at line 131 of file weight.c.
Referenced by imgSetWeights().
| void sifModerateWeights | ( | SIF * | sif, |
| double | limit ) |
Moderate the weights in SIF.
This function finds the maximum weight, and adds max/limit to each weight value (except if weight is 0), if min weight < max/limit. Negative weights are set to zero.
| sif | Pointer to SIF in which the weights are moderated |
| limit | Max weight / limit is added to all weights; 100.0 might be good |
Definition at line 167 of file weight.c.
| void sifWeight | ( | SIF * | data, |
| double | halflife ) |
Calculate weights for frames in SIF data based on true counts. Weights are normalized to have an average of 1.0.
Weights are calculated from formula weight=(frame duration)^2 / (trues in a frame). Before calling this routine, trues must be calculated as total counts - randoms. Counts in SIF are not corrected for physical decay. Therefore, isotope halflife must be known, if weights are to be calculated for decay corrected TACs. Isotope halflife must be set to 0, if weights are used for TACs that are not corrected for decay.
Reference: Mazoyer BM, Huesman RH, Budinger TF, Knittel BL. Dynamic PET data analysis. J Comput Assist Tomogr 1986; 10:645-653.
| data | Pointer to SIF data. |
| halflife | Halflife (in seconds) of the isotope; If halflife is 0, the weights are calculated for non-decay corrected data. If halflife is >0, the weights are calculated using decay corrected trues, but trues data in SIF are not changed. |
Definition at line 28 of file weight.c.
Referenced by imgSetWeights().
| void sifWeightByFrames | ( | SIF * | data, |
| double | halflife ) |
Calculate weights for frames in SIF data based on frame lengths. Weights are normalized to have an average of 1.0.
Weights are calculated from the simple formula weight=(frame duration), if isotope halflife is set to 0, and using formula weight=(frame duration)*exp(-t*ln(2)/halflife), if isotope halflife is given (less weight for late frames, which may be more suitable for PET data that is corrected for physical decay).
| data | Pointer to SIF data. |
| halflife | Halflife (in seconds) of the isotope; If halflife is >0, the late frames are given less weight. |
Definition at line 72 of file weight.c.
| void sifWeightNorm | ( | SIF * | d | ) |
Scale weights in SIF data so that average weight is 1.0, and the sum of weights equals the nr of frames.
| d | Pointer to SIF data. |
Definition at line 105 of file weight.c.
Referenced by sifWeight(), and sifWeightByFrames().