Index: branches/tap_branches/ppImage/src/ppImage.h
===================================================================
--- branches/tap_branches/ppImage/src/ppImage.h	(revision 25900)
+++ branches/tap_branches/ppImage/src/ppImage.h	(revision 27838)
@@ -38,5 +38,6 @@
     bool doShutter;                     // Shutter correction
     bool doFlat;                        // Flat-field normalisation
-    bool doPattern;                     // Pattern noise subtraction
+    bool doPatternRow;                  // Row pattern correction
+    bool doPatternCell;                 // Cell pattern correction
     bool doFringe;                      // Fringe subtraction
     bool doPhotom;                      // Source identification and photometry
@@ -95,11 +96,13 @@
     float fringeKeep;                   // Fringe keep fraction
 
-    // Pattern noise subtraction
-    int patternOrder;                   // Polynomial order
-    int patternIter;                    // Clipping iterations
-    float patternRej;                   // Clipping threshold
-    float patternThresh;                // Ignore threshold
-    psStatsOptions patternMean;         // Statistic for mean
-    psStatsOptions patternStdev;        // Statistic for stdev
+    // Pattern correction
+    int patternRowOrder;                   // Polynomial order
+    int patternRowIter;                    // Clipping iterations
+    float patternRowRej;                   // Clipping threshold
+    float patternRowThresh;                // Ignore threshold
+    psStatsOptions patternRowMean;         // Statistic for mean
+    psStatsOptions patternRowStdev;        // Statistic for stdev
+    psStatsOptions patternCellBG;          // statistic for background
+    psStatsOptions patternCellMean;        // Statistic for mean
 
     int remnanceSize;                   // Size for remnance detection
@@ -159,4 +162,6 @@
 bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask);
 
+bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView, const ppImageOptions *options);
+
 // Record which detrend file was used for the detrending
 bool ppImageDetrendRecord(
