Index: trunk/stac/src/stacRejection.c
===================================================================
--- trunk/stac/src/stacRejection.c	(revision 12511)
+++ trunk/stac/src/stacRejection.c	(revision 12744)
@@ -111,4 +111,8 @@
 #endif
 
+        psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR,
+                                                                           reject, NULL, NULL, 0, 0.0, 0.0,
+                                                                           0, 0, 0.0);
+
         // Transform the mask
         // Optimisation option is to only transform the pixels that have been rejected in the output,
@@ -125,6 +129,14 @@
                     inCoords->y = (double)y + 0.5;
                     (void)psPlaneTransformApply(outCoords, map, inCoords);
-                    float maskVal = (float)psImagePixelInterpolate(reject, outCoords->x, outCoords->y,
-                                                                   NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR);
+                    double maskVal;
+                    if (!psImageInterpolate(&maskVal, NULL, NULL, outCoords->x, outCoords->y, interp)) {
+                        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
+                        psFree(grads);
+                        psFree(gradsMask);
+                        psFree(inCoords);
+                        psFree(outCoords);
+                        return NULL;
+                    }
+
 #ifdef TESTING
                     rejmap->data.F32[y][x] = maskVal;
Index: trunk/stac/src/stacTransform.c
===================================================================
--- trunk/stac/src/stacTransform.c	(revision 12511)
+++ trunk/stac/src/stacTransform.c	(revision 12744)
@@ -193,4 +193,8 @@
         }
 
+        psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR,
+                                                                           image, error, mask, 1, NAN, NAN,
+                                                                           1, 0, 0.0);
+
         // Iterate over the output image pixels
         for (int y = 0; y < outny; y++) {
@@ -204,13 +208,18 @@
 
                     // Change PS_INTERPOLATE_BILINEAR to best available technique.
-                    outImage->data.F32[y][x] = (psF32)psImagePixelInterpolate(image, detector->x,
-                                                                              detector->y, mask, 1, NAN,
-                                                                              PS_INTERPOLATE_BILINEAR);
+                    double imageValue, varianceValue;
+                    if (!psImageInterpolate(&imageValue, &varianceValue, NULL,
+                                            detector->x, detector->y, interp)) {
+                        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
+                        psFree(interp);
+                        psFree(detector);
+                        psFree(sky);
+                        return false;
+                    }
+                    outImage->data.F32[y][x] = imageValue;
+
                     if (error) {
                         // Error is actually the variance
-                        outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error,
-                                                                                                detector->x,
-                                                                                                detector->y,
-                                                                                                mask, 1, NAN);
+                        outError->data.F32[y][x] = varianceValue;
                     }
 
@@ -224,4 +233,5 @@
             }
         } // Iterating over output pixels
+        psFree(interp);
 
     } // Iterating over images
