TPCCLIB
|
Misc arithmetical routines for processing 4D IMG data. More...
#include "libtpcimgp.h"
Go to the source code of this file.
Functions | |
int | imgArithm (IMG *img1, IMG *img2, char operation, float ulimit, int verbose) |
int | imgArithmConst (IMG *img, float operand, char operation, float ulimit, int verbose) |
int | imgArithmFrame (IMG *img1, IMG *img2, char operation, float ulimit, int verbose) |
int | imgLn (IMG *img) |
int | imgLog10 (IMG *img) |
int | imgAbs (IMG *img) |
int | imgInv (IMG *img) |
int | imgFrameIntegral (IMG *img, int first, int last, IMG *iimg, int verbose) |
int | imgRawCountsPerTime (IMG *img, int operation) |
int | imgConvertUnit (IMG *img, char *unit) |
int | imgAUMC (IMG *img, IMG *oimg, int verbose) |
int | imgMRT (IMG *img, IMG *oimg, int verbose) |
Misc arithmetical routines for processing 4D IMG data.
Definition in file imgarithm.c.
int imgAbs | ( | IMG * | img | ) |
Replace IMG data values by their absolute values.
img | Pointer to IMG data. |
Definition at line 292 of file imgarithm.c.
Simple arithmetics between matching IMG planes and frames. Specify the operation as one of characters +, -, /, :, *, ., x. Results that are higher than ulimit are set to ulimit.
img1 | The first IMG data. |
img2 | The second IMG data. |
operation | Operation, one of the characters +, -, /, :, *, ., x. |
ulimit | Results that are higher than ulimit are set to ulimit; set to <=0 if not needed. |
verbose | Verbose level; if <=0, then nothing is printed into stderr. |
Definition at line 16 of file imgarithm.c.
int imgArithmConst | ( | IMG * | img, |
float | operand, | ||
char | operation, | ||
float | ulimit, | ||
int | verbose ) |
Simple arithmetic between IMG and specified constant.
Specify the operation as one of characters +, -, /, :, *, ., x. Results that are higher than ulimit are set to ulimit.
img | IMG data which is modified. |
operand | Constant value which is used to modify the data. |
operation | Operation, one of the characters +, -, /, :, *, ., x. |
ulimit | Results that are higher than ulimit are set to ulimit; set to <=0 if not needed. |
verbose | Verbose level; if <=0, then nothing is printed into stderr. |
Definition at line 100 of file imgarithm.c.
Referenced by imgConvertUnit(), and imgTimeIntegral().
Simple arithmetic between matching IMG planes and the first frame of img2.
Specify the operation as one of characters +, -, /, :, *, ., x. Results that are higher than ulimit are set to ulimit.
img1 | IMG data which is modified. |
img2 | Operand IMG data, only the first frame is used. |
operation | Operation, one of the characters +, -, /, :, *, ., x. |
ulimit | Results that are higher than ulimit are set to ulimit; set to <=0 if not needed. |
verbose | Verbose level; if <=0, then nothing is printed into stderr. |
Definition at line 168 of file imgarithm.c.
Calculate (incomplete) area under moment curve (AUMC) for every pixel in a dynamic image.
Data is not extrapolated. Frame gaps or overlaps are not accepted.
img | Pointer to dynamic image; not modified. Frame times are obligatory. |
oimg | Pointer to empty IMG struct in which the AUMC will be written; any old contents are deleted. |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 540 of file imgarithm.c.
int imgConvertUnit | ( | IMG * | img, |
char * | unit ) |
Converts the unit of pixel values in IMG based to specified unit string.
img | Pointer to IMG struct. |
unit | String containing the new unit. |
Definition at line 480 of file imgarithm.c.
Integration from first frame (0..last) to last frame (first..dimt) to 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. If dynamic image data does not contain frame times (e.g. Analyze image) then just the sum is calculated.
img | (Dynamic) IMG data. |
first | First frame to include in AUC; 0..dimt-1. |
last | Last frame to include in AUC; 0..dimt-1. |
iimg | Pointer to initiated and empty AUC IMG data. |
verbose | Verbose level; if <=0, then nothing is printed into stderr. |
Definition at line 346 of file imgarithm.c.
Referenced by imgsegmSimilar(), imgThresholding(), imgThresholdingLowHigh(), and imgTimeIntegral().
int imgInv | ( | IMG * | img | ) |
Replace IMG data values by their inverse value (1/activity).
Pixels with <=0 are set to zero.
img | Pointer to IMG data. |
Definition at line 314 of file imgarithm.c.
int imgLn | ( | IMG * | img | ) |
Replace IMG data values by their natural logarithms.
img | Pointer to IMG data. |
Definition at line 248 of file imgarithm.c.
int imgLog10 | ( | IMG * | img | ) |
Replace IMG data values by their log10 values.
img | Pointer to IMG data. |
Definition at line 270 of file imgarithm.c.
Calculate (incomplete) mean residence time (MRT) for every pixel in dynamic image.
MRT = area under moment curve (AUMC) / area under curve (AUC). Data is not extrapolated. Frame gaps or overlaps are not accepted.
img | Pointer to dynamic image; not modified. Frame times are obligatory. |
oimg | Pointer to empty IMG struct in which the AUMC will be written; any old contents are deleted. |
verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 606 of file imgarithm.c.
int imgRawCountsPerTime | ( | IMG * | img, |
int | operation ) |
Divide or multiply raw data (sinogram) counts by frame duration.
If IMG is not raw data, division is quietly not done. Error is returned if sinogram does not contain frame times, except if sinogram contains only one time frame, also then division is not done.
img | IMG containing raw data. |
operation | 1=division, 0=multiply. |
Definition at line 442 of file imgarithm.c.