Index: trunk/psLib/src/imageops/psImagePixelExtract.c
===================================================================
--- trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 12431)
+++ trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 12741)
@@ -8,6 +8,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-03-14 00:39:50 $
+ *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-04-04 22:42:02 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -23,8 +23,8 @@
 #include "psMemory.h"
 #include "psVector.h"
+#include "psError.h"
+#include "psImage.h"
+#include "psImageInterpolate.h"
 #include "psImagePixelExtract.h"
-#include "psError.h"
-
-
 
 #define VECTOR_STORE_ROW_CASE(TYPE) \
@@ -679,4 +679,7 @@
     float dY = (endRow - startRow) / (float)(nSamples-1);
 
+    psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(mode, input, NULL, mask, maskVal,
+                                                                       0, 0, 0, 0, 0);
+
     #define LINEAR_CUT_CASE(TYPE) \
 case PS_TYPE_##TYPE: { \
@@ -692,5 +695,12 @@
                 cutRowsData[i] = y; \
             } \
-            outData[i] = psImagePixelInterpolate(input,x,y,mask,maskVal,0,mode); \
+            double value; \
+            if (!psImageInterpolate(&value, NULL, NULL, x, y, interp)) { \
+                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); \
+                psFree(interp); \
+                psFree(out); \
+                return NULL; \
+            } \
+            outData[i] = value; \
         } \
     } \
@@ -709,15 +719,17 @@
         LINEAR_CUT_CASE(F32);
         LINEAR_CUT_CASE(F64);
-
-    default: {
-            char* typeStr;
-            PS_TYPE_NAME(typeStr,input->type.type);
-            psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                    _("Specified psImage type, %s, is not supported."),
-                    typeStr);
-            psFree(out);
-            out = NULL;
-        }
-    }
+      default: {
+          char* typeStr;
+          PS_TYPE_NAME(typeStr,input->type.type);
+          psError(PS_ERR_BAD_PARAMETER_TYPE, true,
+                  _("Specified psImage type, %s, is not supported."),
+                  typeStr);
+          psFree(interp);
+          psFree(out);
+          out = NULL;
+      }
+    }
+
+    psFree(interp);
 
     return out;
