There are many ways to obtain concurrent processing. The approach
used here is to use an auxiliary utility that "sniffs" for the
existence of raw files. Once it finds a complete raw file, the raw
data is converted to either pgm
of pnm
format and then displayed. The conversion is done using
rw2pnm1
(which is similar to the post-processing
conversion routine rw2pnm
except that it converts a
single file and it accepts command-line arguments). To keep the
coding on "our end" as simple as possible, the display of the image is
handled using Tcl/Tk (specifically "wish
").
Click here to obtain the sniff
utility.
Click here to obtain the rw2pnm1.c
conversion
routine. (If you don't have them already, you'll also need to
grab the color mapping functions and HSV to RGB conversion function:
cmap1.c, cmap2.c
(zero = black) or
cmap2.c (zero = blue), and
hsvrgb.c).
You must have Tcl/Tk installed for this to work. If you do not have the Tcl/Tk routines, you can probably find all you need by following this link.
A few notes on the sniff
script. It must be executable
(type: "chmod +x sniff
" if it is not). Tcl/Tk must be
installed and the first line of sniff
must be the path to
wish
(which is part of version 4.0 [and higher?] of Tk).
The sniff
script must know where the rw2pnm1
executable is located. The default is that rw2pnm1
is
located in the same directory as the data. This generally won't be
the case, so you will need to set the PATH
variable in
the sniff
script to reflect the location of the
rw2pnm1
executable (currently it is set to
"./
").
To get conurrent processing, after you have started whatever
routine is going to generate the raw files, you fire up
sniff
using something like this:
sniff base wait zoom norm decades color [1|2]
where
base
= base name of raw files
wait
= delay between loads in seconds
zoom
= zoom/magnification factor (must be an integer)
norm
= normalization
decades
= number of decades of compression (0 for linear scale)
color
= 1 for grayscale, 2 for color
If color is selected (i.e., color
=2), the last argument
selects one- or two-sided color mapping.
Typically one would set delay
to be small (e.g., zero
or one). However, since sniff
can be used as a
post-processing tool too, there may be circumstances when one wants to
have a significant delay between the rendering of frames.
To insure that sniff
doesn't try to
render an incomplete raw file, raw file "N" isn't rendered until raw
file "N+1" has been generated (there are smarter ways to do this, but
we have been willing to live with this simple approach). The
consequence of this is that one never gets to see the last image in a
sequence.
Finally, sniff
will keep sniffing for the next
file until killed (using control-C or whatever happens to be your
favorite processing-killing technique). Also, sniff
will
leave behind the pgm
or pnm
files it
generated. So, if these aren't wanted, they will have to be removed
"by hand." If a complete set of image files are wanted,
rw2pnm1
or rw2pnm
will have to be run to
convert the last raw file that sniff
misses.
John B.
Schneider, schneidj@eecs.wsu.edu
Patrick J.
Flynn, flynn@ee.eng.ohio-state.edu
Kurt Shlager, kurt.shlager@lmco.com