Index: trunk/psModules/src/detrend/pmMaskBadPixels.c
===================================================================
--- trunk/psModules/src/detrend/pmMaskBadPixels.c	(revision 6873)
+++ trunk/psModules/src/detrend/pmMaskBadPixels.c	(revision 6910)
@@ -24,6 +24,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:10:08 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-19 20:37:35 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -148,8 +148,8 @@
             /* Pixels which satisfy growVal and within the grow radius shall be masked */                    \
             if(mask->data.PS_TYPE_MASK_DATA[j][i] & growVal) {                                               \
-                rowMin = MAX(j-grow, 0);                                                                     \
-                rowMax = MIN(j+grow+1, inImage->numRows);                                                    \
-                colMin = MAX(i-grow, 0);                                                                     \
-                colMax = MIN(i+grow+1, inImage->numCols);                                                    \
+                rowMin = PS_MAX(j-grow, 0);                                                                     \
+                rowMax = PS_MIN(j+grow+1, inImage->numRows);                                                    \
+                colMin = PS_MAX(i-grow, 0);                                                                     \
+                colMax = PS_MIN(i+grow+1, inImage->numCols);                                                    \
                 for(jj=rowMin; jj<rowMax; jj++) {                                                            \
                     for(ii=colMin; ii<colMax; ii++) {                                                        \
Index: trunk/psModules/src/detrend/pmMaskBadPixels.h
===================================================================
--- trunk/psModules/src/detrend/pmMaskBadPixels.h	(revision 6873)
+++ trunk/psModules/src/detrend/pmMaskBadPixels.h	(revision 6910)
@@ -24,6 +24,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:01:05 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-19 20:37:35 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -33,19 +33,27 @@
 #include "pmFPA.h"
 
+// these defines are necessary to yield 8-bit results (use instead of ~)
+# define NOT_U8(A)(UCHAR_MAX-(A))
+# define NOT_U16(A)(USHORT_MAX-(A))
+
 /** Mask values */
 typedef enum {
-    PM_MASK_TRAP    = 0x0001,   ///< The pixel is a charge trap.
-    PM_MASK_BADCOL  = 0x0002,   ///< The pixel is a bad column.
-    PM_MASK_SAT     = 0x0004,   ///< The pixel is saturated.
-    PM_MASK_BAD     = 0x0008,   ///< The pixel is low
-    PM_MASK_FLAT    = 0x0010    ///< The pixel is non-positive in the flat-field.
+    PM_MASK_CLEAR   = 0x00,   ///< The pixel is a charge trap.
+    PM_MASK_TRAP    = 0x01,   ///< The pixel is a charge trap.
+    PM_MASK_BADCOL  = 0x02,   ///< The pixel is a bad column.
+    PM_MASK_SAT     = 0x04,   ///< The pixel is saturated.
+    PM_MASK_BAD     = 0x08,   ///< The pixel is low
+    PM_MASK_FLAT    = 0x10,   ///< The pixel is non-positive in the flat-field.
+    PM_MASK_MARK    = 0x20,   ///< The pixel is marked as temporarily ignored
+    PM_MASK_EXT1    = 0x40,   ///< This mask value is not used
+    PM_MASK_EXT2    = 0x80,   ///< This mask value is not used
 } pmMaskValue;
 
-/** Macro to find maximum of two numbers */
-#define MAX(A,B)((A)>=(B)?(A):(B))
-
-/** Macro to find minimum of two numbers */
-#define MIN(A,B)((A)<=(B)?(A):(B))
-
+bool pmReadoutSetMask(pmReadout *readout // Readout for which to set mask
+                     );
+bool pmReadoutSetWeight(pmReadout *readout // Readout for which to set weight
+                       );
+bool pmCellSetMaskWeight(pmCell *cell // Cell for which to set weights
+                        );
 
 /** Execute bad pixels module.
