|
Bsoft
1.9
Bernard's software package
|
Library routines used for images. More...
#include "rwimg.h"#include "img_rescale.h"#include "Complex.h"#include "Matrix.h"#include "utilities.h"Go to the source code of this file.
Functions | |
| int | img_rescale (Bimage *p, double scale, double shift) |
| Rescales the image data to a given minimum and maximum. More... | |
| int | img_rescale_to_min_max (Bimage *p, double min, double max) |
| Rescales the image data to a given minimum and maximum. More... | |
| int | img_rescale_to_avg_std (Bimage *p, double avg, double std) |
| Rescales the image data to a given average and standard deviation. More... | |
| int | img_truncate (Bimage *p, double min, double max, double setmin, double setmax) |
| Truncates image data to a given minimum and maximum. More... | |
| int | img_truncate_to_min_max (Bimage *p, double min, double max) |
| Truncates image data to a given minimum and maximum. More... | |
| int | img_truncate_to_avg (Bimage *p, double min, double max) |
| Sets voxels in image data exceeding a given minimum and maximum to the average. More... | |
| int | img_truncate_to_background (Bimage *p, double min, double max) |
| Sets voxels in image data exceeding a given minimum and maximum to the image background. More... | |
| int | img_limit_levels (Bimage *p, int nlevels) |
| Converts a full gray scale image to a limited level image. More... | |
Variables | |
| int | verbose |
Library routines used for images.
Definition in file img_rescale.cpp.
| int img_limit_levels | ( | Bimage * | p, |
| int | nlevels | ||
| ) |
Converts a full gray scale image to a limited level image.
The dynamic range of the image is decreased to a given number of gray scale levels. The new data replaces the old data. Image statistics are recalculated.
| *p | image. |
| nlevels | number of levels. |
Definition at line 314 of file img_rescale.cpp.
| int img_rescale | ( | Bimage * | p, |
| double | scale, | ||
| double | shift | ||
| ) |
Rescales the image data to a given minimum and maximum.
| *p | image. |
| scale | multiplier. |
| shift | addition. |
The new data is calculated as:
new_datum = datum*scale + shift
The new data replaces the old data.
Image statistics are recalculated. Definition at line 31 of file img_rescale.cpp.
| int img_rescale_to_avg_std | ( | Bimage * | p, |
| double | avg, | ||
| double | std | ||
| ) |
Rescales the image data to a given average and standard deviation.
| *p | image. |
| avg | new average. |
| std | new standard deviation. |
The new data is calculated as:
new_std_dev
new_datum = (datum - avg) * ----------- + new_avg
std_dev
The new data replaces the old data.
Image statistics are recalculated. Definition at line 113 of file img_rescale.cpp.
| int img_rescale_to_min_max | ( | Bimage * | p, |
| double | min, | ||
| double | max | ||
| ) |
Rescales the image data to a given minimum and maximum.
| *p | image. |
| min | new minimum. |
| max | new maximum. |
The new data is calculated as:
new_max - new_min
new_datum = (datum - min) * ----------------- + new_min
max - min
The new data replaces the old data.
Image statistics are recalculated. Definition at line 79 of file img_rescale.cpp.
| int img_truncate | ( | Bimage * | p, |
| double | min, | ||
| double | max, | ||
| double | setmin, | ||
| double | setmax | ||
| ) |
Truncates image data to a given minimum and maximum.
All values smaller than the new minimum are set to the new minimum and all values larger than the new maximum are set to the new maximum. In cases where the given minimum and maximum are outside the data type ranges, they are reset to the data type range limits. The new data replaces the old data. Image statistics are recalculated.
| *p | image. |
| min | minimum. |
| max | maximum. |
| setmin | value to set voxels smaller than minimum. |
| setmax | value to set voxels larger than maximum. |
Definition at line 165 of file img_rescale.cpp.
| int img_truncate_to_avg | ( | Bimage * | p, |
| double | min, | ||
| double | max | ||
| ) |
Sets voxels in image data exceeding a given minimum and maximum to the average.
All values smaller than the new minimum or larger than the new maximum are set to the image average. The new data replaces the old data. Image statistics are recalculated.
| *p | image. |
| min | minimum. |
| max | maximum. |
Definition at line 239 of file img_rescale.cpp.
| int img_truncate_to_background | ( | Bimage * | p, |
| double | min, | ||
| double | max | ||
| ) |
Sets voxels in image data exceeding a given minimum and maximum to the image background.
All values smaller than the new minimum or larger than the new maximum are set to the background value. The new data replaces the old data. Image statistics are recalculated.
| *p | image. |
| min | minimum. |
| max | maximum. |
Definition at line 258 of file img_rescale.cpp.
| int img_truncate_to_min_max | ( | Bimage * | p, |
| double | min, | ||
| double | max | ||
| ) |
Truncates image data to a given minimum and maximum.
All values smaller than the new minimum are set to the new minimum and all values larger than the new maximum are set to the new maximum. In cases where the given minimum and maximum are outside the data type ranges, they are reset to the data type range limits. The new data replaces the old data. Image statistics are recalculated.
| *p | image. |
| min | minimum. |
| max | maximum. |
Definition at line 220 of file img_rescale.cpp.
| int verbose |