Next: RDANN(1) Up: WFDB Applications Guide Previous: PSCHART(1)On This Page

Name

psfd - produce annotated ‘full-disclosure’ plots on a PostScript device

Synopsis

psfd [ [ options ... ] script ... ]

Description

psfd produces high-quality annotated ‘full-disclosure’ plots of WFDB records on PostScript devices. When rendered on a PostScript laser printer or phototypesetter, the plots closely resemble those that appear on pages 2-97 of the MIT-BIH Arrhythmia Database Directory.

psfd reads one or more script files containing newline-terminated commands. Its standard output is a PostScript file suitable for printing directly with no further processing. By default, psfd draws ‘zero-width’ lines; doing so typically reduces the printing time by a factor of three for a first-generation (300 dpi) laser printer while producing visually pleasing results. If the output is destined for a high-resolution (600 dpi or more) printer or phototypesetter, however, be sure to use the -d option (see below), or the traces and grid will be invisible (or nearly so).

Options:

-a ann
Print annotations from annotator ann (default: ‘atr’). To suppress annotation printing, use ‘-a ""’.
-A ann
As for -a, but for a second annotator. The second set of annotations is shown below the first set.
-b n
Set the binding offset to n millimeters (default: 0). The inside margin is increased by n mm, and the outside margin is decreased by the same amount.
-c string
Print ‘Copyright © string’ in the left page footer; string may include whitespace if it is quoted. The characters ‘%d’, if included in string, are replaced by the current year. A default copyright notice is printed if no -c option is specified. To suppress printing the copyright notice, use ‘-c ""’.
-C
Produce charts in color (default: black and white).
-Ca r g b
Draw annotations (if enabled) in the specified color. The color is specified using three numerical arguments (with values between 0 and 1 inclusive) that indicate the amounts of red, green, and blue respectively. Examples: -Ca 0.5 0.5 1.0 produces light blue (the default obtained using -C only); -Ca 0 0.5 0 produces a deep green color.
-Cg r g b
Draw the grid (if enabled) in the specified color. Default: red (1 0 0).
-Cl r g b
Draw labels and other non-annotation text in the specified color. Default: black (0 0 0).
-Cs r g b
Draw signals in the specified color. Default: deep blue (0 0 0.5).
-d n
Set up for using a printer with a resolution of n dots per inch (default: n = 300, the typical resolution for laser printers). For a phototypesetter, n is typically 1200 or 2400. Note that n does not have to be correct in order to get properly scaled output; the value determines the granularity of the calculations made by psfd and the line width used by the printer, but not the scales.
-e
Process even-numbered pages in a manner appropriate for two-sided printing. Even-numbered pages are printed with reversed page headers, and with the outside margin on the left (default: page headers are not reversed, and the inside margin is always on the left).
-E
Generate EPSF format (encapsulated PostScript file format), suitable for inclusion in another PostScript file.
-g
Print a grid with 1-second tick marks at the top of each page and below the last strip on each page (default: no grid).
-h
Print a usage summary.
-H n
Allot approximately n millimeters of vertical space on the page for each trace (default: n = 7.5).
-l
Label the signals in the margins next to each strip (default: no signal labels).
-L
Print in landscape orientation (default: portrait orientation).
-m inside outside top bottom
Specify page margins in millimeters. Defaults: top and bottom, 25 mm; inside and outside, 25-37.5 mm (half of the difference between the page width and the default strip width). The default strip width is the largest multiple of 25 mm that is at least 50 mm less than the page width. Note that page headers and footers, time stamps, and signal labels are printed in the margins. Also note that hardware-enforced, printer-specific margins are not included; the margins specified using -m apply to the imageable area, and not necessarily to the physical page.
-M
Print marker bars across the signals to show the locations of beat annotations (equivalent to -M1).
-Mbarstyle
Set marker bar and annotation format (note: no space between -M and barstyle). Legal values for barstyle: 0 (no bars); 1 (bars across all signals); 2 (bars across attached signal, annotations at center); 3 (bars across attached signal, annotations above bars). Default: barstyle = 0.
-n n
Use n as the number of the first page (default: 1). Use ‘-n 0’ (or any negative value for n) to suppress page numbering.
-N
Print counter values after time stamps in the left margin.
-P pagesize
Specify the size of the output pages to be printed. Legal values for pagesize are: ‘letter’ (8.5" x 11", 216 mm x 279 mm; imageable area 209 mm x 272 mm), ‘lwletter’ (8.5" x 11", 216 mm x 279 mm; imageable area 203 mm x 277 mm), ‘legal’ (8.5" x 14", 216 mm x 356 mm; imageable area 209 mm x 348 mm), ‘legal13’ (8.5" x 13", 216 x 330 mm; imageable area 209 mm x 322 mm), ‘A4’ (8.27" x 11.69", 210 mm x 297 mm; imageable area 202 mm x 289 mm), ‘A5’ (5.84" x 8.27", 148 mm x 210 mm; imageable area 140 mm x 202 mm); ‘B4’ (9.84" x 13.9", 250 mm x 353 mm; imageable area 249 mm x 356 mm), ‘B5’ (6.93" x 9.84", 176 mm x 250 mm; imageable area 173 mm x 249 mm), or ‘widthxheight’ (where width and height are the width and height of the imageable area in millimeters). ‘lwletter’ is the standard letter size for the Apple LaserWriter; all of the other predefined page sizes are those used by the Sun SPARCprinter. Note that some printers may require non-standard PostScript code to select non-standard page sizes; in such cases, it may be necessary to customize the prolog file (see FILES). Default: letter size.
-r
Print a record name as part of the header on each page. If strips from two or more records are printed on one page, the name of the last record is printed.
-R
Same as -r.
-s signal-list
Print only the signals named in the signal-list (one or more signal numbers or names, separated by spaces; default: print all signals).
-S scale-mode timestamp-mode
Print scales and timestamps in the specified modes. Legal values for scale-mode: 0 (no scales); 1 (mm/unit in footers); 2 (units/tick in footers). Legal values for timestamp-mode: 0 (no timestamps); 1 (elapsed times only); 2 (absolute times if defined, elapsed times otherwise). Defaults: scale-mode = 1, timestamp-mode = 2.
-t n
Set the time scale to n millimeters per second (default: n = 2.5, one-tenth of the standard scale for chart recorders).
-T title
Set the page title to title (which may include whitespace if quoted). If no -T option is specified, the page title is constructed from the date of the last recording on the page, if defined, or today’s date otherwise. To suppress printing the page title, use ‘-T ""’.
-u
Generate ‘unstructured’ PostScript as a workaround for a bug in the Adobe TranScript software (also see ENVIRONMENT below). Default: generate structured PostScript, suitable for processing by page-selection or page-reversal post-processors.
-v n
Set the voltage (ordinate) scale to n millimeters per millivolt. Signals that do not have units of millivolts (as specified in the record’s header file) are scaled proportionately, as specified by the calibration file (see wfdbcal(5) ). The default scale is 1 mm/mV, one-tenth of the standard scale for chart recorders.
-V
Verbose mode (echo each command as it is read from the script file).
-w n
Set the line width for signals, grid lines, and marker bars to n mm. Default: 0 (the narrowest possible width; note that some devices may not render zero-width lines correctly).
-x
Extend the last strip of each record up to 10% if necessary to avoid printing a short strip at the end. (This option may be used to obtain plots like those in the MIT-BIH Arrhythmia Database Directory.)
-1
Print only the first character of each comment annotation.

Scripts:

Any argument that is not an option or an option argument is taken as the name of a script of newline-terminated commands to be executed by psfd. If the script name is ‘-’, psfd reads commands from the standard input. Options that follow a script name are not applied to the processing of that script, so it is possible to use two or more scripts with different sets of options in a single run. Standard commands are of the following form:
   record time

in which record is the name of the record for which a ‘full disclosure’ plot is to be printed, and time indicates the starting time (and, optionally, the stop time) of the plot. Anything that follows the time field in a command is ignored. Fields are separated by spaces or tabs. If the time field contains a hyphen (‘-’), the portion that precedes the hyphen is taken as the starting time of the plot, and the portion that follows the hyphen indicates the stop time. A totally empty command line causes psfd to put the next plot at the top of a new page, even if the current page is not full. pschart(1) command scripts are usable by psfd; note, however, that the programs use different conventions for interpreting a missing stop time, and that strip titles are not printed by psfd.

Environment

The environment variable PSFDPRO can be used to name an alternate prolog file (see below) for custom formats. The environment variable TRANSCRIPTBUG may be set (to any value) to generate ‘unstructured’ PostScript by default (see the -u option above). It may be necessary to set and export the shell variables WFDB and WFDBCAL (see setwfdb(1) ).

Files

/usr/local/lib/ps/psfd.pro
default PostScript prolog file.

Bugs

On older PostScript printers, output may be quite slow. A full page, with grids and default scales, typically takes about 3 minutes to render on an Apple LaserWriter, or about 6 minutes on a Linotronic 1200 dpi phototypesetter. Most modern printers can render psfd output at nearly full speed.

For a 300 dpi printer, a typical full page of output will be about 80 Kbytes. Expect this to increase approximately linearly with the printer resolution.

The signals are decimated to obtain samples that are spaced by intervals approximating one pixel. To obtain this result, the signals are first digitally low-pass filtered by psfd; in general, this has no significant effect on the appearance of the plots other than a slight improvement in legibility for signals contaminated by high-frequency noise. To get an idea of the high-frequency content of the signals, use pschart(1) .

Specifying EPSF output using the -E option does not prevent psfd from producing multi-page output, which is not permitted in EPSF. You should make sure that your output fits entirely onto one page (most easily verified using the -V option) before including it in another document. Note that the bounding box calculated by psfd covers the entire width of the page and most of its height (excluding only about half of the top and bottom margins, so that the header and footer material is included), even if only a small portion of the page contains plots. If you wish to fit such a plot into another document with a minimum of empty space around it, you may either edit the bounding box comment in the psfd output, or specify a page size that closely matches the size of your plot. The document in which psfd output is included can arbitrarily rescale the plot, so that scales expressed in mm/unit cannot be relied upon.

Under MS-DOS, a bug in command.com makes it impossible to pass an empty string in the argument list of a command, so that -a "", -c "", and -T "" do not work as described above. Type a space between the quotation marks to avoid this bug, or use one of the UNIX shells that have been ported to MS-DOS instead of command.com.

There are too many options. Invoke psfd with no arguments for a brief summary of options.

See Also

pschart(1) , setwfdb(1) , wave(1)

Author

George B. Moody (george@mit.edu)

Sources

http://www.physionet.org/physiotools/wfdb/app/psfd.c
http://www.physionet.org/physiotools/wfdb/app/psfd.pro


Table of Contents

Up: WFDB Applications Guide


Please e-mail your comments and suggestions to webmaster@physionet.org, or post them to:

PhysioNet
MIT Room E25-505A
77 Massachusetts Avenue
Cambridge, MA 02139 USA

Updated 10 June 2022