Index: trunk/magic/remove/src/streaksio.c
===================================================================
--- trunk/magic/remove/src/streaksio.c	(revision 23911)
+++ trunk/magic/remove/src/streaksio.c	(revision 23936)
@@ -968,5 +968,5 @@
 
 void
-setMaskedToNAN(streakFiles *sfiles, psU8 maskMask, bool printCounts)
+setMaskedToNAN(streakFiles *sfiles, psU32 maskMask, bool printCounts)
 {
         int maskedPixels = 0;
@@ -991,5 +991,5 @@
                 // but I want to get the counts
                 double imageVal  = psImageGet(image, x, y);
-                psU8 maskVal;
+                psU32 maskVal;
                 if (sfiles->stage == IPP_STAGE_RAW) {
                     int xChip, yChip;
@@ -1044,2 +1044,36 @@
     }
 }
+
+void
+strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask)
+{
+    if (sfiles->inMask->header) {
+        if (!pmConfigMaskReadHeader(sfiles->config, sfiles->inMask->header)) {
+            streaksExit("failed to read mask values from file", PS_EXIT_CONFIG_ERROR);
+        }
+    }
+
+    bool status;
+    psMetadata *masks = psMetadataLookupMetadata(&status, sfiles->config->recipes, "MASKS");
+    if (!status) {
+        psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n");
+        streaksExit("", PS_EXIT_CONFIG_ERROR);
+    }
+    *maskStreak = psMetadataLookupU32(&status, masks, "STREAK");
+    if (!status) {
+        psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n");
+        streaksExit("", PS_EXIT_CONFIG_ERROR);
+    }
+
+    // optionally setting pixels with any mask bits execpt CONV.POOR to NAN
+    // check old name first
+    psU32 convPoor = (double) psMetadataLookupU32(&status, masks, "POOR.WARP");
+    if (!status) {
+        convPoor = (double) psMetadataLookupU32(&status, masks, "CONV.POOR");
+        if (!status) {
+            psError(PM_ERR_CONFIG, false, "failed to lookup mask value for CONV.POOR in recipes\n");
+            streaksExit("", PS_EXIT_CONFIG_ERROR);
+        }
+    }
+    *maskMask = ~convPoor;
+}
