|
TPCCLIB
|
Searching min and max in IMG data. More...
#include "libtpcimgio.h"Go to the source code of this file.
Functions | |
| int | imgMax (IMG *img, float *maxvalue) |
| int | imgAbsMax (IMG *img, float *maxvalue) |
| int | imgRangeMinMax (IMG *img, IMG_RANGE *r, IMG_PIXEL *maxp, float *maxv, IMG_PIXEL *minp, float *minv) |
| int | imgMinMax (IMG *img, float *minvalue, float *maxvalue) |
| int | imgFrameMinMax (IMG *img, int frame, float *minvalue, float *maxvalue) |
| int | imgReadMinMax (const char *fname, float *fmin, float *fmax) |
| int | imgSmoothMax (IMG *img, float *maxvalue, IMG_PIXEL *p) |
| int | imgGetPeak (IMG *img, float beforeTime, IMG_PIXEL *p, int verbose) |
| int | imgGetMaxTime (IMG *img, IMG *mimg, const int w, int verbose) |
| int | imgGetMaxFrame (IMG *img, IMG *mimg, int verbose) |
| int | imgAvg (IMG *img, IMG_RANGE *r, float *avg) |
| float | f_kth_smallest (float *data, long long int n, long long int k) |
| float | fmedian (float *data, long long int n) |
| float | fmean (float *data, long long int n, float *sd) |
| void | fMinMaxFin (float *data, long long int n, float *fmin, float *fmax) |
Searching min and max in IMG data.
Definition in file imgminmax.c.
| float f_kth_smallest | ( | float * | data, |
| long long int | n, | ||
| long long int | k ) |
Returns the kth smallest value in data[0..n-1].
Array is partially sorted. Algorithm is based on the book Wirth N. Algorithms + data structures = programs. Englewood Cliffs, Prentice-Hall, 1976.
| data | Pointer to data; array is partially sorted |
| n | Length of data array |
| k | kth smallest value will be returned |
Definition at line 558 of file imgminmax.c.
Referenced by fmedian().
| float fmean | ( | float * | data, |
| long long int | n, | ||
| float * | sd ) |
Returns the mean in array data[0..n-1], and optionally calculates also the (sample) standard deviation of the mean.
| data | Pointer to data; data is not changed in any way. |
| n | Length of data array. |
| sd | Pointer to variable where SD will be written; enter NULL if not needed. |
Definition at line 618 of file imgminmax.c.
Referenced by imgBorderAverageTAC().
| float fmedian | ( | float * | data, |
| long long int | n ) |
Returns the median in array data[0..n-1].
Array is partially sorted. Algorithm is based on the book Wirth N. Algorithms + data structures = programs. Englewood Cliffs, Prentice-Hall, 1976.
| data | Pointer to data; array is partially sorted |
| n | Length of data array |
Definition at line 593 of file imgminmax.c.
Referenced by imgBorderAverageTAC(), med21(), and med9().
| void fMinMaxFin | ( | float * | data, |
| long long int | n, | ||
| float * | fmin, | ||
| float * | fmax ) |
Finds the minimum and maximum value in a float array.
Only finite values are considered.
| data | Pointer to float array of size n. |
| n | Array length. |
| fmin | Pointer to float value for minimum; enter NULL if not needed. |
| fmax | Pointer to float value for maximum; enter NULL if not needed. |
Definition at line 649 of file imgminmax.c.
Referenced by ecat63WriteImageMatrix(), ecat63WriteScanMatrix(), ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WritePolarmapMatrix(), ecat7WriteScanMatrix(), mrp(), and trmrp().
| int imgAbsMax | ( | IMG * | img, |
| float * | maxvalue ) |
Searches the max absolute pixel value in the IMG data.
Sets maxvalue to the absolute max value with sign.
| img | Pointer to IMG structure. |
| maxvalue | Pointer to output. |
Definition at line 44 of file imgminmax.c.
Calculates average voxel value inside specified image range.
| img | Pointer to IMG image structure |
| r | Pointer to range inside IMG; enter NULL if whole IMG is used |
| avg | Target for mean value |
Definition at line 503 of file imgminmax.c.
| int imgFrameMinMax | ( | IMG * | img, |
| int | frame, | ||
| float * | minvalue, | ||
| float * | maxvalue ) |
Searches the min and max pixel value in one frame (1..dimt) of the IMG data.
| img | Pointer to IMG data. |
| frame | Frame number [1..number of frames]. |
| minvalue | Pointer to float value where minimum is written. |
| maxvalue | Pointer to float value where maximum is written. |
Definition at line 171 of file imgminmax.c.
Referenced by img2svol().
Search the frame with maximum pixel value for each image pixel separately.
| img | Image to search for max frames; not modified |
| mimg | Pointer to empty IMG struct in which the nr of frame with max pixel value will be written; 0 is written if max value is <= 0; any old contents are deleted. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout |
Definition at line 454 of file imgminmax.c.
Search the time of maximum value for each image pixel separately.
| img | Image to search for max frames; not modified. |
| mimg | Pointer to empty IMG struct in which the max time (sec) will be written; any old contents are deleted. |
| w | Just save the frame middle time (0), or compute value weighted average time of all frames (1), or, value weighted average time of 3 or 5 subsequent frames (2). Option (1) uses the equation for mean residence time (MRT) for PTACs in pharmacokinetics. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 345 of file imgminmax.c.
Searches the max pixel value in the IMG data, which occurs before specified time.
| img | Pointer to IMG struct |
| beforeTime | Time (sec) after which max value is not searched |
| p | Pointer to struct where max pixel position is written |
| verbose | Verbose level; 0 if nothing is to be printed in stdout |
Definition at line 294 of file imgminmax.c.
| int imgMax | ( | IMG * | img, |
| float * | maxvalue ) |
Search the max pixel value in the IMG data.
| img | Pointer to IMG structure. |
| maxvalue | Pointer to output. |
Definition at line 15 of file imgminmax.c.
Referenced by imgThresholding(), and imgThresholdingLowHigh().
| int imgMinMax | ( | IMG * | img, |
| float * | minvalue, | ||
| float * | maxvalue ) |
Searches the min and max pixel value in the IMG data.
| img | Pointer to IMG struct from where min and pixels are searched. |
| minvalue | Pointer to min pixel value; Enter NULL if not needed. |
| maxvalue | Pointer to max pixel value; Enter NULL if not needed. |
Definition at line 154 of file imgminmax.c.
Referenced by imgPVCRRL(), imgPVCRVC(), imgReadMinMax(), imgSetAnalyzeHeader(), imgWriteAnalyze(), and imgWriteNifti().
| int imgRangeMinMax | ( | IMG * | img, |
| IMG_RANGE * | r, | ||
| IMG_PIXEL * | maxp, | ||
| float * | maxv, | ||
| IMG_PIXEL * | minp, | ||
| float * | minv ) |
Finds max and/or min voxel inside specified image range.
| img | Pointer to IMG structure. |
| r | Pointer to image range inside IMG; enter NULL if whole IMG is used. |
| maxp | Pixel where max pixel position is written; NULL if not needed. |
| maxv | Target for max value; NULL if not needed. |
| minp | Pixel where min pixel position is written; NULL if not needed. |
| minv | Target for min value; NULL if not needed. |
Definition at line 71 of file imgminmax.c.
Referenced by imgMinMax().
| int imgReadMinMax | ( | const char * | fname, |
| float * | fmin, | ||
| float * | fmax ) |
Read the calibrated maximum and minimum pixel values in the specified file in ECAT 7, ECAT 6.3, or Analyze 7.5 format.
File is read frame-by-frame with normal IMG functions.
| fname | ECAT 7 or ECAT 6.3 filename, or Analyze 7.5 database. |
| fmin | Pointer to minimum pixel value that will be set by this function. |
| fmax | Pointer to maximum pixel value that will be set by this function. |
Definition at line 211 of file imgminmax.c.
Searches the spatially (3x3) smoothed max pixel value in the IMG data.
| img | Pointer to IMG struct |
| maxvalue | Pointer to float in which max pixel value will be written; enter NULL if not needed |
| p | Pointer to struct in which the position of max pixel will be written (1-based positions); enter NULL if not needed |
Definition at line 248 of file imgminmax.c.