WFDB Software Package 10.6.2

File: <base>/doc/wag-src/psfd.1 (13,364 bytes)
.TH PSFD 1 "7 January 2009" "WFDB 10.4.12" "WFDB Applications Guide"
.SH NAME
psfd \- produce annotated `full-disclosure' plots on a PostScript device
.SH SYNOPSIS
\fBpsfd\fR [ [ \fIoptions\fR ... ] \fIscript\fR ... ]
.SH DESCRIPTION
.PP
\fBpsfd\fR 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 \fIMIT-BIH Arrhythmia Database Directory\fR.
.PP
\fBpsfd\fR reads one or more \fIscript\fR files containing
newline-terminated commands.  Its standard output is a PostScript file suitable
for printing directly with no further processing.  By default, \fBpsfd\fR
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
\fB-d\fR option (see below), or the traces and grid will be invisible (or
nearly so).
.PP
\fBOptions\fR:
.TP
\fB-a\fR \fIann\fR
Print annotations from annotator \fIann\fR (default: `atr').  To suppress
annotation printing, use `\fB-a ""\fR'.
.TP
\fB-A\fR \fIann\fR
As for \fB-a\fR, but for a second annotator.  The second set of annotations
is shown below the first set.
.TP
\fB-b\fR \fIn\fR
Set the binding offset to \fIn\fR millimeters (default: 0).  The inside margin
is increased by \fIn\fR mm, and the outside margin is decreased by the same
amount.
.TP
\fB-c\fR \fIstring\fR
Print `Copyright \(co \fIstring\fR' in the left page footer;  \fIstring\fR may
include whitespace if it is quoted.  The characters `%d', if included in
\fIstring\fR, are replaced by the current year.  A default copyright notice is
printed if no \fB-c\fR option is specified.  To suppress printing the copyright
notice, use `\fB-c ""\fR'.
.TP
\fB-C\fR
Produce charts in color (default: black and white).
.TP
\fB-Ca\fR \fIr g b\fR
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: \fB-Ca 0.5 0.5 1.0\fR produces light blue (the default obtained
using \fB-C\fR only); \fB-Ca 0 0.5 0\fR produces a deep green color.
.TP
\fB-Cg\fR \fIr g b\fR
Draw the grid (if enabled) in the specified color. Default: red (1 0 0).
.TP
\fB-Cl\fR \fIr g b\fR
Draw labels and other non-annotation text in the specified color.  Default:
black (0 0 0).
.TP
\fB-Cs\fR \fIr g b\fR
Draw signals in the specified color.  Default: deep blue (0 0 0.5).
.TP
\fB-d\fR \fIn\fR
Set up for using a printer with a resolution of \fIn\fR dots per inch (default:
\fIn\fR = 300, the typical resolution for laser printers).  For a
phototypesetter, \fIn\fR is typically 1200 or 2400.  Note that \fIn\fR
does not have to be correct in order to get properly scaled output;  the
value determines the granularity of the calculations made by \fBpsfd\fR
and the line width used by the printer, but not the scales.
.TP
\fB-e\fR
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).
.TP
\fB-E\fR
Generate EPSF format (encapsulated PostScript file format), suitable for
inclusion in another PostScript file.
.TP
\fB-g\fR
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).
.TP
\fB-h\fR
Print a usage summary.
.TP
\fB-H\fR \fIn\fR
Allot approximately \fIn\fR millimeters of vertical space on the page
for each trace (default: \fIn\fR = 7.5).
.TP
\fB-l\fR
Label the signals in the margins next to each strip (default: no signal
labels).
.TP
\fB-L\fR
Print in landscape orientation (default: portrait orientation).
.TP
\fB-m\fR \fIinside outside top bottom\fR
Specify page margins in millimeters.  Defaults: \fItop\fR and \fIbottom\fR,
25 mm; \fIinside\fR and \fIoutside\fR, 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 \fB-m\fR apply to the
imageable area, and not necessarily to the physical page.
.TP
\fB-M\fR
Print marker bars across the signals to show the locations of beat annotations
(equivalent to \fB-M1\fR).
.TP
\fB-M\fR\fIbarstyle\fR
Set marker bar and annotation format (note: no space between \fB-M\fR and
\fIbarstyle\fR).  Legal values for \fIbarstyle\fR: 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: \fIbarstyle\fR = 0.
.TP
\fB-n\fR \fIn\fR
Use \fIn\fR as the number of the first page (default: 1).  Use `\fB-n 0\fR'
(or any negative value for \fIn\fR) to suppress page numbering.
.TP
\fB-N\fR
Print counter values after time stamps in the left margin.
.TP
\fB-P\fR \fIpagesize\fR
Specify the size of the output pages to be printed.  Legal values for
\fIpagesize\fR 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
`\fIwidth\fRx\fIheight\fR' (where \fIwidth\fR and \fIheight\fR 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 \fBFILES\fR).  Default:
letter size.
.TP
\fB-r\fR
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.
.TP
\fB-R\fR
Same as \fB-r\fR.
.TP
\fB-s\fR\fR \fIsignal-list\fR
Print only the signals named in the \fIsignal-list\fR (one or more signal
numbers or names, separated by spaces;  default: print all signals).
.TP
\fB-S\fR \fIscale-mode timestamp-mode\fR
Print scales and timestamps in the specified modes.  Legal values for
\fIscale-mode\fR: 0 (no scales); 1 (mm/unit in footers); 2 (units/tick in
footers).  Legal values for \fItimestamp-mode\fR: 0 (no timestamps); 1
(elapsed times only); 2 (absolute times if defined, elapsed times otherwise).
Defaults: \fIscale-mode\fR = 1, \fItimestamp-mode\fR = 2.
.TP
\fB-t\fR \fIn\fR
Set the time scale to \fIn\fR millimeters per second (default: \fIn\fR = 2.5,
one-tenth of the standard scale for chart recorders).
.TP
\fB-T\fR \fItitle\fR
Set the page title to \fItitle\fR (which may include whitespace if quoted).
If no \fB-T\fR 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 `\fB-T ""\fR'.
.TP
\fB-u\fR
Generate `unstructured' PostScript as a workaround for a bug in the Adobe
TranScript software (also see \fBENVIRONMENT\fR below).  Default: generate
structured PostScript, suitable for processing by page-selection or
page-reversal post-processors.
.TP
\fB-v\fR \fIn\fR
Set the voltage (ordinate) scale to \fIn\fR 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 \fBwfdbcal\fR(5)).  The default scale is 1 mm/mV, one-tenth of the
standard scale for chart recorders.
.TP
\fB-V\fR
Verbose mode (echo each command as it is read from the script file).
.TP
\fB-w \fIn\fR
Set the line width for signals, grid lines, and marker bars to \fIn\fR mm.
Default: 0 (the narrowest possible width;  note that some devices may not
render zero-width lines correctly).
.TP
\fB-x\fR
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 \fIMIT-BIH Arrhythmia Database Directory\fR.)
.TP
\fB-1\fR
Print only the first character of each comment annotation.
.SS Scripts:
.PP
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
\fBpsfd\fR.  If the script name is `-', \fBpsfd\fR 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:
.br
	\fIrecord time\fR
.br
in which \fIrecord\fR is the name of the record for which a `full disclosure'
plot is to be printed, and \fItime\fR indicates the starting time (and,
optionally, the stop time) of the plot.  Anything that follows the \fItime\fR
field in a command is ignored.  Fields are separated by spaces or tabs.  If the
\fItime\fR 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 \fBpsfd\fR
to put the next plot at the top of a new page, even if the current page is not
full.  \fBpschart\fR(1) command scripts are usable by \fBpsfd\fR;  note,
however, that the programs use different conventions for interpreting a missing
stop time, and that strip titles are not printed by \fBpsfd\fR.
.SH ENVIRONMENT
.PP
.PP
The environment variable \fBPSFDPRO\fR can be used to name an
alternate prolog file (see below) for custom formats.  The environment
variable \fBTRANSCRIPTBUG\fR may be set (to any value) to generate
`unstructured' PostScript by default (see the \fB-u\fR option above).
It may be necessary to set and export the shell variables \fBWFDB\fR
and \fBWFDBCAL\fR (see \fBsetwfdb\fR(1)).
.SH FILES
.TP
\fB/usr/local/lib/ps/psfd.pro\fR
default PostScript prolog file.
.SH BUGS
.PP
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 \fBpsfd\fR output at nearly full speed.
.PP
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.
.PP
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 \fBpsfd\fR;  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 \fBpschart\fR(1).
.PP
Specifying EPSF output using the \fB-E\fR option does not prevent \fBpsfd\fR
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 \fB-V\fR option) before including it in another document.  Note that
the bounding box calculated by \fBpsfd\fR 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 \fBpsfd\fR output, or specify a page size
that closely matches the size of your plot.  The document in which \fBpsfd\fR
output is included can arbitrarily rescale the plot, so that scales expressed
in mm/unit cannot be relied upon.
.PP
Under MS-DOS, a bug in \fBcommand.com\fR makes it impossible to pass an empty
string in the argument list of a command, so that \fB-a ""\fR, \fB-c ""\fR, and
\fB-T ""\fR 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 \fBcommand.com\fR.
.PP
There are too many options.  Invoke \fBpsfd\fR with no arguments for a
brief summary of options.
.SH SEE ALSO
\fBpschart\fR(1), \fBsetwfdb\fR(1), \fBwave\fR(1)
.SH AUTHOR
George B. Moody (george@mit.edu)
.SH SOURCES
http://www.physionet.org/physiotools/wfdb/app/psfd.c
.br
http://www.physionet.org/physiotools/wfdb/app/psfd.pro