Index: trunk/magic/remove/src/streaksremove.c
===================================================================
--- trunk/magic/remove/src/streaksremove.c	(revision 26407)
+++ trunk/magic/remove/src/streaksremove.c	(revision 26408)
@@ -34,8 +34,4 @@
     }
 
-    // Values to set for masked pixels
-    psU32 maskStreak = 0;           // for the image and weight (usually NAN, MAXINT for integer images)
-    psU32 maskMask = 0;             // value looked up for MASK.STREAK
-
     psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS");
 
@@ -118,7 +114,5 @@
 
         // now that we've read the input files, lookup the mask values
-        if (maskStreak == 0) {
-            strkGetMaskValues(sfiles, &maskStreak, &maskMask);
-        }
+        strkGetMaskValues(sfiles);
 
         totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols;
@@ -142,5 +136,5 @@
                     // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel
                     // is excised as part of the destreaking process)
-                    exciseNonWarpedPixels(sfiles, maskStreak);
+                    exciseNonWarpedPixels(sfiles, sfiles->maskStreak);
 
                     psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED"));
@@ -149,5 +143,5 @@
                 psTimerStart("REMOVE_STREAKS");
 
-                totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, maskStreak);
+                totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, sfiles->maskStreak);
 
                 psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));
@@ -155,5 +149,5 @@
                 if (nanForRelease) {
                     // set any pixels that were masked, to NAN (unless they are already NAN)
-                    setMaskedToNAN(sfiles, maskMask, true);
+                    setMaskedToNAN(sfiles, sfiles->maskMask, true);
                 }
 
@@ -173,5 +167,5 @@
         }
 
-        censorSources(sfiles, maskStreak);
+        censorSources(sfiles, sfiles->maskStreak);
 
         // write the destreaked "temporary" images and the recovery images
@@ -512,4 +506,14 @@
 }
 
+static void 
+setStreakBits(psImage *maskImage, psU32 maskStreak)
+{
+    for (int y=0 ; y < maskImage->numRows; y++) {
+        for (int x=0 ; x < maskImage->numCols; x++) {
+            maskImage->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskStreak;
+        }
+    }
+}
+
 // set the image for the output files to the contents of the corresponding input file.
 static bool
@@ -582,4 +586,9 @@
             // Note: we don't excise the mask pixels even if exciseAll is true.
             setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, false);
+            if (exciseAll) {
+                strkGetMaskValues(sf);
+                
+                setStreakBits(sf->inMask->image, sf->maskStreak);
+            }
             if (sf->outChMask) {
                 sf->outChMask->header = (psMetadata *) psMemIncrRefCounter(sf->outMask->header);
