#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include "img.h"#include "imgmax.h"#include "include/imgproc.h"#include "include/imgthrs.h"Go to the source code of this file.
Functions | |
| int | imgThresholding (IMG *img, float threshold_level, int *thr_nr) |
| int | imgThresholdingLowHigh (IMG *img, float lower_threshold_level, float upper_threshold_level, IMG *timg, int *lower_thr_nr, int *upper_thr_nr) |
| int | imgThresholdTemplateCount (IMG *img, float minValue, float maxValue, IMG *timg, int *count) |
| int | imgThresholdTemplate (IMG *img, float minValue, float maxValue, IMG *timg) |
| int | imgThresholdByTemplate (IMG *img, IMG *templt, float thrValue) |
| void | imgCutoff (IMG *image, float cutoff, int mode) |
| int | imgOutlierFilter (IMG *img, float limit) |
| 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 | Cutoff value |
| mode | Mode of operation: 0=pixels exceeding the limit are cut off, 1=pixels which go under the limit are cut off |
| int imgOutlierFilter | ( | IMG * | img, |
| float | limit | ||
| ) |
| int imgThresholdByTemplate | ( | IMG * | img, |
| IMG * | templt, | ||
| float | thrValue | ||
| ) |
Threshold IMG by a template. Sets pixel values in img to thrValue, if corresponding pixel value in template is == 0. Only first plane of template is used.
| img | Image to threshold |
| templt | Threshold template (1 frame) where 0=cut off |
| thrValue | Value which is written in cut off pixels |
| int imgThresholding | ( | IMG * | img, |
| float | threshold_level, | ||
| int * | 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 63 of file imgthrs.c.
References imgFrameIntegral().
| int imgThresholdingLowHigh | ( | IMG * | img, |
| float | lower_threshold_level, | ||
| float | upper_threshold_level, | ||
| IMG * | timg, | ||
| int * | lower_thr_nr, | ||
| int * | 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 template IMG is given, corresponding template 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 | Template 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; 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 that will fall below the lower threshold level; give NULL pointer, if not needed. |
Definition at line 124 of file imgthrs.c.
References imgFrameIntegral().
| int imgThresholdTemplate | ( | IMG * | img, |
| float | minValue, | ||
| float | maxValue, | ||
| IMG * | timg | ||
| ) |
Creates a template image based on lower and upper threshold values. This function allocates memory for the template. If pixel value in original image is >=minValue and <=maxValue, the corresponding template 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 | Template 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 |
Definition at line 302 of file imgthrs.c.
References imgThresholdTemplateCount().
| int imgThresholdTemplateCount | ( | IMG * | img, |
| float | minValue, | ||
| float | maxValue, | ||
| IMG * | timg, | ||
| int * | count | ||
| ) |
Creates a template image based on lower and upper threshold values. This function allocates memory for the template. If pixel value in original image is >=minValue and <=maxValue, the corresponding template 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 | Template 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 241 of file imgthrs.c.
Referenced by imgThresholdTemplate().
1.8.0