Index: /trunk/psLib/psLib.kdevelop
===================================================================
--- /trunk/psLib/psLib.kdevelop	(revision 1291)
+++ /trunk/psLib/psLib.kdevelop	(revision 1292)
@@ -24,5 +24,5 @@
     </run>
     <general>
-      <activedir>src/dataManip</activedir>
+      <activedir>src/image</activedir>
     </general>
     <build>
@@ -135,6 +135,6 @@
     <tree>
       <hidepatterns>*.o,*.lo,CVS</hidepatterns>
-      <hidenonprojectfiles>false</hidenonprojectfiles>
-      <showvcsfields>false</showvcsfields>
+      <hidenonprojectfiles>true</hidenonprojectfiles>
+      <showvcsfields>true</showvcsfields>
     </tree>
   </kdevfileview>
Index: /trunk/psLib/psLib.kdevses
===================================================================
--- /trunk/psLib/psLib.kdevses	(revision 1291)
+++ /trunk/psLib/psLib.kdevses	(revision 1292)
@@ -2,10 +2,35 @@
 <!DOCTYPE KDevPrjSession>
 <KDevPrjSession>
- <DocsAndViews NumberOfDocuments="1" >
-  <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psImage.c" >
-   <View0 line="295" Type="???" >
-    <AdditionalSettings Top="2" Width="1286" Attach="1" Height="964" Left="2" MinMaxMode="0" />
+ <DocsAndViews NumberOfDocuments="6" >
+  <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageExtraction.c" >
+   <View0 line="265" Type="???" >
+    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
    </View0>
   </Doc0>
+  <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageExtraction.h" >
+   <View0 line="75" Type="???" >
+    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
+   </View0>
+  </Doc1>
+  <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psVector.h" >
+   <View0 line="0" Type="???" >
+    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
+   </View0>
+  </Doc2>
+  <Doc3 NumberOfViews="1" URL="file:/home/desonia/psLib/src/dataManip/psStats.h" >
+   <View0 line="0" Type="???" >
+    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
+   </View0>
+  </Doc3>
+  <Doc4 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageManip.c" >
+   <View0 line="373" Type="???" >
+    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
+   </View0>
+  </Doc4>
+  <Doc5 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psType.h" >
+   <View0 line="119" Type="???" >
+    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
+   </View0>
+  </Doc5>
  </DocsAndViews>
  <pluginList>
Index: /trunk/psLib/src/dataManip/psFFT.d
===================================================================
--- /trunk/psLib/src/dataManip/psFFT.d	(revision 1291)
+++ /trunk/psLib/src/dataManip/psFFT.d	(revision 1292)
@@ -1,3 +1,3 @@
 psFFT.o psFFT.d : psFFT.c psFFT.h ../image/psImage.h ../collections/psType.h \
   ../collections/psVector.h ../sysUtils/psError.h ../sysUtils/psMemory.h \
-  ../sysUtils/psLogMsg.h ../image/psImageExtraction.h
+  ../sysUtils/psLogMsg.h ../image/psImageExtraction.h psStats.h
Index: /trunk/psLib/src/dataManip/psStats.c
===================================================================
--- /trunk/psLib/src/dataManip/psStats.c	(revision 1291)
+++ /trunk/psLib/src/dataManip/psStats.c	(revision 1292)
@@ -1839,2 +1839,56 @@
     return(stats);
 }
+
+bool p_psGetStatValue(const psStats* stats, double* value)
+{
+
+    switch (stats->options &
+            ~ (PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) {
+    case PS_STAT_SAMPLE_MEAN:
+        *value = stats->sampleMean;
+        return true;
+
+    case PS_STAT_SAMPLE_MEDIAN:
+        *value = stats->sampleMedian;
+        return true;
+
+    case PS_STAT_SAMPLE_STDEV:
+        *value = stats->sampleStdev;
+        return true;
+
+    case PS_STAT_ROBUST_MEAN:
+        *value = stats->robustMean;
+        return true;
+
+    case PS_STAT_ROBUST_MEDIAN:
+        *value = stats->robustMedian;
+        return true;
+
+    case PS_STAT_ROBUST_MODE:
+        *value = stats->robustMode;
+        return true;
+
+    case PS_STAT_ROBUST_STDEV:
+        *value = stats->robustStdev;
+        return true;
+
+    case PS_STAT_CLIPPED_MEAN:
+        *value = stats->clippedMean;
+        return true;
+
+    case PS_STAT_CLIPPED_STDEV:
+        *value = stats->clippedStdev;
+        return true;
+
+    case PS_STAT_MAX:
+        *value = stats->max;
+        return true;
+
+    case PS_STAT_MIN:
+        *value = stats->min;
+        return true;
+
+    default:
+        return false;
+    }
+}
Index: /trunk/psLib/src/dataManip/psStats.h
===================================================================
--- /trunk/psLib/src/dataManip/psStats.h	(revision 1291)
+++ /trunk/psLib/src/dataManip/psStats.h	(revision 1292)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-23 00:06:40 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -119,4 +119,8 @@
                                 int maskVal);       ///< Mask value
 
+bool p_psGetStatValue(
+    const psStats* stats,
+    double* value
+);
 
 /// @}
Index: /trunk/psLib/src/image/psImageExtraction.c
===================================================================
--- /trunk/psLib/src/image/psImageExtraction.c	(revision 1291)
+++ /trunk/psLib/src/image/psImageExtraction.c	(revision 1292)
@@ -9,6 +9,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-22 20:48:44 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -99,4 +99,5 @@
     if (input == NULL || input->data.V == NULL) {
         psError(__func__,"Can not copy image because input image or its pixel buffer is NULL.");
+        psFree(output);
         return NULL;
     }
@@ -105,4 +106,5 @@
         psError(__func__,"Can not copy image because given input and output "
                 "parameter reference the same psImage struct.");
+        psFree(output);
         return NULL;
     }
@@ -110,4 +112,5 @@
     if (input->type.dimen != PS_DIMEN_IMAGE) {
         psError(__func__,"Can not copy image because input image is not actually an image.");
+        psFree(output);
         return NULL;
     }
@@ -121,4 +124,5 @@
     if (inDatatype == PS_TYPE_PTR || type == PS_TYPE_PTR) {
         psError(__func__,"Can not copy image to/from a void* matrix");
+        psFree(output);
         return NULL;
     }
@@ -225,2 +229,172 @@
 }
 
+psVector* psImageSlice(psVector* out,
+                       const psImage* in,
+                       const psImage* restrict mask,
+                       unsigned int maskVal,
+                       unsigned int col,
+                       unsigned int row,
+                       unsigned int numCols,
+                       unsigned int numRows,
+                       psImageCutDirection direction,
+                       const psStats* stats)
+{
+    double statVal;
+    psStats* myStats;
+    psElemType type;
+    int inRows;
+    int inCols;
+    int delta = 1;
+    psF64* outData;
+
+    if (in == NULL || in->data.V == NULL) {
+        psError(__func__,"Input image can not be NULL.");
+        psFree(out);
+        return NULL;
+    }
+
+    type = in->type.type;
+    inRows = in->numRows;
+    inCols = in->numCols;
+
+    if (mask != NULL) {
+        if (inRows!=mask->numRows || inCols!=mask->numCols) {
+            psError(__func__,"The mask and image dimensions did not match (%dx%d vs %dx%d)",
+                    mask->numCols,mask->numRows,in->numCols,in->numRows);
+            psFree(out);
+        }
+        if (mask->type.type != PS_TYPE_MASK) {
+            psError(__func__,"The mask datatype (%d) must be %s.",
+                    mask->type.type, PS_TYPE_MASK_NAME);
+            psFree(out);
+        }
+    }
+
+    if (row >= inRows || col >= inCols ||
+            col+numCols > in->numCols || row+numRows > in->numRows) {
+        psError(__func__,"The specified image region (%d,%d to %d,%d) is outside of image area (0,0 to %d,%d).",
+                col, row, col+numCols-1, row+numRows-1, in->numCols-1, in->numRows-1);
+        psFree(out);
+        return NULL;
+    }
+
+    // verify that the stats struct specifies a single stats operation
+    if (p_psGetStatValue(stats,&statVal) == false) {
+        psError(__func__,"The stat options didn't specify a single supported statistic type.");
+        psFree(out);
+        return NULL;
+    }
+
+    // since stats input is const, I need to create a 'scratch' stats struct
+    myStats = psAlloc(sizeof(psStats));
+    *myStats = *stats;
+
+
+    if (direction == PS_CUT_X_NEG || direction == PS_CUT_Y_NEG) {
+        delta = -1;
+    }
+
+    if (direction == PS_CUT_X_POS || direction == PS_CUT_X_NEG) {
+        psVector* imgVec = psVectorAlloc(numRows,type);
+        psVector* maskVec = NULL;
+        psMaskType* maskData = NULL;
+
+        // recycle output to make a proper sized/type output structure
+        // n.b. type is double as that is the type given for all stats in psStats.
+        out = psVectorRecycle(out,numCols,PS_TYPE_F64);
+        outData = out->data.F64;
+        if (delta < 0) {
+            outData += numCols - 1;
+        }
+
+        if (mask != NULL) {
+            maskVec = psVectorAlloc(numRows,mask->type.type);
+        }
+
+        #define PSIMAGE_CUT_VERTICAL(TYPE) \
+    case PS_TYPE_##TYPE: { \
+            ps##TYPE *imgVecData = imgVec->data.TYPE; \
+            psMaskType* maskVecData = NULL; \
+            if (maskVec != NULL) { \
+                maskVecData = maskVec->data.V; \
+            } \
+            for (int c=0;c<numCols;c++) { \
+                ps##TYPE *imgData = in->data.TYPE[row] + col + c; \
+                if (maskVec != NULL) { \
+                    maskData = (psMaskType*)(mask->data.V[row]) + col + c; \
+                } \
+                for (int r=0;r<numRows;r++) { \
+                    *(imgVecData++) = *imgData; \
+                    imgData += inCols; \
+                    if (maskVecData != NULL) { \
+                        *(maskVecData++) = *maskData; \
+                        maskData += inCols; \
+                    } \
+                } \
+                myStats = psVectorStats(myStats,imgVec,maskVec,maskVal); \
+                (void)p_psGetStatValue(myStats,&statVal); \
+                *outData = statVal; \
+                outData += delta; \
+            } \
+            break; \
+        }
+
+        switch (type) {
+            PSIMAGE_CUT_VERTICAL(U8);
+            PSIMAGE_CUT_VERTICAL(U16);
+            PSIMAGE_CUT_VERTICAL(U32);
+            PSIMAGE_CUT_VERTICAL(U64);
+            PSIMAGE_CUT_VERTICAL(S8);
+            PSIMAGE_CUT_VERTICAL(S16);
+            PSIMAGE_CUT_VERTICAL(S32);
+            PSIMAGE_CUT_VERTICAL(S64);
+            PSIMAGE_CUT_VERTICAL(F32);
+            PSIMAGE_CUT_VERTICAL(F64);
+            PSIMAGE_CUT_VERTICAL(C32);
+            PSIMAGE_CUT_VERTICAL(C64);
+        default:
+            psError(__func__,"Unsupported datatype (%d)",type);
+            psFree(out);
+            out = NULL;
+        }
+        psFree(imgVec);
+        psFree(maskVec);
+    } else { // Cut in Y direction
+        psVector* imgVec = NULL;
+        psVector* maskVec = NULL;
+        int elementSize = PSELEMTYPE_SIZEOF(type);
+
+        // fill in psVectors to fake out the statistics functions.
+        imgVec = psAlloc(sizeof(psVector));
+        imgVec->type = in->type;
+        imgVec->n = imgVec->nalloc = numCols;
+        if (mask != NULL) {
+            maskVec = psAlloc(sizeof(psVector));
+            maskVec->type = mask->type;
+            maskVec->n = maskVec->nalloc = numCols;
+        }
+
+        // recycle output to make a proper sized/type output structure
+        // n.b. type is double as that is the type given for all stats in psStats.
+        out = psVectorRecycle(out,numRows,PS_TYPE_F64);
+        outData = out->data.F64;
+        if (delta < 0) {
+            outData += numCols - 1;
+        }
+
+        for (int r=0;r<numRows;r++) {
+            // point the vector struct to the data to calculate the stats
+            imgVec->data.V = (void*)(in->data.U8[row+r]+col*elementSize);
+            if (maskVec!=NULL) {
+                maskVec->data.V = (void*)(mask->data.U8[row+r]+col*sizeof(psMaskType));
+            }
+            myStats = psVectorStats(myStats,imgVec,maskVec,maskVal);
+            (void)p_psGetStatValue(myStats,&statVal); // we know it works cause we tested it above
+            *outData = statVal;
+            outData += delta;
+        }
+    }
+
+    return out;
+}
+
Index: /trunk/psLib/src/image/psImageExtraction.d
===================================================================
--- /trunk/psLib/src/image/psImageExtraction.d	(revision 1291)
+++ /trunk/psLib/src/image/psImageExtraction.d	(revision 1292)
@@ -1,3 +1,3 @@
 psImageExtraction.o psImageExtraction.d : psImageExtraction.c ../sysUtils/psMemory.h \
   psImageExtraction.h psImage.h ../collections/psType.h \
-  ../sysUtils/psError.h
+  ../collections/psVector.h ../dataManip/psStats.h ../sysUtils/psError.h
Index: /trunk/psLib/src/image/psImageExtraction.h
===================================================================
--- /trunk/psLib/src/image/psImageExtraction.h	(revision 1291)
+++ /trunk/psLib/src/image/psImageExtraction.h	(revision 1292)
@@ -9,6 +9,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-22 20:48:44 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,4 +19,16 @@
 
 #include "psImage.h"
+#include "psVector.h"
+#include "psStats.h"
+
+/// @addtogroup Image
+/// @{
+
+typedef enum {
+    PS_CUT_X_POS,
+    PS_CUT_X_NEG,
+    PS_CUT_Y_POS,
+    PS_CUT_Y_NEG,
+} psImageCutDirection;
 
 /** Create a subimage of the specified area.
@@ -54,4 +66,42 @@
 );
 
+psVector* psImageSlice(
+    psVector* out,
+    const psImage* input,
+    const psImage* restrict mask,
+    unsigned int maskVal,
+    unsigned int col,
+    unsigned int row,
+    unsigned int numCols,
+    unsigned int numRows,
+    psImageCutDirection direction,
+    const psStats* stats
+);
+
+psVector* psImageCut(
+    psVector* out,
+    const psImage* input,
+    const psImage* restrict mask,
+    unsigned int maskVal,
+    float startCol,
+    float startRow,
+    float endCol,
+    float endRow,
+    float width,
+    const psStats* stats
+);
+
+psVector* psImageRadialCut(
+    psVector* out,
+    const psImage* input,
+    const psImage* restrict mask,
+    unsigned int maskVal,
+    float centerCol,
+    float centerRow,
+    const psVector* radii,
+    const psStats* stats
+);
+
+/// @}
 
 #endif
Index: /trunk/psLib/src/image/psImageManip.c
===================================================================
--- /trunk/psLib/src/image/psImageManip.c	(revision 1291)
+++ /trunk/psLib/src/image/psImageManip.c	(revision 1292)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-22 20:42:22 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,6 +25,4 @@
 #include "psMemory.h"
 #include "psImageExtraction.h"
-
-bool getSpecifiedStatValue(const psStats* stats, double* value);
 
 int psImageClip(psImage* input, psF64 min, psF64 vmin, psF64 max, psF64 vmax)
@@ -337,58 +335,4 @@
 }
 
-bool getSpecifiedStatValue(const psStats* stats, double* value)
-{
-
-    switch (stats->options &
-            ~ (PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) {
-    case PS_STAT_SAMPLE_MEAN:
-        *value = stats->sampleMean;
-        return true;
-
-    case PS_STAT_SAMPLE_MEDIAN:
-        *value = stats->sampleMedian;
-        return true;
-
-    case PS_STAT_SAMPLE_STDEV:
-        *value = stats->sampleStdev;
-        return true;
-
-    case PS_STAT_ROBUST_MEAN:
-        *value = stats->robustMean;
-        return true;
-
-    case PS_STAT_ROBUST_MEDIAN:
-        *value = stats->robustMedian;
-        return true;
-
-    case PS_STAT_ROBUST_MODE:
-        *value = stats->robustMode;
-        return true;
-
-    case PS_STAT_ROBUST_STDEV:
-        *value = stats->robustStdev;
-        return true;
-
-    case PS_STAT_CLIPPED_MEAN:
-        *value = stats->clippedMean;
-        return true;
-
-    case PS_STAT_CLIPPED_STDEV:
-        *value = stats->clippedStdev;
-        return true;
-
-    case PS_STAT_MAX:
-        *value = stats->max;
-        return true;
-
-    case PS_STAT_MIN:
-        *value = stats->min;
-        return true;
-
-    default:
-        return false;
-    }
-}
-
 
 psImage* psImageRebin(psImage* out,const psImage* in,unsigned int scale,const psStats* stats)
@@ -420,5 +364,5 @@
     }
 
-    if (getSpecifiedStatValue(stats,&statVal) == false) {
+    if (p_psGetStatValue(stats,&statVal) == false) {
         psError(__func__,"The stat options didn't specify a single supported statistic type.");
         psFree(out);
@@ -457,5 +401,5 @@
                 vec->n = n; \
                 myStats = psVectorStats(myStats,vec,NULL,0); \
-                getSpecifiedStatValue(myStats,&statVal); \
+                p_psGetStatValue(myStats,&statVal); \
                 outRowData[col] = (ps##type)statVal; \
             } \
@@ -723,6 +667,4 @@
         float cosT = cosf(t);
         float sinT = sinf(t);
-        float cosNegT = cosf(-t);
-        float sinNegT = sinf(-t);
 
         // calculate the corners of the rotated image so we know the proper output image size.
@@ -730,43 +672,9 @@
         //    y' = y cos(t) - x sin(t);  i.e. y' = (y-centerY)*cosT - (x-centerX)*sinT;
 
-        #define rotateProjectX(x,y) (x-centerX)*cosNegT + (y-centerY)*sinNegT
-        #define rotateProjectY(x,y) (y-centerY)*cosNegT - (x-centerX)*sinNegT
-
-        // bottom-left, i.e., (0,0)
-        float xbl = rotateProjectX(0,0);
-        float ybl = rotateProjectY(0,0);
-        // bottom-right, i.e., (numCols,0)
-        float xbr = rotateProjectX(numCols,0);
-        float ybr = rotateProjectY(numCols,0);
-        // top-left, i.e., (0,numRows)
-        float xtl = rotateProjectX(0,numRows);
-        float ytl = rotateProjectY(0,numRows);
-        // top-right, i.e., (numCols,numRows)
-        float xtr = rotateProjectX(numCols,numRows);
-        float ytr = rotateProjectY(numCols,numRows);
-
-        float minX = xbl;
-        minX = (minX > xbr) ? xbr : minX;
-        minX = (minX > xtl) ? xtl : minX;
-        minX = (minX > xtr) ? xtr : minX;
-
-        float minY = ybl;
-        minY = (minY > ybr) ? ybr : minY;
-        minY = (minY > ytl) ? ytl : minY;
-        minY = (minY > ytr) ? ytr : minY;
-
-        float maxX = xbl;
-        maxX = (maxX < xbr) ? xbr : maxX;
-        maxX = (maxX < xtl) ? xtl : maxX;
-        maxX = (maxX < xtr) ? xtr : maxX;
-
-        float maxY = ybl;
-        maxY = (maxY < ybr) ? ybr : maxY;
-        maxY = (maxY < ytl) ? ytl : maxY;
-        maxY = (maxY < ytr) ? ytr : maxY;
-
-        int intMinY = minY;
-        int outRows = ceil(maxY-minY)+1;
-        int outCols = ceil(maxX-minX)+1;
+
+        int outCols = ceil(abs(numCols*cosT)+abs(numRows*sinT))+1;
+        int outRows = ceil(abs(numCols*sinT)+abs(numRows*cosT))+1;
+        float minX = (float)outCols/-2.0f;
+        int intMinY = outRows/-2;
 
         out = psImageRecycle(out,outCols,outRows,type);
Index: /trunk/psLib/src/image/psImageStats.h
===================================================================
--- /trunk/psLib/src/image/psImageStats.h	(revision 1291)
+++ /trunk/psLib/src/image/psImageStats.h	(revision 1292)
@@ -10,6 +10,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-22 20:09:04 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -49,6 +49,3 @@
                      );
 
-
-
-
 #endif
Index: /trunk/psLib/src/imageops/psImageStats.h
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.h	(revision 1291)
+++ /trunk/psLib/src/imageops/psImageStats.h	(revision 1292)
@@ -10,6 +10,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-22 20:09:04 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -49,6 +49,3 @@
                      );
 
-
-
-
 #endif
Index: /trunk/psLib/src/math/psStats.c
===================================================================
--- /trunk/psLib/src/math/psStats.c	(revision 1291)
+++ /trunk/psLib/src/math/psStats.c	(revision 1292)
@@ -1839,2 +1839,56 @@
     return(stats);
 }
+
+bool p_psGetStatValue(const psStats* stats, double* value)
+{
+
+    switch (stats->options &
+            ~ (PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) {
+    case PS_STAT_SAMPLE_MEAN:
+        *value = stats->sampleMean;
+        return true;
+
+    case PS_STAT_SAMPLE_MEDIAN:
+        *value = stats->sampleMedian;
+        return true;
+
+    case PS_STAT_SAMPLE_STDEV:
+        *value = stats->sampleStdev;
+        return true;
+
+    case PS_STAT_ROBUST_MEAN:
+        *value = stats->robustMean;
+        return true;
+
+    case PS_STAT_ROBUST_MEDIAN:
+        *value = stats->robustMedian;
+        return true;
+
+    case PS_STAT_ROBUST_MODE:
+        *value = stats->robustMode;
+        return true;
+
+    case PS_STAT_ROBUST_STDEV:
+        *value = stats->robustStdev;
+        return true;
+
+    case PS_STAT_CLIPPED_MEAN:
+        *value = stats->clippedMean;
+        return true;
+
+    case PS_STAT_CLIPPED_STDEV:
+        *value = stats->clippedStdev;
+        return true;
+
+    case PS_STAT_MAX:
+        *value = stats->max;
+        return true;
+
+    case PS_STAT_MIN:
+        *value = stats->min;
+        return true;
+
+    default:
+        return false;
+    }
+}
Index: /trunk/psLib/src/math/psStats.h
===================================================================
--- /trunk/psLib/src/math/psStats.h	(revision 1291)
+++ /trunk/psLib/src/math/psStats.h	(revision 1292)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-23 00:06:40 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -119,4 +119,8 @@
                                 int maskVal);       ///< Mask value
 
+bool p_psGetStatValue(
+    const psStats* stats,
+    double* value
+);
 
 /// @}
Index: /trunk/psLib/src/pslib.h
===================================================================
--- /trunk/psLib/src/pslib.h	(revision 1291)
+++ /trunk/psLib/src/pslib.h	(revision 1292)
@@ -8,6 +8,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-23 19:05:03 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -108,4 +108,5 @@
 
 #include "psImageManip.h"
+#include "psImageExtraction.h"
 
 #include "psFunctions.h"
Index: /trunk/psLib/src/sys/psType.h
===================================================================
--- /trunk/psLib/src/sys/psType.h	(revision 1291)
+++ /trunk/psLib/src/sys/psType.h	(revision 1292)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-15 19:58:37 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -69,4 +69,5 @@
 
 #define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
+#define PS_TYPE_MASK_NAME "psU8"
 typedef psU8 psMaskType;                ///< the C datatype for a mask image
 
Index: /trunk/psLib/src/sysUtils/psType.h
===================================================================
--- /trunk/psLib/src/sysUtils/psType.h	(revision 1291)
+++ /trunk/psLib/src/sysUtils/psType.h	(revision 1292)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-15 19:58:37 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-24 02:00:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -69,4 +69,5 @@
 
 #define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
+#define PS_TYPE_MASK_NAME "psU8"
 typedef psU8 psMaskType;                ///< the C datatype for a mask image
 
Index: /trunk/psLib/test/astronomy/builddir/tst_psTime_01.d
===================================================================
--- /trunk/psLib/test/astronomy/builddir/tst_psTime_01.d	(revision 1291)
+++ /trunk/psLib/test/astronomy/builddir/tst_psTime_01.d	(revision 1292)
@@ -3,10 +3,11 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psCompare.h ../../include/psVector.h \
-  ../../include/psHash.h ../../include/psScalar.h ../../include/psImage.h \
-  ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
+  ../../include/psCompare.h ../../include/psArray.h \
+  ../../include/psHash.h ../../include/psScalar.h \
+  ../../include/psVector.h ../../include/psImage.h \
+  ../../include/psBitSet.h ../../include/psStats.h \
   ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
   ../../include/psFFT.h ../../include/psImageIO.h \
-  ../../include/psImageManip.h ../../include/psFunctions.h \
-  ../../include/psMinimize.h ../../include/psTime.h \
-  ../../include/psTest.h
+  ../../include/psImageManip.h ../../include/psImageExtraction.h \
+  ../../include/psFunctions.h ../../include/psMinimize.h \
+  ../../include/psTime.h ../../include/psTest.h
Index: /trunk/psLib/test/image/tst_psImageStats03.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats03.c	(revision 1291)
+++ /trunk/psLib/test/image/tst_psImageStats03.c	(revision 1292)
@@ -46,5 +46,5 @@
             x = 0.2 + (float) i;
             y = 0.2 + (float) j;
-            pixel = psImagePixelInterpolation(tmpImage, x, y);
+            pixel = psImagePixelInterpolate(tmpImage, x, y,0,PS_INTERPOLATE_BILINEAR);
             printf("%.1f ", pixel);
         }
@@ -56,5 +56,5 @@
             x = 0.2 + (float) i;
             y = 0.2 + (float) j;
-            pixel = psImagePixelInterpolation(tmpImage, x, y);
+            pixel = psImagePixelInterpolate(tmpImage, x, y,0,PS_INTERPOLATE_BILINEAR);
             printf("image[%.1f][%.1f] is interpolated at %.1f\n", x, y, pixel);
         }
