|
TPCCLIB
|
thresholding and filtering dynamic and parametric PET images. More...
#include "libtpcimgp.h"Go to the source code of this file.
Functions | |
| int | imgThresholding (IMG *img, float threshold_level, long long *thr_nr) |
| int | imgThresholdingLowHigh (IMG *img, float lower_threshold_level, float upper_threshold_level, IMG *timg, long long *lower_thr_nr, long long *upper_thr_nr) |
| int | imgThresholdMaskCount (IMG *img, float minValue, float maxValue, IMG *timg, long long *count) |
| int | imgThresholdMask (IMG *img, float minValue, float maxValue, IMG *timg) |
| int | imgThresholdByMask (IMG *img, IMG *templt, float thrValue) |
| void | imgCutoff (IMG *image, float cutoff, int mode) |
| int | imgOutlierFilter (IMG *img, float limit) |
| int | imgRegionGrowingByThreshold (IMG *img, const int sz, const int sy, const int sx, float lthr, float uthr, IMG *mask, int verbose) |
thresholding and filtering dynamic and parametric PET images.
Definition in file imgthreshold.c.
| void imgCutoff | ( | IMG * | image, |
| float | cutoff, | ||
| int | mode ) |
Pixel values that exceed or go under a user-defined limit are set to that limit value.
| image | Pointer to IMG struct which will be filtered here. |
| cutoff | Cut-off value. |
| mode | Mode of operation: 0=pixels exceeding the limit are cut off, 1=pixels which go under the limit are cut off. |
Definition at line 306 of file imgthreshold.c.
| int imgOutlierFilter | ( | IMG * | img, |
| float | limit ) |
Filter out pixels that are over limit x higher than their closest 8 neighbour pixels.
| img | Pointer to IMG struct which will be filtered here. |
| limit | Cut-off value. |
Definition at line 339 of file imgthreshold.c.
| int imgRegionGrowingByThreshold | ( | IMG * | img, |
| const int | sz, | ||
| const int | sy, | ||
| const int | sx, | ||
| float | lthr, | ||
| float | uthr, | ||
| IMG * | mask, | ||
| int | verbose ) |
Seeded region growing based on thresholds.
Calls itself recursively until neighbouring pixels fall outside thresholds. Because of recursion, program which uses this function needs a large space for stack.
| img | Pointer to static image data, to which the threshold is applied. |
| sz | Seed pixel position [z,y,x] as indices. |
| sy | Seed pixel position [z,y,x] as indices. |
| sx | Seed pixel position [z,y,x] as indices. |
| lthr | Lower threshold as absolute value. |
| uthr | Upper threshold as absolute value. |
| mask | Pointer to mask image; must have the same dimensions as the static image. |
| verbose | Verbose level; if zero, then only warnings are printed into stderr. |
Definition at line 394 of file imgthreshold.c.
Referenced by imgRegionGrowingByThreshold().
Threshold IMG by a mask image (template).
Sets pixel values in img to thrValue, if corresponding pixel value in template is == 0. Only first frame of template is used.
| img | Image to threshold. |
| templt | Threshold template (mask image with 1 frame) where 0=cut off. |
| thrValue | Value which is written in cut off pixels. |
Definition at line 282 of file imgthreshold.c.
| int imgThresholding | ( | IMG * | img, |
| float | threshold_level, | ||
| long long * | thr_nr ) |
Threshold dynamic or static IMG data.
Pixel time-activity curves (TACs) which have AUC less than Threshold*Max_AUC will be set to zero.
| img | IMG data. |
| threshold_level | Threshold level, e.g. 0.50 will set to zero all pixels that are less than 50% of maximum pixel. |
| thr_nr | Number of pixels that will fall below the threshold level; give NULL pointer, if not needed. |
Definition at line 19 of file imgthreshold.c.
| int imgThresholdingLowHigh | ( | IMG * | img, |
| float | lower_threshold_level, | ||
| float | upper_threshold_level, | ||
| IMG * | timg, | ||
| long long * | lower_thr_nr, | ||
| long long * | upper_thr_nr ) |
Threshold dynamic or static IMG data.
Checks whether pixel AUCs are lower or higher than the specified threshold levels * Max_AUC. Those pixel TACs are set to zero, or alternatively, if mask IMG is given, corresponding mask image pixel is set to 0.
| img | (Dynamic) IMG data. |
| lower_threshold_level | Lower threshold level, e.g. 0.10 will set to zero all pixels that are less than 10% of maximum pixel |
| upper_threshold_level | Upper threshold level, e.g. 0.90 will set to zero all pixels that are over 90% of maximum pixel |
| timg | Mask image; if empty, then it will be allocated here; if pre-allocated, then mask image value changed to 0 when necessary, but 0 is never changed to 1; enter NULL, if original TACs are to be thresholded to zeroes |
| lower_thr_nr | Number of pixels that will fall below the lower threshold level; give NULL pointer, if not needed. |
| upper_thr_nr | Number of pixels rejected because above the upper threshold level; give NULL pointer, if not needed. |
Definition at line 79 of file imgthreshold.c.
Creates a mask (template) image based on lower and upper threshold values.
This function allocates memory for the mask image. If pixel value in original image is >=minValue and <=maxValue, the corresponding mask pixel is set to 1, otherwise to 0. Only the first frame of images are used.
| img | Original image; only first frame is used here. |
| minValue | Lower threshold. |
| maxValue | Upper threshold. |
| timg | Mask image; if empty, then it will be allocated here; if pre-allocated, then mask pixel value changed to 0 when necessary, but 0 is never changed to 1. |
Definition at line 257 of file imgthreshold.c.
| int imgThresholdMaskCount | ( | IMG * | img, |
| float | minValue, | ||
| float | maxValue, | ||
| IMG * | timg, | ||
| long long * | count ) |
Creates a mask (template) image based on lower and upper threshold values.
This function allocates memory for the mask image. If pixel value in original image is >=minValue and <=maxValue, the corresponding mask pixel is set to 1, otherwise to 0. Only the first frame of images are used.
| img | Original image; only first frame is used here. |
| minValue | Lower threshold. |
| maxValue | Upper threshold. |
| timg | Mask image; if empty, then it will be allocated here; if pre-allocated, then template value changed to 0 when necessary, but 0 is never changed to 1. |
| count | The number of pixels that pass the threshold limits is written here; set to NULL if not needed. |
Definition at line 191 of file imgthreshold.c.
Referenced by imgMaskRegionLabeling(), and imgThresholdMask().