When you click Create, it finds all the indicated marks, averages the points in their vicinities as indicated by the Left and Right Widths, and writes a template file containing those data. (The "Width scale" arrows can be used to change the range of the scales.) This template can be used in a template match filter, allowing the recognition of specific peak shapes.
The Least-squares alignment checkbox controls xdatplot's solution to this problem. If it is checked, each feature will be shifted left or right to give the best match with the average of all of them, then the template will be recomputed. The match is evaluated by doing a least-squares fit of the template to the data, so that it is based on the overall shape, not any specific unique point. This is transparent, except that template creation will take longer with Least-squares alignment checked than otherwise.
If Least-squares alignment is not checked, the features are aligned by the marks used to identify them. Thus you have complete control over alignment.
If you don't have xmgr, clicking the View button will just result in an error. There are two ways to solve this problem. The first and best solution is to get xmgr. It's free by anonymous FTP from ftp.x.org. If for some reason you can't get xmgr or don't want to, you can change the graphCommand resource to point to another plotting program. The default is "xmgr -source stdin". If you don't have xmgr, but do have gnuplot (free from GNU), you may want to set this to "graph | xplot".
Template Files
Templates are text files in Xresource format. Here's an example of a
small one:
! tpl-0.1 *templateType: INTERPOLATED *interTemplate.weight: 3 *interTemplate.normalization: 242.4765064 *interTemplate.numPoints: 9 *interTemplate.points: -0.002 0.29025162975893209\n\ -0.0015 -0.13220959755755532\n\ -0.001 0.06491654409625032\n\ -0.00050000000000000001 0.28574569155764223\n\ 0 0.43891307222547482\n\ 0.00050000000000000001 0.37557038961749845\n\ 0.001 0.085822686697842321\n\ 0.0015 -0.26742022910369456\n\ 0.002 -0.56108692777452518\n\The points are simply time-voltage pairs, one per line. This template represents a simple peak. They have been normalized so that the difference between the maximum and minimum voltages is 1.0, and offset so that the voltages add up to 0.0. Real templates are likely to have more than the nine points in this one.
At the moment there is only one template type: interpolated. This means that the continuous function of time represented by this template is derived by interpolating between the given points. In the future there may be other template types, such as Gaussians, sinusoids, or sums of exponentials.
Leon Avery (leon@eatworms.swmed.edu)