Index: trunk/psLib/src/imageops/psImagePixelExtract.c
===================================================================
--- trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 7125)
+++ 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);
     }
 
