Index: trunk/pswarp/src/pswarpTransformReadout.c
===================================================================
--- trunk/pswarp/src/pswarpTransformReadout.c	(revision 10954)
+++ trunk/pswarp/src/pswarpTransformReadout.c	(revision 10957)
@@ -35,45 +35,37 @@
 	for (int x = 0; x < outNx; x++) {
 	    // Only transform those pixels requested
-	    if (!region || (region && region->data.U8[y][x])) {
-		// Transform!
+	    if (region && region->data.U8[y][x]) continue;
 
-		// XXX double check this 1/2 pixel offset
-		outPix->x = (double)x + 0.5;
-		outPix->y = (double)y + 0.5;
+	    // XXX double check this 1/2 pixel offset
+	    outPix->x = (double)x + 0.5;
+	    outPix->y = (double)y + 0.5;
 
-		psPlaneTransformApply(FP, chipOutput->toFPA, outPix);
-		psPlaneTransformApply (TP, fpaOutput->toTPA, FP);
-		psDeproject (sky, TP, fpaOutput->toSky);
+	    psPlaneTransformApply(FP, chipOutput->toFPA, outPix);
+	    psPlaneTransformApply (TP, fpaOutput->toTPA, FP);
+	    psDeproject (sky, TP, fpaOutput->toSky);
 		
-		psProject (TP, sky, fpaInput->toSky);
-		psPlaneTransformApply (FP, fpaInput->fromTPA, TP);
-		psPlaneTransformApply (inPix, chipInput->fromFPA, FP);
+	    psProject (TP, sky, fpaInput->toSky);
+	    psPlaneTransformApply (FP, fpaInput->fromTPA, TP);
+	    psPlaneTransformApply (inPix, chipInput->fromFPA, FP);
 
-		// XXX get interpolation method from the recipe
-		outData[y][x] = (psF32)psImagePixelInterpolate(inImage, inPix->x, inPix->y, NULL, 1, NAN, PS_INTERPOLATE_BILINEAR);
-		// modify zero and scale?
-
-		// outData[y][x] = (psF32)psImagePixelInterpolate(inImage, inPix->x, inPix->y, mask, 1, NAN, PS_INTERPOLATE_BILINEAR);
-		
-# if (0)
-		if (error) {
-		    // Error is actually the variance
-		    outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error,
-											    detector->x,
-											    detector->y,
-											    mask, 1, NAN);
-		}
-		if (error) {
-		    outError->data.F32[y][x] = outError->data.F32[y][x] / SQUARE(scale);
-		}
-# endif
-
-	    } // Pixels of interest
-
+	    // XXX get interpolation method from the recipe
+	    outData[y][x] = (psF32)psImagePixelInterpolate(inImage, inPix->x, inPix->y, NULL, 1, NAN, PS_INTERPOLATE_BILINEAR);
+	    // outData[y][x] = (psF32)psImagePixelInterpolate(inImage, inPix->x, inPix->y, mask, 1, NAN, PS_INTERPOLATE_BILINEAR);
+	    // modify zero and scale?
 	}
-    } // Iterating over output pixels
-
+    }
     return true;
 }
 
-    
+# if (0)
+	    if (error) {
+		// Error is actually the variance
+		outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error,
+											detector->x,
+											detector->y,
+											mask, 1, NAN);
+	    }
+	    if (error) {
+		outError->data.F32[y][x] = outError->data.F32[y][x] / SQUARE(scale);
+	    }
+# endif
