MetAvg - Merge multiple TIFF files using weighted average of input pixels

The MetAvg tool can be used to merge an arbitrary number greyscale TIFF files of bit depth 8 to a single greyscale TIFF file of bit depth 8. Each input TIFF can be weighted separately and each pixel in the output represents a weighted average of the input pixels in a given sample region with center corresponding to the new pixel location.


MetAvg - VLBV Usage

From the VLBV main menu, select the TIFF files you want to merge by using the File > Open pull down menu. Select the 5 TIFF files included in our examples folder and set the layer color/transparency as shown in the image below.


MetAvg - Merge multiple TIFF files with weighted average of input pixels

After selecting the files you wish to merge, go to the Tools pull down menu and select the MetAvg option.


MetAvg - Merge multiple TIFF files with weighted average of input pixels

MetAvg - Main menu

The MetAvg main menu will display the TIFF files you selected. The user interface supports merging up to 5 TIFF files while the command line version of the software can handle more TIFF files. The user can set the weight of each of the TIFF files. Valid values can be 0.0 or higher where 1.0 corresponds to 100% weight.

Other parameters include:
Reset Default Weights - This option will set the weights to be 1/N where N is the number of loaded inputs.

Constant - Constant represents a fixed value that will be added to each output pixel after the sampling process. The default value is 0.0. Value can be positive or negative.

Sample Size - Sample size represents the size of the pixel box that will be used to sum and average input pixels from all the input files. The default value is 3, which represents a 3x3 box (9 pixels). The" sample size" value must be greater than 0.

Max Value - Max Value represents the maximum value that an output pixel may be assigned. If the value of a calculated output pixel is greater than the Max Value then it will be reduced to the Max Value. To be valid the Max Value must be from 0.0 to 255.0. The default is 255.0.

Output Directory - Browse and select the output folder.

Output Name - Enter the output TIFF file name - the program will add .tif extension to the output file.

Enable Log - Save log file to output folder.

Max Threads - Maximum number of threads to be used during the conversion.

Autoload Results - Automatically launch another instance of VLBV with the output file. This instance doesn't require a license and it is for viewing only.


MetAvg - Merge multiple TIFF files with weighted average of input pixels

After setting all the parameters in the MetAvg menu, click on the Run MetAvg to start the conversion. The output TIFF file will be displayed in a new session of VLBV.

MetAvg - Merge multiple TIFF files with weighted average of input pixels

Output pixels will be generated with the following formula:

Output Pixel = Constant + (Input1_Sample * Wt1) + (Input2_Sample * Wt2) + ...
Input1_Sample is calculated based on the sample size and the value of each pixel (pixel value can be 0 to 255). For example, let's take the following 3x3 pixels:
255,255,255
255,255,255
255,255,0

Input_Sample = (255+255+255+255+255+255+255+255+0) / 9 = 226.66666667


MetAvg - Command Line Syntax

The MetAvg program can also run from the command line. Click on the link to see the complete syntax and options.