Index: trunk/psLib/src/imageops/psImageGeomManip.c
===================================================================
--- trunk/psLib/src/imageops/psImageGeomManip.c	(revision 7985)
+++ trunk/psLib/src/imageops/psImageGeomManip.c	(revision 7999)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-30 02:20:06 $
+ *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-07-28 00:44:05 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -48,5 +48,4 @@
     psMaskType* maskData = NULL;
     psStats* myStats;
-    double statVal;
 
     if (in == NULL) {
@@ -72,5 +71,6 @@
     }
 
-    if (p_psGetStatValue(stats, &statVal) == false) {
+    psStatsOptions statistic = psStatsSingleOption(stats->options); // Statistics option to use
+    if (statistic == 0) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 PS_ERRORTEXT_psImage_BAD_STAT,
@@ -108,19 +108,19 @@
     out = psImageRecycle(out, outCols, outRows, in->type.type);
 
-    #define PS_IMAGE_REBIN_CASE(type) \
-case PS_TYPE_##type: { \
-        ps##type* outRowData; \
-        ps##type* vecData = vec->data.type; \
-        psMaskType* inRowMask = NULL; \
+    #define PS_IMAGE_REBIN_CASE(TYPE) \
+case PS_TYPE_##TYPE: { \
+        ps##TYPE *outRowData; \
+        ps##TYPE *vecData = vec->data.TYPE; \
+        psMaskType *inRowMask = NULL; \
         for (psS32 row = 0; row < outRows; row++) { \
-            outRowData = out->data.type[row]; \
-            psS32 inCurrentRow = row*scale; \
-            psS32 inNextRow = (row+1)*scale; \
+            outRowData = out->data.TYPE[row]; \
+            psS32 inCurrentRow = row * scale; \
+            psS32 inNextRow = (row + 1) * scale; \
             for (psS32 col = 0; col < outCols; col++) { \
-                psS32 inCurrentCol = col*scale; \
-                psS32 inNextCol = (col+1)*scale; \
+                psS32 inCurrentCol = col * scale; \
+                psS32 inNextCol = (col + 1) * scale; \
                 psS32 n = 0; \
                 for (psS32 inRow = inCurrentRow; inRow < inNextRow && inRow < inRows; inRow++) { \
-                    ps##type* inRowData = in->data.type[inRow]; \
+                    ps##TYPE* inRowData = in->data.TYPE[inRow]; \
                     if (mask != NULL) { \
                         inRowMask = mask->data.PS_TYPE_MASK_DATA[inRow]; \
@@ -134,7 +134,6 @@
                 } \
                 vec->n = n; \
-                myStats = psVectorStats(myStats,vec,NULL,maskVec,maskVal); \
-                p_psGetStatValue(myStats,&statVal); \
-                outRowData[col] = (ps##type)statVal; \
+                myStats = psVectorStats(myStats, vec, NULL, maskVec, maskVal); \
+                outRowData[col] = (ps##TYPE)psStatsGetValue(myStats, statistic); \
             } \
         } \
Index: trunk/psLib/src/imageops/psImagePixelExtract.c
===================================================================
--- trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 7985)
+++ trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 7999)
@@ -8,6 +8,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-16 23:12:20 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-07-28 00:44:05 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -210,5 +210,4 @@
                        const psStats* stats)
 {
-    double statVal;
     psStats* myStats;
     psElemType type;
@@ -375,7 +374,7 @@
     }
 
-    // verify that the stats struct specifies a
-    // single stats operation
-    if (p_psGetStatValue(stats, &statVal) == false) {
+    // verify that the stats struct specifies a single stats operation
+    psStatsOptions statistic = psStatsSingleOption(stats->options);
+    if (statistic == 0) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
                 PS_ERRORTEXT_psImage_BAD_STAT,stats->options);
@@ -439,6 +438,5 @@
                 } \
                 myStats = psVectorStats(myStats,imgVec,NULL,maskVec,maskVal); \
-                (void)p_psGetStatValue(myStats,&statVal); \
-                *outData = statVal; \
+                *outData = psStatsGetValue(myStats, statistic); \
                 if (outPosition != NULL) { \
                     outPosition->x = c; \
@@ -520,6 +518,5 @@
             }
             myStats = psVectorStats(myStats, imgVec, NULL, maskVec, maskVal);
-            (void)p_psGetStatValue(myStats, &statVal);  // we know it works cause we tested it above
-            *outData = statVal;
+            *outData = psStatsGetValue(myStats, statistic);
             if (outPosition != NULL) {
                 outPosition->y = r;
@@ -741,6 +738,4 @@
                            const psStats* stats)
 {
-    double statVal;
-
     /* check the parameters */
 
@@ -808,7 +803,7 @@
     }
 
-    // verify that the stats struct specifies a
-    // single stats operation
-    if (p_psGetStatValue(stats, &statVal) == false) {
+    // verify that the stats struct specifies a single stats operation
+    psStatsOptions statistic = psStatsSingleOption(stats->options);
+    if (statistic == 0) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
                 PS_ERRORTEXT_psImage_BAD_STAT,
@@ -914,6 +909,5 @@
     for (psS32 r = 0; r < numOut; r++) {
         myStats = psVectorStats(myStats,buffer[r], NULL, bufferMask[r],maskVal);
-        (void)p_psGetStatValue(myStats,&statVal);
-        outData[r] = statVal;
+        outData[r] = psStatsGetValue(myStats, statistic);
     }
 
