Bsoft function
img_add_weighed
Source:
src/img/img_combine.c
Description:
Adds multiple images together with given weights.
Algorithm:
Images are read from a number files and added to each other, using
the given weights to determine each contribution.
The images are rescaled to a new average and standard deviation before
weighted addition. If the given standard deviation is zero or less,
this step is omitted.
The weighed average is calculated and returned as a new image.
If the calcfom flag is set, one of the following is written into the FOM block:
1 variance
2 standard deviation
All images are converted to floating point.
Arguments:
| int nfiles | number of files to add.
|
| Bstring* file_list | list of file names.
|
| float* weight | list of weights (can be NULL).
|
| float newavg | new average for rescaling.
|
| float newstd | new standard deviation for rescaling.
|
| int calcfom | flag to calculate variance or standard deviation as FOM.
|
Returns:
Bimage* resultant image (floating point).
Prototype:
Bimage* img_add_weighed(int nfiles, Bstring* file_list, float* weight,
float newavg, float newstd, int calcfom)
Functions used:
balloc
bfree
img_init_fom
img_rescale_to_avg_std
img_stats
img_to_float
img_transform
init_img
kill_img
kill_list
Other objects included:
struct Bimage
struct Bmarker
Generated by bdoc.pl on Mon Jun 15 11:47:30 2009
Back to the Bsoft home