Index: /trunk/ppImage/src/ppImageRebinReadout.c
===================================================================
--- /trunk/ppImage/src/ppImageRebinReadout.c	(revision 18215)
+++ /trunk/ppImage/src/ppImageRebinReadout.c	(revision 18216)
@@ -87,4 +87,5 @@
             for (int yIn = yOut * dY; (yIn < yOut * dY + dY) && (yIn < nY); yIn ++) {
                 for (int xIn = xOut * dX; (xIn < xOut * dX + dX) && (xIn < nX); xIn ++) {
+		    if (input->mask && input->mask->data.U8[yIn][xIn]) continue;
                     value += input->image->data.F32[yIn][xIn];
                     nPix ++;
