<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='rwpics1'>
<!--  @(#)rwpics.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  G. T. Candela &amp; Craig I. Watson -->

<refmeta>
<refentrytitle>RWPICS</refentrytitle>
<manvolnum>1A</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>rwpics</refname>
<refpurpose>makes pictures of regional weights or gradients.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>rwpics</command>    
    <arg choice='plain'><replaceable>&lt;rwfile_in</replaceable></arg>
    <arg choice='opt' rep='repeat'><replaceable>rwfile_in</replaceable></arg>
    <arg>&gt;</arg>
    <group choice='plain'><arg choice='plain'><replaceable>&lt;rws</replaceable></arg><arg choice='plain'><replaceable>eg</replaceable></arg><arg choice='plain'><replaceable>seg&gt;&lt;outpics_dir&gt;</replaceable></arg></group>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>Rwpics</emphasis>
reads a set of PCASYS "matrix" format files each of size 14 x 15.  The
input files either should be a set of points in regional weights space
(in particular, basepoints produced by the optimize regional weights
command optrws), or they should be a set of estimated gradients of the
activation error (also produced by optrws).  Makes a corresponding set
of IHead format image files depicting the weights points or
gradients; these image files can then be displayed using dpyimage.
Rwpics can be used as a sanity check on whether optrws is
working properly, and to help decide when the time has come that it is
reasonable to stop an optrws run because further significant change of
the weights seems unlikely.</para>
</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;rwfile_in[rwfile_in...]&gt;</emphasis></term>
  <listitem>
<para>The pcasys "matrix" format file(s) to be depicted.  Either they should
each be a basepoint of the optrws optimization (point in
regional weights space), or they should each be an estimated
gradient, also produced by optrws.  In either case, they must
be matrices of size 14 x 15, corresponding to the weights, each of
which is associated with one 2 x 2 vector block of the 28 x 30
pattern of orientation vectors. (Usually the output of <emphasis remap='B'>optrws</emphasis>.)</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;rws|eg|seg&gt;</emphasis></term>
  <listitem>
<para>A code telling rwpics what kind of pictures to make:</para>

<para>If rws ("regional weights"), the program makes a grayscale picture
that is reasonable if the input file represents a set of regional
weights, e.g. one of the bspt files produced by an optrws run.  To do
so, it linearly maps absolute values of input values to gray tones,
setting the mapping so that 0. maps to black and the maximum absolute
value across all components of all input matrices, to white.  Absolute
values are the reasonable thing to depict when examining a point in
regional-weights space, since the sign of a regional weights has no
effect on the PNN classifier.  (Optimization may sometimes cause some
unimportant outer weights to be slightly negative.)  The mapping is
adapted to the maximum absolute value across all input files, rather
than being separately adapted for each input file; this is done so
that the several resulting pictures can be examined side by side with
the knowledge that all gray tones are on the same scale.</para>

<para>If eg ("estimated gradient"), the program makes a grayscale picture
that is reasonable if the input file represents an estimated gradient
of the error function, e.g. one of the egrad files produced by an
optrws run.  To do so, it affinely maps input values to gray tones,
setting the mapping so that the minimum input value across all input
files is mapped to white and the maximum input value, to black.</para>

<para>If seg ("sign of estimated gradient"), the program makes a
grayscale-binary (ie. 0 and 255 pixel values) picture that is
reasonable if the input file represents an estimated gradient
of the error function.  To do so, it maps negative values to white (255)
and nonnegative values to black (0).  This is interesting because if
the component of the estimated gradient (i.e., the estimated partial
derivative) associated with a region is negative, that shows that the
weight for this region should be increased (and will be increased by
optrws).</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;outpics_dir&gt;</emphasis></term>
  <listitem>
<para>The directory in which the program should produce its output files,
which will be raster images in the NIST IHead format.  (The directory
must already exist, i.e. rwpics does not produce it.) Each output
file's name is produced by taking the last component of the
corresponding input file and appending an underscore, then the
rws|eg|seg code, then .pct (the standard IHEAD file suffix).  The
output image files may be examined using the dpyimage command.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='examples'><title>EXAMPLE(S)</title>
<para>From <emphasis remap='I'>test/pcasys/execs/rwpics/rwpics.src</emphasis>:</para>

<!-- .RS -->
<para><emphasis remap='B'>% rwpics ../optrws/optrws.bin rws rwpics</emphasis>
<!-- .br -->
Produces an image of the optimized regional weights, which
can be converted to JPEG format using the <emphasis remap='B'>cjpegb</emphasis> command.</para>

<para><emphasis remap='B'>% rwpics ../optrws/optdir/egrad_1.bin eg rwpics</emphasis>
<!-- .br -->
Produces an image of the estimated gradient, which
can be converted to JPEG format using the <emphasis remap='B'>cjpegb</emphasis> command.</para>

<para><emphasis remap='B'>% rwpics ../optrws/optdir/egrad_1.bin seg rwpics</emphasis>
<!-- .br -->
Produces an image of the sign of estimated gradient, which
can be converted to JPEG format using the <emphasis remap='B'>cjpegb</emphasis> command.</para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>dpyimage (1A), optrws (1A), cjpegb (1D)</para>

</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

