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