Constructing Averages

Make an image and template list file.

This can be done automatically using the 'Make average list' tool on the Average menu. You will be prompted for the image extension, template extension and a file pattern to match. The file pattern can include the wild-card character *, so that for example *.jpg will match all files ending in .jpg, or f*.dat will match all files starting with f and ending with .dat.

Alternatively you can use an editor such as Notepad.exe and write a list of image and template files that you wish to make the average from. e.g.

male1.jpg male1.tem

male2.jpg male2.tem

: :

: :

male100.jpg male100.tem

The image files have either a .pgn, .jpg, .gif, .tif or .bmp format. Template files should have a .tem (TEMplate format) extension ( .dat (DelineATion format) are also supported for backwards compatibility, but their use is not recommended). Save the file with the default extension ('.txt'). The full path name is not required if the list file is in the same directory as the images and templates.

Constructing the average

To construct an average select 'Average Images' from the Average menu of the main window. Select the list file constructed earlier, sit back and watch the average being constructed. A popup will inform you when the average has been built, and you can save the average image and template to disk by selecting Save Right Image from the File menu. If you get a java input/output error, check that you don't have a blank line on the end of your file list.

Various options control how the average is constructed. By switching the 'Process Texture' option on 'Texture Process RGB' will apply the wavelet texture algorithm to the intensity image component or to each of the red green and blue components of the image respectively.


1. It is no longer necessary to construct a template separately as this is now performed as part of the image averaging process if 'Auto Average templates is set on the options menu (See next section).

2. Always type in the desired extension (.dat or .tem) when saving a template file.

3. Before constructing an average, load an image of the desired average size into the right hand side of the psycho window. Otherwise you will be prompted for

4. Always type in the desired extension (.pgn, .jpg, gif, .tif or .bmp for images or .tem or .dat for template files) when saving a file.

5. If an error is thrown during the averaging process it is most likely that an image or template named in the list does not exist or is corrupted.

Averaging options

The options which affect the average construction are mostly on the Average menu e.g.

1) Texture Options

  • None (just averages pixel colours),
  • wavelet magnitude (amplifies local edge sizes a different scales to match the same measure across the group,
  • wavelet MRF (tries to build up the most probable texture patterns by sampling from the group)

2) Recalculating the average template (rather than loading one in),

3) auto resizing the average template (tries to scale and shift the average template to make as large as possible within the bounds of the image on the right),

4) shape normalisation options

  • none (just averages the point positions),
  • two point (rotates, shifts and scales each template around two points to line up with the template on the right before averaging the templates),
  • three points (aligns 3 points, which allows shearing (affine transform)),
  • Full (Procrustes) (aligns each template to the average in order to minimise the sum of squared distances of each point from the same point in the average),

5) warping options

  • Multiscale - a simple non-linear interpolation, reasonably efficient even for lots of sample points
  • Linear - triangulates the delineation points and linearly interpolates over the triangles
  • thin-plate spline - an energy minimising spline, mathematically the best but slow for lots of points.
  • overlap control - tries to prevent the warp folding, by scaling each partial warp until it doesn't fold and concatenating the non-folding warps together.

As a guide the following settings could be selected: either none or wavelet magnitude on the texture, recalculate the average, don't auto resize, full (procrustes) shape normalisation, multiscale warping.