Index: /trunk/psLib/src/image/psImage.h
===================================================================
--- /trunk/psLib/src/image/psImage.h	(revision 1441)
+++ /trunk/psLib/src/image/psImage.h	(revision 1442)
@@ -12,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:05:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -43,37 +43,31 @@
 typedef struct psImage
 {
-    const psType type;          ///< Image data type and dimension.
-    const unsigned int numCols; ///< Number of columns in image
-    const unsigned int numRows; ///< Number of rows in image.
-    const int col0;             ///< Column position relative to parent.
-    const int row0;             ///< Row position relative to parent.
+    const psType type;                 ///< Image data type and dimension.
+    const unsigned int numCols;        ///< Number of columns in image
+    const unsigned int numRows;        ///< Number of rows in image.
+    const int col0;                    ///< Column position relative to parent.
+    const int row0;                    ///< Row position relative to parent.
 
     union {
-        psU8* *U8;              ///< Unsigned 8-bit integer data.
-        psU16* *U16;            ///< Unsigned 16-bit integer data.
-        psU32* *U32;            ///< Unsigned 32-bit integer data.
-        psU64* *U64;            ///< Unsigned 64-bit integer data.
-        psS8* *S8;              ///< Signed 8-bit integer data.
-        psS16* *S16;            ///< Signed 16-bit integer data.
-        psS32* *S32;            ///< Signed 32-bit integer data.
-        psS64* *S64;            ///< Signed 64-bit integer data.
-        psF32* *F32;            ///< Single-precision float data.
-        psF64* *F64;            ///< Double-precision float data.
-        psC32* *C32;            ///< Single-precision complex data.
-        psC64* *C64;            ///< Double-precision complex data.
-        psPTR* *PTR;            ///< Void pointers.
-        psPTR* V;               ///< Pointer to data.
-    } data;                     ///< Union for data types.
-    const struct psImage* parent;       ///< Parent, if a subimage.
-    int nChildren;              ///< Number of subimages.
-    struct psImage* *children;  ///< Children of this region.
+        psU8* *U8;                     ///< Unsigned 8-bit integer data.
+        psU16* *U16;                   ///< Unsigned 16-bit integer data.
+        psU32* *U32;                   ///< Unsigned 32-bit integer data.
+        psU64* *U64;                   ///< Unsigned 64-bit integer data.
+        psS8* *S8;                     ///< Signed 8-bit integer data.
+        psS16* *S16;                   ///< Signed 16-bit integer data.
+        psS32* *S32;                   ///< Signed 32-bit integer data.
+        psS64* *S64;                   ///< Signed 64-bit integer data.
+        psF32* *F32;                   ///< Single-precision float data.
+        psF64* *F64;                   ///< Double-precision float data.
+        psC32* *C32;                   ///< Single-precision complex data.
+        psC64* *C64;                   ///< Double-precision complex data.
+        psPTR* *PTR;                   ///< Void pointers.
+        psPTR* V;                      ///< Pointer to data.
+    } data;                            ///< Union for data types.
+    const struct psImage* parent;      ///< Parent, if a subimage.
+    int nChildren;                     ///< Number of subimages.
+    struct psImage* *children;         ///< Children of this region.
 }
 psImage;
-
-/*****************************************************************************/
-
-/* FUNCTION PROTOTYPES                                                       */
-
-/*****************************************************************************/
 
 /** Create an image of the specified size and type.
@@ -85,8 +79,9 @@
  *
  */
-psImage* psImageAlloc(unsigned int numCols,     ///< Number of rows in image.
-                      unsigned int numRows,     ///< Number of columns in image.
-                      const psElemType type     ///< Type of data for image.
-                     );
+psImage* psImageAlloc(
+    unsigned int numCols,              ///< Number of rows in image.
+    unsigned int numRows,              ///< Number of columns in image.
+    const psElemType type              ///< Type of data for image.
+);
 
 /** Resize a given image to the given size/type.
@@ -95,9 +90,10 @@
  *
  */
-psImage* psImageRecycle(psImage* old,  ///< the psImage to recycle by resizing image buffer
-                        unsigned int numCols,   ///< the desired number of columns in image
-                        unsigned int numRows,   ///< the desired number of rows in image
-                        const psElemType type   ///< the desired datatype of the image
-                       );
+psImage* psImageRecycle(
+    psImage* old,                      ///< the psImage to recycle by resizing image buffer
+    unsigned int numCols,              ///< the desired number of columns in image
+    unsigned int numRows,              ///< the desired number of rows in image
+    const psElemType type              ///< the desired datatype of the image
+);
 
 /** Frees all children of a psImage.
@@ -106,11 +102,20 @@
  *
  */
-int psImageFreeChildren(psImage* image
+int psImageFreeChildren(
+    psImage* image                     ///< psImage in which all children shall be deallocated
+);
 
-                        /**< psImage in which all children shall be deallocated */
-                       );
-
-psF32 psImagePixelInterpolate(const psImage* input,
-                              float x, float y, psF32 unexposedValue, psImageInterpolateMode mode);
+/** Interpolate image pixel value given floating point coordinates.
+ *
+ *  @return psF32    Pixel value interpolated from image or unexposedValue if
+ *                   given x,y doesn't coorespond to a valid image location
+ */
+psF32 psImagePixelInterpolate(
+    const psImage* input,              ///< input image for interpolation
+    float x,                           ///< column location to derive value of
+    float y,                           ///< row location ot derive value of
+    psF32 unexposedValue,              ///< return value if x,y location is not in image.
+    psImageInterpolateMode mode        ///< interpolation mode
+);
 
 #define p_psImagePixelInterpolateFcns(TYPE) \
Index: /trunk/psLib/src/image/psImageIO.h
===================================================================
--- /trunk/psLib/src/image/psImageIO.h	(revision 1441)
+++ /trunk/psLib/src/image/psImageIO.h	(revision 1442)
@@ -10,6 +10,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:05:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,36 +30,36 @@
  *                          signifies that a problem had occured.
  */
-psImage* psImageReadSection(psImage* output,
+psImage* psImageReadSection(
+    psImage* output,
+    /**< the output psImage to recycle, or NULL if new psImage desired */
 
-                            /**< the output psImage to recycle, or NULL if new psImage desired */
-                            int col0,
+    int col0,
+    /**< the column index of the origin to start reading */
 
-                            /**< the column index of the origin to start reading */
-                            int row0,
+    int row0,
+    /**< the row index of the origin to start reading */
 
-                            /**< the row index of the origin to start reading */
-                            int numCols,
+    int numCols,
+    /**< the number of desired columns to read */
 
-                            /**< the number of desired columns to read */
-                            int numRows,
+    int numRows,
+    /**< the number of desired rows to read */
 
-                            /**< the number of desired rows to read */
-                            int z,
+    int z,
+    /**< the z index to read if file is organized as a 3D image cube. */
 
-                            /**< the z index to read if file is organized as a 3D image cube. */
-                            char *extname,
+    char *extname,
+    /**< the image extension to read (this should match the EXTNAME keyword in
+        *   the extension If NULL, the extnum parameter is to be used instead
+        */
 
-                            /**< the image extension to read (this should match the EXTNAME keyword in
-                             *   the extension If NULL, the extnum parameter is to be used instead
-                             */
-                            int extnum,
+    int extnum,
+    /**< the image extension to read (0=PHU, 1=first extension, etc.)  This is
+        *   only used if extname is NULL
+        */
 
-                            /**< the image extension to read (0=PHU, 1=first extension, etc.)  This is
-                             *   only used if extname is NULL
-                             */
-                            char *filename
-
-                            /**< the filename of the FITS image file to read */
-                           );
+    char *filename
+    /**< the filename of the FITS image file to read */
+);
 
 /** Read an image or subimage from a FITS file specified by a filename.
@@ -67,30 +67,30 @@
  *  return bool         TRUE is successful, otherwise FALSE.
  */
-bool psImageWriteSection(psImage* input,
+bool psImageWriteSection(
+    psImage* input,
+    /**< the psImage to write */
 
-                         /**< the psImage to write */
-                         int col0,
+    int col0,
+    /**< the column index of the origin to start writing */
 
-                         /**< the column index of the origin to start writing */
-                         int row0,
+    int row0,
+    /**< the row index of the origin to start writing */
 
-                         /**< the row index of the origin to start writing */
-                         int z,
+    int z,
+    /**< the z index to start writing */
 
-                         /**< the z index to start writing */
-                         char *extname,
+    char *extname,
+    /**< the image extension to write (this should match the EXTNAME keyword in
+    *   the extension If NULL, the extnum parameter is to be used instead
+    */
 
-                         /**< the image extension to write (this should match the EXTNAME keyword in
-                          *   the extension If NULL, the extnum parameter is to be used instead
-                          */
-                         int extnum,
+    int extnum,
+    /**< the image extension to write (0=PHU, 1=first extension, etc.)  This is
+    *   only used if extname is NULL.
+    */
 
-                         /**< the image extension to write (0=PHU, 1=first extension, etc.)  This is
-                          *   only used if extname is NULL.
-                          */
-                         char *filename
-
-                         /**< the filename of the FITS image file to write */
-                        );
+    char *filename
+    /**< the filename of the FITS image file to write */
+);
 
 /// @}
Index: /trunk/psLib/src/image/psImageManip.h
===================================================================
--- /trunk/psLib/src/image/psImageManip.h	(revision 1441)
+++ /trunk/psLib/src/image/psImageManip.h	(revision 1442)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:05:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,10 +32,11 @@
  *  @return int     The number of clipped pixels
  */
-int psImageClip(psImage* input,        ///< the image to clip
-                psF64 min,      ///< the minimum image value allowed
-                psF64 vmin,     ///< the value pixels < min are set to
-                psF64 max,      ///< the maximum image value allowed
-                psF64 vmax      ///< the value pixels > max are set to
-               );
+int psImageClip(
+    psImage* input,                    ///< the image to clip
+    psF64 min,                         ///< the minimum image value allowed
+    psF64 vmin,                        ///< the value pixels < min are set to
+    psF64 max,                         ///< the maximum image value allowed
+    psF64 vmax                         ///< the value pixels > max are set to
+);
 
 /** Clip image values outside of a specified complex region
@@ -48,10 +49,11 @@
  *  @return int     The number of clipped pixels
  */
-int psImageClipComplexRegion(psImage* input,   ///< the image to clip
-                             psC64 min, ///< the minimum image value allowed
-                             psC64 vmin,        ///< the value pixels < min are set to
-                             psC64 max, ///< the maximum image value allowed
-                             psC64 vmax ///< the value pixels > max are set to
-                            );
+int psImageClipComplexRegion(
+    psImage* input,                    ///< the image to clip
+    psC64 min,                         ///< the minimum image value allowed
+    psC64 vmin,                        ///< the value pixels < min are set to
+    psC64 max,                         ///< the maximum image value allowed
+    psC64 vmax                         ///< the value pixels > max are set to
+);
 
 /** Clip NaN image pixels to given value.
@@ -62,7 +64,8 @@
  *  @return int     The number of clipped pixels
  */
-int psImageClipNaN(psImage* input,     ///< the image to clip
-                   psF64 value  ///< the value to set all NaN/Inf values to
-                  );
+int psImageClipNaN(
+    psImage* input,                    ///< the image to clip
+    psF64 value                        ///< the value to set all NaN/Inf values to
+);
 
 /** Overlay subregion of image with another image
@@ -77,10 +80,11 @@
  *  @return int         0 if success, non-zero if failed.
  */
-int psImageOverlaySection(psImage* image,      ///< target image
-                          const psImage* overlay,      ///< the overlay image
-                          int col0,     ///< the column to start overlay
-                          int row0,     ///< the row to start overlay
-                          const char *op        ///< the operation to perform for overlay
-                         );
+int psImageOverlaySection(
+    psImage* image,                    ///< target image
+    const psImage* overlay,            ///< the overlay image
+    int col0,                          ///< the column to start overlay
+    int row0,                          ///< the row to start overlay
+    const char *op                     ///< the operation to perform for overlay
+);
 
 /** Rebin image to new scale.
@@ -94,22 +98,68 @@
  *  @return psImage    new image formed by rebinning input image.
  */
-psImage* psImageRebin(psImage* out,    ///< an psImage to recycle.  If NULL, a new image is created
-                      const psImage* in,       ///< input image
-                      unsigned int scale,       ///< the scale to rebin for each dimension
-                      const psStats* stats     ///< the statistic to perform when rebinning.  Only one
-                      // method should be set.
-                     );
+psImage* psImageRebin(
+    psImage* out,                      ///< an psImage to recycle.  If NULL, a new image is created
+    const psImage* in,                 ///< input image
+    unsigned int scale,                ///< the scale to rebin for each dimension
+    const psStats* stats
+    ///< the statistic to perform when rebinning.  Only one method should be set.
+);
 
-psImage* psImageResample(psImage* out, ///< an psImage to recycle.  If NULL, a new image is created
-                         const psImage* in,    ///< input image
-                         int scale, psImageInterpolateMode mode);
+/** Resample image to new scale.
+ *
+ *  A new image is constructed in which the dimensions are increased by a 
+ *  factor of scale. The scale, always a positive number, is equal in each 
+ *  dimension. The output image is generated from all input image pixels. 
+ *  Each pixel in the output image is derived by interpolating between 
+ *  neighboring pixels using the specified interpolation method (mode).
+ *
+ *  @return psImage*    resampled image result
+ */
+psImage* psImageResample(
+    psImage* out,                      ///< an psImage to recycle.  If NULL, a new image is created
+    const psImage* in,                 ///< input image
+    int scale,                         ///< resample scaling factor
+    psImageInterpolateMode mode        ///< the interpolation mode used in resampling
+);
 
-psImage* psImageRotate(psImage* out,   ///< an psImage to recycle.  If NULL, a new image is created
-                       const psImage* in,      ///< input image
-                       float angle, float unexposedValue, psImageInterpolateMode mode);
+/** Rotate the input image by given angle, specified in degrees.
+ *
+ *  The output image must contain all of the pixels from the input image in 
+ *  their new frame. Pixels in the output image which do not map to input 
+ *  pixels should be set to exposed. The center of rotation is always the 
+ *  center pixel of the image. The rotation is specified in the sense that a 
+ *  positive angle is an anti-clockwise rotation. This function must be 
+ *  defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64, 
+ *  psC32, psC64.
+ *
+ *  @return psImage*     the rotated image result.
+ */
+psImage* psImageRotate(
+    psImage* out,                      ///< an psImage to recycle.  If NULL, a new image is created
+    const psImage* in,                 ///< input image
+    float angle,                       ///< the rotation angle in degrees.
+    float unexposedValue,              ///< the output image pixel values for non-imagery areas
+    psImageInterpolateMode mode        ///< the interpolation mode used
+);
 
-psImage* psImageShift(psImage* out,    ///< an psImage to recycle.  If NULL, a new image is created
-                      const psImage* in,       ///< input image
-                      float dx, float dy, float unexposedValue, psImageInterpolateMode mode);
+/** Shift image by an arbitrary number of pixels (dx,dy) in either direction.
+ *
+ *  If the shift values are fractional, the output pixel values should 
+ *  interpolate between the input pixel values. The output image has the same 
+ *  dimensions as the input image. Pixels which fall off the edge of the 
+ *  output image are lost. Newly exposed pixels are set to the value given by 
+ *  exposed. This function must be defined for the following types: psU8, 
+ *  psU16, psS8, psS16, psF32, psF64, psC32, psC64.
+ *
+ *  @return psImage*     the shifted image result.
+ */
+psImage* psImageShift(
+    psImage* out,                      ///< an psImage to recycle.  If NULL, a new image is created
+    const psImage* in,                 ///< input image
+    float dx,                          ///< the shift in x direction.
+    float dy,                          ///< the shift in y direction.
+    float unexposedValue,              ///< the output image pixel values for non-imagery areas
+    psImageInterpolateMode mode        ///< the interpolation mode to use
+);
 
 /** Roll image by an integer number of pixels in either direction.
@@ -121,9 +171,10 @@
  *  @return psImage* the rolled version of the input image.
  */
-psImage* psImageRoll(psImage* out,     ///< an psImage to recycle.  If NULL, a new image is created
-                     const psImage* in,        ///< input image
-                     int dx,    ///< number of pixels to roll in the x-dimension
-                     int dy     ///< number of pixels to roll in the y-dimension
-                    );
+psImage* psImageRoll(
+    psImage* out,                      ///< an psImage to recycle.  If NULL, a new image is created
+    const psImage* in,                 ///< input image
+    int dx,                            ///< number of pixels to roll in the x-dimension
+    int dy                             ///< number of pixels to roll in the y-dimension
+);
 
 #endif
Index: /trunk/psLib/src/image/psImageStats.c
===================================================================
--- /trunk/psLib/src/image/psImageStats.c	(revision 1441)
+++ /trunk/psLib/src/image/psImageStats.c	(revision 1442)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:34:58 $
+*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:05:53 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -401,4 +401,4 @@
     psFree(rScalingFactors);
 
-    return (0);
-}
+    return input;
+}
Index: /trunk/psLib/src/image/psImageStats.h
===================================================================
--- /trunk/psLib/src/image/psImageStats.h	(revision 1441)
+++ /trunk/psLib/src/image/psImageStats.h	(revision 1442)
@@ -1,3 +1,2 @@
-
 /** @file psImageStats.h
 *  \brief Routines for calculating statistics on images.
@@ -10,6 +9,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:40:55 $
+*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:05:53 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -27,25 +26,62 @@
 /// @{
 
-/// This routine must determine the various statistics for the image.
-psStats* psImageStats(psStats* stats,  ///< defines statistics to be calculated
-                      psImage* in,     ///< image (or subimage) to calculate stats
-                      psImage* mask,   ///< mask data for image (NULL ok)
-                      int maskVal);     ///< mask Mask for mask
+/** This routine must determine the various statistics for the image.
+ *
+ *  Determine statistics for image (or subimage). The statistics to be 
+ *  determined are specified by stats. The mask allows pixels to be excluded 
+ *  if their corresponding mask pixel value matches the value of maskVal. 
+ *  This function must be defined for the following types: psS8, psU16, psF32, 
+ *  psF64.
+ *
+ *  @return psStats*    the resulting statistics result(s)
+ */
+psStats* psImageStats(
+    psStats* stats,                    ///< defines statistics to be calculated
+    psImage* in,                       ///< image (or subimage) to calculate stats
+    psImage* mask,                     ///< mask data for image (NULL ok)
+    int maskVal                        ///< mask Mask for mask
+);
 
-psHistogram* psImageHistogram(psHistogram* out,        ///< input histogram description & target
-                              psImage* in,     ///< Image data to be histogramed.
-                              psImage* mask,   ///< mask data for image (NULL ok)
-                              unsigned int maskVal);    ///< mask Mask for mask
+/** Construct a histogram from an image (or subimage).
+ *
+ *  The histogram to generate is specified by psHistogram hist (see section 
+ *  4.3.2 in SDRS). This function must be defined for the following types: 
+ *  psS8, psU16, psF32, psF64.
+ *
+ *  @return psHistogram*     the resulting histogram
+ */
+psHistogram* psImageHistogram(
+    psHistogram* out,                  ///< input histogram description & target
+    psImage* in,                       ///< Image data to be histogramed.
+    psImage* mask,                     ///< mask data for image (NULL ok)
+    unsigned int maskVal               ///< mask Mask for mask
+);
 
-/// Fit a 2-D polynomial surface to an image.
-psPolynomial2D* psImageFitPolynomial(const psImage* input,     ///< image to fit
-                                     psPolynomial2D* coeffs    ///< coefficient structure carries in
-                                     // desired terms & target
-                                    );
+/** Fit a 2-D polynomial surface to an image.
+ *
+ *  The input structure coeffs contains the desired order and terms of 
+ *  interest. This function must be defined for the following types: psS8, 
+ *  psU16, psF32, psF64.
+ *
+ *  @return psPolynomial2D*     fitted polynomial result
+ *
+ */
+psPolynomial2D* psImageFitPolynomial(
+    const psImage* input,              ///< image to fit
+    psPolynomial2D* coeffs             ///< coefficient structure carries in desired terms & target
+);
 
-/// Evaluate a 2-D polynomial surface to image pixels.
-int psImageEvalPolynomial(const psImage* input,        ///< image to fit
-                          const psPolynomial2D* coeffs ///< coefficient structure carries in desired terms
-                         );
+/** Evaluate a 2-D polynomial surface for the image pixels.
+ *
+ *  Given the input polynomial coefficients, set the image pixel values on the 
+ *  basis of the polynomial function. This function must be defined for the 
+ *  following types: psS8, psU16, psF32, psF64.
+ *
+ *  @return psImage*    the resulting image
+ */
+int psImageEvalPolynomial(
+    const psImage* input,              ///< input image
+    const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
+);
 
 /// @}
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 1441)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 1442)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:34:58 $
+*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:05:53 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -401,4 +401,4 @@
     psFree(rScalingFactors);
 
-    return (0);
-}
+    return input;
+}
Index: /trunk/psLib/src/imageops/psImageStats.h
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.h	(revision 1441)
+++ /trunk/psLib/src/imageops/psImageStats.h	(revision 1442)
@@ -1,3 +1,2 @@
-
 /** @file psImageStats.h
 *  \brief Routines for calculating statistics on images.
@@ -10,6 +9,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:40:55 $
+*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:05:53 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -27,25 +26,62 @@
 /// @{
 
-/// This routine must determine the various statistics for the image.
-psStats* psImageStats(psStats* stats,  ///< defines statistics to be calculated
-                      psImage* in,     ///< image (or subimage) to calculate stats
-                      psImage* mask,   ///< mask data for image (NULL ok)
-                      int maskVal);     ///< mask Mask for mask
+/** This routine must determine the various statistics for the image.
+ *
+ *  Determine statistics for image (or subimage). The statistics to be 
+ *  determined are specified by stats. The mask allows pixels to be excluded 
+ *  if their corresponding mask pixel value matches the value of maskVal. 
+ *  This function must be defined for the following types: psS8, psU16, psF32, 
+ *  psF64.
+ *
+ *  @return psStats*    the resulting statistics result(s)
+ */
+psStats* psImageStats(
+    psStats* stats,                    ///< defines statistics to be calculated
+    psImage* in,                       ///< image (or subimage) to calculate stats
+    psImage* mask,                     ///< mask data for image (NULL ok)
+    int maskVal                        ///< mask Mask for mask
+);
 
-psHistogram* psImageHistogram(psHistogram* out,        ///< input histogram description & target
-                              psImage* in,     ///< Image data to be histogramed.
-                              psImage* mask,   ///< mask data for image (NULL ok)
-                              unsigned int maskVal);    ///< mask Mask for mask
+/** Construct a histogram from an image (or subimage).
+ *
+ *  The histogram to generate is specified by psHistogram hist (see section 
+ *  4.3.2 in SDRS). This function must be defined for the following types: 
+ *  psS8, psU16, psF32, psF64.
+ *
+ *  @return psHistogram*     the resulting histogram
+ */
+psHistogram* psImageHistogram(
+    psHistogram* out,                  ///< input histogram description & target
+    psImage* in,                       ///< Image data to be histogramed.
+    psImage* mask,                     ///< mask data for image (NULL ok)
+    unsigned int maskVal               ///< mask Mask for mask
+);
 
-/// Fit a 2-D polynomial surface to an image.
-psPolynomial2D* psImageFitPolynomial(const psImage* input,     ///< image to fit
-                                     psPolynomial2D* coeffs    ///< coefficient structure carries in
-                                     // desired terms & target
-                                    );
+/** Fit a 2-D polynomial surface to an image.
+ *
+ *  The input structure coeffs contains the desired order and terms of 
+ *  interest. This function must be defined for the following types: psS8, 
+ *  psU16, psF32, psF64.
+ *
+ *  @return psPolynomial2D*     fitted polynomial result
+ *
+ */
+psPolynomial2D* psImageFitPolynomial(
+    const psImage* input,              ///< image to fit
+    psPolynomial2D* coeffs             ///< coefficient structure carries in desired terms & target
+);
 
-/// Evaluate a 2-D polynomial surface to image pixels.
-int psImageEvalPolynomial(const psImage* input,        ///< image to fit
-                          const psPolynomial2D* coeffs ///< coefficient structure carries in desired terms
-                         );
+/** Evaluate a 2-D polynomial surface for the image pixels.
+ *
+ *  Given the input polynomial coefficients, set the image pixel values on the 
+ *  basis of the polynomial function. This function must be defined for the 
+ *  following types: psS8, psU16, psF32, psF64.
+ *
+ *  @return psImage*    the resulting image
+ */
+int psImageEvalPolynomial(
+    const psImage* input,              ///< input image
+    const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
+);
 
 /// @}
Index: /trunk/psLib/src/mathtypes/psImage.h
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.h	(revision 1441)
+++ /trunk/psLib/src/mathtypes/psImage.h	(revision 1442)
@@ -12,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:05:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -43,37 +43,31 @@
 typedef struct psImage
 {
-    const psType type;          ///< Image data type and dimension.
-    const unsigned int numCols; ///< Number of columns in image
-    const unsigned int numRows; ///< Number of rows in image.
-    const int col0;             ///< Column position relative to parent.
-    const int row0;             ///< Row position relative to parent.
+    const psType type;                 ///< Image data type and dimension.
+    const unsigned int numCols;        ///< Number of columns in image
+    const unsigned int numRows;        ///< Number of rows in image.
+    const int col0;                    ///< Column position relative to parent.
+    const int row0;                    ///< Row position relative to parent.
 
     union {
-        psU8* *U8;              ///< Unsigned 8-bit integer data.
-        psU16* *U16;            ///< Unsigned 16-bit integer data.
-        psU32* *U32;            ///< Unsigned 32-bit integer data.
-        psU64* *U64;            ///< Unsigned 64-bit integer data.
-        psS8* *S8;              ///< Signed 8-bit integer data.
-        psS16* *S16;            ///< Signed 16-bit integer data.
-        psS32* *S32;            ///< Signed 32-bit integer data.
-        psS64* *S64;            ///< Signed 64-bit integer data.
-        psF32* *F32;            ///< Single-precision float data.
-        psF64* *F64;            ///< Double-precision float data.
-        psC32* *C32;            ///< Single-precision complex data.
-        psC64* *C64;            ///< Double-precision complex data.
-        psPTR* *PTR;            ///< Void pointers.
-        psPTR* V;               ///< Pointer to data.
-    } data;                     ///< Union for data types.
-    const struct psImage* parent;       ///< Parent, if a subimage.
-    int nChildren;              ///< Number of subimages.
-    struct psImage* *children;  ///< Children of this region.
+        psU8* *U8;                     ///< Unsigned 8-bit integer data.
+        psU16* *U16;                   ///< Unsigned 16-bit integer data.
+        psU32* *U32;                   ///< Unsigned 32-bit integer data.
+        psU64* *U64;                   ///< Unsigned 64-bit integer data.
+        psS8* *S8;                     ///< Signed 8-bit integer data.
+        psS16* *S16;                   ///< Signed 16-bit integer data.
+        psS32* *S32;                   ///< Signed 32-bit integer data.
+        psS64* *S64;                   ///< Signed 64-bit integer data.
+        psF32* *F32;                   ///< Single-precision float data.
+        psF64* *F64;                   ///< Double-precision float data.
+        psC32* *C32;                   ///< Single-precision complex data.
+        psC64* *C64;                   ///< Double-precision complex data.
+        psPTR* *PTR;                   ///< Void pointers.
+        psPTR* V;                      ///< Pointer to data.
+    } data;                            ///< Union for data types.
+    const struct psImage* parent;      ///< Parent, if a subimage.
+    int nChildren;                     ///< Number of subimages.
+    struct psImage* *children;         ///< Children of this region.
 }
 psImage;
-
-/*****************************************************************************/
-
-/* FUNCTION PROTOTYPES                                                       */
-
-/*****************************************************************************/
 
 /** Create an image of the specified size and type.
@@ -85,8 +79,9 @@
  *
  */
-psImage* psImageAlloc(unsigned int numCols,     ///< Number of rows in image.
-                      unsigned int numRows,     ///< Number of columns in image.
-                      const psElemType type     ///< Type of data for image.
-                     );
+psImage* psImageAlloc(
+    unsigned int numCols,              ///< Number of rows in image.
+    unsigned int numRows,              ///< Number of columns in image.
+    const psElemType type              ///< Type of data for image.
+);
 
 /** Resize a given image to the given size/type.
@@ -95,9 +90,10 @@
  *
  */
-psImage* psImageRecycle(psImage* old,  ///< the psImage to recycle by resizing image buffer
-                        unsigned int numCols,   ///< the desired number of columns in image
-                        unsigned int numRows,   ///< the desired number of rows in image
-                        const psElemType type   ///< the desired datatype of the image
-                       );
+psImage* psImageRecycle(
+    psImage* old,                      ///< the psImage to recycle by resizing image buffer
+    unsigned int numCols,              ///< the desired number of columns in image
+    unsigned int numRows,              ///< the desired number of rows in image
+    const psElemType type              ///< the desired datatype of the image
+);
 
 /** Frees all children of a psImage.
@@ -106,11 +102,20 @@
  *
  */
-int psImageFreeChildren(psImage* image
+int psImageFreeChildren(
+    psImage* image                     ///< psImage in which all children shall be deallocated
+);
 
-                        /**< psImage in which all children shall be deallocated */
-                       );
-
-psF32 psImagePixelInterpolate(const psImage* input,
-                              float x, float y, psF32 unexposedValue, psImageInterpolateMode mode);
+/** Interpolate image pixel value given floating point coordinates.
+ *
+ *  @return psF32    Pixel value interpolated from image or unexposedValue if
+ *                   given x,y doesn't coorespond to a valid image location
+ */
+psF32 psImagePixelInterpolate(
+    const psImage* input,              ///< input image for interpolation
+    float x,                           ///< column location to derive value of
+    float y,                           ///< row location ot derive value of
+    psF32 unexposedValue,              ///< return value if x,y location is not in image.
+    psImageInterpolateMode mode        ///< interpolation mode
+);
 
 #define p_psImagePixelInterpolateFcns(TYPE) \
