Index: trunk/psModules/src/imcombine/pmStackReject.c
===================================================================
--- trunk/psModules/src/imcombine/pmStackReject.c	(revision 20571)
+++ trunk/psModules/src/imcombine/pmStackReject.c	(revision 20633)
@@ -245,4 +245,18 @@
     psImage *source = psPixelsToMask(NULL, bad, psRegionSet(0, numCols - 1, 0, numRows - 1),
                                      PM_STACK_MASK_BAD); // Mask image to grow
+
+#ifdef TESTING
+    {
+        static int seqNum = 0;          // Sequence number
+        psString name = NULL;           // Name of image
+        psStringAppend(&name, "reject_orig_%02d.fits", seqNum);
+        seqNum++;
+        psFits *fits = psFitsOpen(name, "w"); // FITS file pointer
+        psFree(name);
+        psFitsWriteImage(fits, NULL, source, 0, NULL);
+        psFitsClose(fits);
+    }
+#endif
+
     psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_MASK); // Grown image
     psImageInit(target, 0);
@@ -316,4 +330,17 @@
     }
 
+#ifdef TESTING
+    {
+        static int seqNum = 0;          // Sequence number
+        psString name = NULL;           // Name of image
+        psStringAppend(&name, "reject_grow_%02d.fits", seqNum);
+        seqNum++;
+        psFits *fits = psFitsOpen(name, "w"); // FITS file pointer
+        psFree(name);
+        psFitsWriteImage(fits, NULL, target, 0, NULL);
+        psFitsClose(fits);
+    }
+#endif
+
     psFree(source);
     bad = psPixelsFromMask(bad, target, PM_STACK_MASK_ALL);
