Index: trunk/archive/pslib/include/psImages.h
===================================================================
--- trunk/archive/pslib/include/psImages.h	(revision 189)
+++ trunk/archive/pslib/include/psImages.h	(revision 198)
@@ -1,4 +1,10 @@
 # ifndef PS_IMAGES_H
 # define PS_IMAGES_H
+
+#include "psStdArrays.h"
+#include "psUtils.h"
+#include "psObjects.h"
+#include "psMetaData.h"
+#include "psStats.h"
 
 /** General image manipulation functions.
@@ -15,5 +21,4 @@
 
 PS_DECLARE_ARRAY_TYPE(psFloatArray);	///< Declare an array of real vectors (psFloatArrayArray).
-PS_CREATE_ARRAY_TYPE(psFloatArray); 	///< Create the data type (psFloatArrayArray).
 
 typedef unsigned char  psU8;		///< BITPIX 8   (unsigned short)
@@ -34,9 +39,9 @@
     psF32 **rows_f32;			///< pointers to psF32 data 
     psF64 **rows_f64;			///< pointers to psF64 data 
-    psImage *parent;			///< parent, if a subimage 
-    psImage *children;			///< children of this region 
+    struct psImage *parent;		///< parent, if a subimage 
+    struct psImage *children;		///< children of this region 
     int Nchildren;			///< number of subimages 
-    psDlist md;				///< metadata associated with image
-    psObjectTable objtable;		///< objects associated with image
+    struct psMetaDataSet *md;		///< metadata associated with image
+    psObjectArray *objtable;		///< objects associated with image
 } psImage;
 
@@ -75,4 +80,7 @@
 
 /*** various image pixel extractions ***/
+
+typedef enum { PS_STAT_MODE_MEDIAN } psStatMode;
+
 /// Extract pixels from rectlinear region to a vector.
 psFloatArray *
@@ -82,6 +90,6 @@
 	      int nx, 			///< width of region in x
 	      int ny, 			///< width of region in y
-	      enum direction, 		///< direction of vector along slice
-	      enum statmode		///< statistic applied to pixel group to find output value
+	      int direction,		///< direction of vector along slice
+	      psStatMode statmode	///< statistic applied to pixel group to find output value
 );
 
@@ -94,6 +102,6 @@
 	    float ye, 			///< ending y coord of cut
 	    float dw, 			///< width of cut
-	    enum statmode		///< statistic applied to pixel group to find output value
-);
+	    psStatMode statmode		///< statistic applied to pixel group to find output value
+    );
 
 /// Extract radial annulii data to a vector.
@@ -104,6 +112,6 @@
 		  float radius, 	///< outer radius of annulii
 		  float dr,		///< radial step size of annulii
-		  enum statmode		///< statistic applied to pixel group to find output value
-);
+		  psStatMode statmode	///< statistic applied to pixel group to find output value
+    );
 
 /// Extract a 2-d contour from an image at the given threshold.
@@ -114,10 +122,4 @@
 );
 
-/// Extract a 2-d contour from an image at the given threshold.
-psSpanArray *
-psImageContour (psImage *input, 	///< create contour for this image
-		float threshold		///<  image at this threshold
-);
-
 /*** various image geometry manipulation ***/
 /// Rebin image to new scale.
@@ -125,5 +127,5 @@
 psImageRebin (psImage *input, 		///< rebin this image
 	      float scale, 		///< rebinning scale: doutput = scale*dinput
-	      enum statmode		///< statistic used in performing interpolation / summing
+	      psStatMode statmode	///< statistic used in performing interpolation / summing
 );
 
@@ -155,16 +157,16 @@
 /// How to represent the output values?
 void
-psImageGetStats (psImage *input, enum statmode);
+psImageGetStats (psImage *input, psStatMode statmode);
 
 /// Construct a histogram from an image (or subimage).
 psHistogram *
-psImageHistogram (psHistogram,		///< input histogram description & target
-		  psImage *input,	///< determine histogram of this image
-);
+psImageHistogram (psHistogram *hist,	///< input histogram description & target
+		  psImage *input	///< determine histogram of this image
+    );
 
 /// Fit a 2-D polynomial surface to an image.
 psFloatArrayArray *
 psImageFitPolynomial (psImage *input, 	///< image to fit
-		      int xorder	///< order of polynomial in x-dir
+		      int xorder,	///< order of polynomial in x-dir
 		      int yorder	///< order of polynomial in y-dir
 );
@@ -207,22 +209,22 @@
 /// Write an image section to named file (which may exist).
 psImage *
-psImageFWriteSection (psImage *input,	///< image to write out
-		      int x, 		///< starting x coord of region		   
-		      int y, 		///< starting y coord of region		   
-		      int z, 		///< plane of interest			   
-		      char *extname, 	///< MEF extension name			   
-		      FILE *f		///< file descriptor to write data to		   
+psImageFWriteSection(psImage *input,	///< image to write out
+		     int x, 		///< starting x coord of region		   
+		     int y, 		///< starting y coord of region		   
+		     int z, 		///< plane of interest			   
+		     char *extname, 	///< MEF extension name			   
+		     FILE *f		///< file descriptor to write data to		   
 );
 
 /// Read only header from image file.
-psMetadata *
-psImageReadHeader (psMetadata *output, 	///< read data to this structure
-		   char *extname, 	///< MEF extension name ("PHU" for primary header)
-		   char *filename	///< file to read from
+struct psMetadata *
+psImageReadHeader(struct psMetadata *output, 	///< read data to this structure
+		  char *extname, 	///< MEF extension name ("PHU" for primary header)
+		  char *filename	///< file to read from
 ); 
 
 /// Read only header from image file descriptor.
-psMetadata *
-psImageFReadHeader (psMetadata *output, 	///< read data to this structure
+struct psMetadata *
+psImageFReadHeader (struct psMetadata *output, ///< read data to this structure
 		   char *extname, 	///< MEF extension name ("PHU" for primary header)
 		   FILE *f		///< file descriptor to read from
@@ -233,5 +235,5 @@
 psImage *
 psImageFFT (psImage *input, 		///< image to FFT
-	    enum direction		///< FFT direction 
+	    int direction		///< FFT direction 
 );
 
