Index: /trunk/psLib/src/imageops/psImageGeomManip.c
===================================================================
--- /trunk/psLib/src/imageops/psImageGeomManip.c	(revision 6749)
+++ /trunk/psLib/src/imageops/psImageGeomManip.c	(revision 6750)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-24 23:43:15 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-01 02:43:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -749,10 +749,17 @@
         col0 = region.x0;
         col1 = region.x1;
+        //If [0,0,0,0] specified, the whole image is to be included
+        if (row0 == 0 && col0 == 0 && row1 == 0 && col1 == 0) {
+            row0 = input->row0;
+            col0 = input->col0;
+            row1 = input->row0 + input->numRows;
+            col1 = input->col0 + input->numCols;
+        }
         if (col1 < 1) {
-            col1 += input->numCols;
+            col1 += input->col0 + input->numCols;
         }
 
         if (row1 < 1) {
-            row1 += input->numRows;
+            row1 += input->row0 + input->numRows;
         }
 
Index: /trunk/psLib/src/imageops/psImageGeomManip.h
===================================================================
--- /trunk/psLib/src/imageops/psImageGeomManip.h	(revision 6749)
+++ /trunk/psLib/src/imageops/psImageGeomManip.h	(revision 6750)
@@ -8,6 +8,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-08 01:03:35 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-01 02:43:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -150,8 +150,9 @@
     const psPlaneTransform *outToIn,   ///< the transform to apply
     psRegion region,                   ///< the size of the transformed image
-    const psPixels* pixels,            /**< if not NULL, consists of psPixelCoords and specifies which pixels in
-                                                                                 *  output image shall be transformed; otherwise, entire image generated*/
+    const psPixels* pixels,            /**< if not NULL, consists of psPixelCoords and specifies
+                                            * which pixels in output image shall be transformed;
+                                            * otherwise, entire image generated*/
     psImageInterpolateMode mode,       ///< the interpolation scheme to be used
-    double exposedValue                   ///< Exposed value to which non-corresponding pixels are set
+    double exposedValue                ///< Exposed value to which non-corresponding pixels are set
 );
 
Index: /trunk/psLib/src/imageops/psImagePixelExtract.c
===================================================================
--- /trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 6749)
+++ /trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 6750)
@@ -8,6 +8,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-03-17 20:38:19 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-01 02:43:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -57,15 +57,37 @@
         return NULL;
     }
-    PS_ASSERT_INT_NONNEGATIVE(input->col0, NULL);
-    PS_ASSERT_INT_NONNEGATIVE(input->row0, NULL);
-    PS_ASSERT_INT_POSITIVE(input->numCols, NULL);
-    PS_ASSERT_INT_POSITIVE(input->numRows, NULL);
+    if (input->col0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  col0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->row0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  row0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numCols < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numCols must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numRows < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numRows must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
     if (row >= (input->numRows + input->row0) ) {
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
                 "Specified row number is out of range for specified image.\n");
+        psFree(out);
         return NULL;
     } else if ( row < input->row0 && row >= 0 ) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 "Specified row number is out of range for specified image.\n");
+        psFree(out);
         return NULL;
     } else if ( row < 0 ) {
@@ -74,4 +96,5 @@
             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                     "Specified row number is out of range for specified image.\n");
+            psFree(out);
             return NULL;
         }
@@ -164,15 +187,37 @@
         return NULL;
     }
-    PS_ASSERT_INT_NONNEGATIVE(input->col0, NULL);
-    PS_ASSERT_INT_NONNEGATIVE(input->row0, NULL);
-    PS_ASSERT_INT_POSITIVE(input->numCols, NULL);
-    PS_ASSERT_INT_POSITIVE(input->numRows, NULL);
+    if (input->col0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  col0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->row0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  row0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numCols < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numCols must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numRows < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numRows must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
     if (column >= (input->numCols + input->col0) ) {
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
                 "Specified column number is out of range for specified image.\n");
+        psFree(out);
         return NULL;
     } else if ( column < input->col0 && column >= 0 ) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 "Specified column number is out of range for specified image.\n");
+        psFree(out);
         return NULL;
     } else if ( column < 0 ) {
@@ -181,4 +226,5 @@
             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                     "Specified column number is out of range for specified image.\n");
+            psFree(out);
             return NULL;
         }
@@ -263,17 +309,37 @@
         return NULL;
     }
-    PS_ASSERT_INT_NONNEGATIVE(input->col0, NULL);
-    PS_ASSERT_INT_NONNEGATIVE(input->row0, NULL);
-    PS_ASSERT_INT_POSITIVE(input->numCols, NULL);
-    PS_ASSERT_INT_POSITIVE(input->numRows, NULL);
+    if (input->col0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  col0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->row0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  row0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numCols < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numCols must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numRows < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numRows must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
     /*
         if (col1 < 1) {
             col1 += input->numCols;
         }
-     
+
         if (row1 < 1) {
             row1 += input->numRows;
         }
-     
+
         if (    col0 < 0 ||
                 row0 < 0 ||
@@ -296,5 +362,5 @@
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 "Specified psRegion parameter, x0=%f, is out of range [%d,%d].\n",
-                region.x0, input->col0, input->col0+input->numCols);
+                region.x0, input->col0, input->col0+input->numCols-1);
         return NULL;
     }
@@ -305,5 +371,5 @@
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 "Specified psRegion parameter, y0=%f, is out of range [%d,%d].\n",
-                region.y0, input->row0, input->row0+input->numRows);
+                region.y0, input->row0, input->row0+input->numRows-1);
         return NULL;
     }
@@ -315,5 +381,5 @@
             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                     "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n",
-                    region.x1, col1+input->col0, input->col0, input->col0+input->numCols);
+                    region.x1, col1+input->col0, input->col0, input->col0+input->numCols-1);
             return NULL;
         }
@@ -323,5 +389,5 @@
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n",
-                region.x1, col1, input->col0, input->col0+input->numCols);
+                region.x1, col1, input->col0, input->col0+input->numCols-1);
         return NULL;
     }
@@ -332,5 +398,5 @@
             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                     "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n",
-                    region.y1, row1+input->row0, input->row0, input->row0+input->numRows);
+                    region.y1, row1+input->row0, input->row0, input->row0+input->numRows-1);
             return NULL;
         }
@@ -340,5 +406,5 @@
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n",
-                region.y1, row1, input->row0, input->row0+input->numRows);
+                region.y1, row1, input->row0, input->row0+input->numRows-1);
         return NULL;
     }
@@ -583,8 +649,28 @@
         return NULL;
     }
-    //    PS_ASSERT_INT_NONNEGATIVE(input->col0, NULL);
-    //    PS_ASSERT_INT_NONNEGATIVE(input->row0, NULL);
-    //    PS_ASSERT_INT_POSITIVE(input->numCols, NULL);
-    //    PS_ASSERT_INT_POSITIVE(input->numRows, NULL);
+    if (input->col0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  col0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->row0 < 0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  row0 cannot be negative.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numCols < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numCols must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
+    if (input->numRows < 1) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "psImage input is invalid.  numRows must be greater than 0.\n");
+        psFree(out);
+        return NULL;
+    }
     psS32 numCols = input->numCols;
     psS32 numRows = input->numRows;
@@ -598,20 +684,115 @@
     }
 
-
-    float startCol = region.x0;
-    float startRow = region.y0;
-    float endCol = region.x1;
-    float endRow = region.y1;
-    if (startCol < 0 || startCol >= numCols ||
-            startRow < 0 || startRow >= numRows ||
-            endCol < 0 || endCol >= numCols ||
-            endRow < 0 || endRow >= numRows) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                PS_ERRORTEXT_psImage_LINE_NOT_IN_IMAGE,
-                startCol,startRow,endCol,endRow,
-                numCols-1,numRows-1);
-        psFree(out);
-        return NULL;
-    }
+    float col0 = region.x0;
+    float row0 = region.y0;
+    float col1 = region.x1;
+    float row1 = region.y1;
+
+    //Make sure x0 of region is inside image.  If so, set col0 to corresponding index number.
+    if (col0 >= input->col0 && col0 < (input->col0 + input->numCols) ) {
+        col0 -= input->col0;
+    } else {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Specified psRegion parameter, x0=%f, is out of range [%d,%d].\n",
+                region.x0, input->col0, input->col0+input->numCols);
+        psFree(out);
+        return NULL;
+    }
+    //Make sure y0 of region is inside image.  If so, set row0 to corresponding index number.
+    if (row0 >= input->row0 && row0 < (input->row0 + input->numRows) ) {
+        row0 -= input->row0;
+    } else {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Specified psRegion parameter, y0=%f, is out of range [%d,%d].\n",
+                region.y0, input->row0, input->row0+input->numRows);
+        psFree(out);
+        return NULL;
+    }
+    /*
+        //Make sure x1 of region is valid.  If negative, index from tail (if valid).
+        if (col1 < 0) {
+            col1 += input->numCols;
+            if (col1 < 0) {
+                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                        "Specified psRegion parameter, x1=%f=%f, is out of range [%d,%d].\n",
+                        region.x1, col1+input->col0, input->col0, input->col0+input->numCols);
+                psFree(out);
+                return NULL;
+            }
+        } else if (col1 >= input->col0 && col1 < (input->col0 + input->numCols) ) {
+            col1 -= input->col0;
+        } else {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Specified psRegion parameter, x1=%f=%f, is out of range [%d,%d].\n",
+                    region.x1, col1, input->col0, input->col0+input->numCols);
+            psFree(out);
+            return NULL;
+        }
+        //Make sure y1 of region is valid.  If negative, index from tail (if valid).
+        if (row1 < 0) {
+            row1 += input->numRows;
+            if (row1 < 0) {
+                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                        "Specified psRegion parameter, y1=%f=%f, is out of range [%d,%d].\n",
+                        region.y1, row1+input->row0, input->row0, input->row0+input->numRows);
+                psFree(out);
+                return NULL;
+            }
+        } else if (row1 >= input->row0 && row1 < (input->row0 + input->numRows) ) {
+            row1 -= input->row0;
+        } else {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Specified psRegion parameter, y1=%f=%f, is out of range [%d,%d].\n",
+                    region.y1, row1, input->row0, input->row0+input->numRows);
+            psFree(out);
+            return NULL;
+        }
+    */
+    /*    //Now make sure that the region makes sense.
+        if (col0 > col1 || row0 > row1) {
+            if (col0 > col1) {
+                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                        "Invalid psRegion specified.  x0=%f=%f is greater than x1=%f=%f.\n",
+                        region.x0, col0, region.x1, col1);
+            } else {
+                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                        "Invalid psRegion specified.  y0=%f=%f is greater than y1=%f=%f.\n",
+                        region.y0, row0, region.y1, row1);
+            }
+            psFree(out);
+            return NULL;
+        } else if (col0 == col1 && row0 == row1) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Invalid psRegion specified.  Region contains only 1 pixel.\n");
+            psFree(out);
+            return NULL;
+        }
+    */
+    if (col1 < 0 || row1 < 0 || col0 < 0 || row0 < 0 || col0 >= numCols || col1 >= numCols ||
+            row0 >= numRows || row1 >= numRows) {
+        psFree(out);
+        return NULL;
+    }
+    float startCol = col0;
+    float startRow = row0;
+    float endCol = col1;
+    float endRow = row1;
+    /*
+        float startCol = region.x0;
+        float startRow = region.y0;
+        float endCol = region.x1;
+        float endRow = region.y1;
+        if (startCol < 0 || startCol >= numCols ||
+                startRow < 0 || startRow >= numRows ||
+                endCol < 0 || endCol >= numCols ||
+                endRow < 0 || endRow >= numRows) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    PS_ERRORTEXT_psImage_LINE_NOT_IN_IMAGE,
+                    startCol,startRow,endCol,endRow,
+                    numCols-1,numRows-1);
+            psFree(out);
+            return NULL;
+        }
+    */
 
     if (mode < PS_INTERPOLATE_FLAT ) {
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 6749)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 6750)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.90 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-07 23:14:21 $
+ *  @version $Revision: 1.91 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-01 02:43:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -267,6 +267,8 @@
     // We scale the pixel positions to values
     // between -1.0 and 1.0
-    rScalingFactors = calcScaleFactors(input->numRows);
-    cScalingFactors = calcScaleFactors(input->numCols);
+    //    rScalingFactors = calcScaleFactors(input->numRows);
+    //    cScalingFactors = calcScaleFactors(input->numCols);
+    rScalingFactors = calcScaleFactors(input->row0 + input->numRows);
+    cScalingFactors = calcScaleFactors(input->col0 + input->numCols);
 
     // Determine how many Chebyshev polynomials
@@ -283,6 +285,8 @@
         for (j = 0; j < (1 + coeffs->nY); j++) {
             sums[i][j] = 0.0;
-            for (x = 0; x < input->numRows; x++) {
-                for (y = 0; y < input->numCols; y++) {
+            //            for (x = 0; x < input->numRows; x++) {
+            //                for (y = 0; y < input->numCols; y++) {
+            for (x = input->row0; x < (input->row0 + input->numRows); x++) {
+                for (y = input->col0; y < (input->col0 + input->numCols); y++) {
                     double pixel = 0.0;
                     if (input->type.type == PS_TYPE_S8) {
@@ -399,5 +403,6 @@
             //            nodes->data.F64[x][y] = psImagePixelInterpolate(input, yNode, xNode, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR);
             //            nodes->data.F64[x][y] = psImagePixelInterpolate(input, yTmp, xTmp, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR);
-            nodes->data.F64[x][y] = psImagePixelInterpolate(input, yOrig, xOrig, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR);
+            nodes->data.F64[x][y] = psImagePixelInterpolate(input, yOrig, xOrig, NULL,
+                                    0, 0.0, PS_INTERPOLATE_BILINEAR);
         }
     }
@@ -505,6 +510,8 @@
     // We scale the pixel positions to values between -1.0 and 1.0
     // Use static data structures here.
-    rScalingFactors = calcScaleFactors(input->numRows);
-    cScalingFactors = calcScaleFactors(input->numCols);
+    //    rScalingFactors = calcScaleFactors(input->numRows);
+    //    cScalingFactors = calcScaleFactors(input->numCols);
+    rScalingFactors = calcScaleFactors(input->numRows+input->row0);
+    cScalingFactors = calcScaleFactors(input->numCols+input->col0);
 
     // Determine how many Chebyshev polynomials
@@ -517,6 +524,8 @@
     chebPolys = p_psCreateChebyshevPolys(maxChebyPoly + 1);
 
-    for (x = 0; x < input->numRows; x++) {
-        for (y = 0; y < input->numCols; y++) {
+    //    for (x = 0; x < input->numRows; x++) {
+    //        for (y = 0; y < input->numCols; y++) {
+    for (x = input->row0; x < (input->row0 + input->numRows); x++) {
+        for (y = input->col0; y < (input->col0 + input->numCols); y++) {
             polySum = 0.0;
             for (i = 0; i < (1 + coeffs->nX); i++) {
@@ -563,11 +572,15 @@
         for (int col = 0; col < input->numCols ; col++) {
             if (input->type.type == PS_TYPE_S8) {
-                input->data.S8[row][col] = (psS8) psPolynomial2DEval(coeffs, (psF32) row, (psF32) col);
+                input->data.S8[row][col] = (psS8) psPolynomial2DEval(coeffs,
+                                           (psF32) (row + input->row0), (psF32) (col + input->col0));
             } else if (input->type.type == PS_TYPE_U16) {
-                input->data.U16[row][col] = (psS16) psPolynomial2DEval(coeffs, (psF32) row, (psF32) col);
+                input->data.U16[row][col] = (psS16) psPolynomial2DEval(coeffs,
+                                            (psF32) (row + input->row0), (psF32) (col + input->col0));
             } else if (input->type.type == PS_TYPE_F32) {
-                input->data.F32[row][col] = psPolynomial2DEval(coeffs, (psF32) row, (psF32) col);
+                input->data.F32[row][col] = psPolynomial2DEval(coeffs,
+                                            (psF32) (row + input->row0), (psF32) (col + input->col0));
             } else if (input->type.type == PS_TYPE_F64) {
-                input->data.F64[row][col] = (psF64) psPolynomial2DEval(coeffs, (psF32) row, (psF32) col);
+                input->data.F64[row][col] = (psF64) psPolynomial2DEval(coeffs,
+                                            (psF32) (row + input->row0), (psF32) (col + input->col0));
             }
         }
@@ -617,9 +630,4 @@
     int y1 = 0;
     psElemType type;
-    if (mask == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                PS_ERRORTEXT_psImage_IMAGE_NULL);
-        return -1;
-    }
 
     // this is not a valid error: a psRegion with ranges outside the valid pixels
@@ -641,16 +649,117 @@
 
     // rationalize the region
-    region = psRegionForImage(mask, region);
-
-    if (region.x0 == region.x1 || region.y0 == region.y1) {
-        psError(PS_ERR_BAD_PARAMETER_SIZE, true,
-                "psRegion input contains 0 pixels\n");
+
+    /*
+        if (mask == NULL) {
+            psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                    PS_ERRORTEXT_psImage_IMAGE_NULL);
+            return -1;
+        }
+        region = psRegionForImage(mask, region);
+     
+        if (region.x0 == region.x1 || region.y0 == region.y1) {
+            psError(PS_ERR_BAD_PARAMETER_SIZE, true,
+                    "psRegion input contains 0 pixels\n");
+            return -1;
+        }
+    */
+    PS_ASSERT_IMAGE_NON_NULL(mask, -1);
+    PS_ASSERT_INT_NONNEGATIVE(mask->col0, -1);
+    PS_ASSERT_INT_NONNEGATIVE(mask->row0, -1);
+    PS_ASSERT_INT_POSITIVE(mask->numCols, -1);
+    PS_ASSERT_INT_POSITIVE(mask->numRows, -1);
+
+    /*    x0 = (int)(roundf(region.x0));
+        x1 = (int)(roundf(region.x1));
+        y0 = (int)(roundf(region.y0));
+        y1 = (int)(roundf(region.y1));
+    */
+    int col0 = (int)(roundf(region.x0));
+    int col1 = (int)(roundf(region.x1));
+    int row0 = (int)(roundf(region.y0));
+    int row1 = (int)(roundf(region.y1));
+    //If (0,0,0,0) specified, the whole image is to be used.
+    if (col0 == 0 && col1 == 0 && row0 == 0 && row1 == 0) {
+        col0 = mask->col0;
+        col1 = mask->col0 + mask->numCols - 1;
+        row0 = mask->row0;
+        row1 = mask->row0 + mask->numRows - 1;
+    }
+
+    //Make sure x0 of region is inside image.  If so, set col0 to corresponding index number.
+    if (col0 >= mask->col0 && col0 < (mask->col0 + mask->numCols) ) {
+        col0 -= mask->col0;
+    } else {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Specified psRegion parameter, x0=%f, is out of range [%d,%d].\n",
+                region.x0, mask->col0, mask->col0+mask->numCols-1);
         return -1;
     }
-
-    x0 = (int)(roundf(region.x0));
-    x1 = (int)(roundf(region.x1));
-    y0 = (int)(roundf(region.y0));
-    y1 = (int)(roundf(region.y1));
+    //Make sure y0 of region is inside image.  If so, set row0 to corresponding index number.
+    if (row0 >= mask->row0 && row0 < (mask->row0 + mask->numRows) ) {
+        row0 -= mask->row0;
+    } else {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Specified psRegion parameter, y0=%f, is out of range [%d,%d].\n",
+                region.y0, mask->row0, mask->row0+mask->numRows-1);
+        return -1;
+    }
+
+    //Make sure x1 of region is valid.  If negative, index from tail (if valid).
+    if (col1 < 0) {
+        col1 += mask->numCols;
+        if (col1 < 0) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n",
+                    region.x1, col1+mask->col0, mask->col0, mask->col0+mask->numCols-1);
+            return -1;
+        }
+    } else if (col1 >= mask->col0 && col1 < (mask->col0 + mask->numCols) ) {
+        col1 -= mask->col0;
+    } else {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Specified psRegion parameter, x1=%f=%d, is out of range [%d,%d].\n",
+                region.x1, col1, mask->col0, mask->col0+mask->numCols-1);
+        return -1;
+    }
+    //Make sure y1 of region is valid.  If negative, index from tail (if valid).
+    if (row1 < 0) {
+        row1 += mask->numRows;
+        if (row1 < 0) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n",
+                    region.y1, row1+mask->row0, mask->row0, mask->row0+mask->numRows-1);
+            return -1;
+        }
+    } else if (row1 >= mask->row0 && row1 < (mask->row0 + mask->numRows) ) {
+        row1 -= mask->row0;
+    } else {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Specified psRegion parameter, y1=%f=%d, is out of range [%d,%d].\n",
+                region.y1, row1, mask->row0, mask->row0+mask->numRows-1);
+        return -1;
+    }
+    //Now make sure that the region makes sense.
+    if (col0 > col1 || row0 > row1) {
+        if (col0 > col1) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Invalid psRegion specified.  x0=%f=%d is greater than x1=%f=%d.\n",
+                    region.x0, col0, region.x1, col1);
+        } else {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Invalid psRegion specified.  y0=%f=%d is greater than y1=%f=%d.\n",
+                    region.y0, row0, region.y1, row1);
+        }
+        return -1;
+    }/* else if (col0 == col1 && row0 == row1) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "Invalid psRegion specified.  Region contains only 1 pixel.\n");
+            return -1;
+        }
+    */
+    x0 = col0;
+    x1 = col1;
+    y0 = row0;
+    y1 = row1;
 
     type = mask->type.type;
@@ -664,6 +773,6 @@
     case PS_TYPE_U8:
     case PS_TYPE_U16:
-        for (long j = y0; j < y1; j++) {
-            for (long i = x0; i < x1; i++) {
+        for (long j = y0; j <= y1; j++) {
+            for (long i = x0; i <= x1; i++) {
                 if (mask->data.PS_TYPE_MASK_DATA[j][i] & value) {
                     Npixels ++;
Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 6749)
+++ /trunk/psLib/src/mathtypes/psImage.c	(revision 6750)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.99 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-03-17 20:38:19 $
+ *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-01 02:43:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -173,6 +173,15 @@
 {
 
-    if (image == NULL) {
-        return in;
+    //    if (image == NULL) {
+    //        return in;
+    //    }
+    PS_ASSERT_IMAGE_NON_NULL(image, in);
+    //if the region is [0,0,0,0], the whole image (or subimage) is to be included.
+    if (in.x0 == 0 && in.x1 == 0 && in.y0 == 0 && in.y1 == 0) {
+        in.x0 = image->col0;
+        in.x1 = image->col0 + image->numCols - 1;
+        in.y0 = image->row0;
+        in.y1 = image->row0 + image->numRows - 1;
+        return (in);
     }
 
@@ -195,7 +204,11 @@
     // flip start and end if out of order
     if (in.x0 > in.x1) {
+        psError (PS_ERR_BAD_PARAMETER_VALUE, true,
+                 "Invalid region in psRegionForImage.  x0 > x1.  Values have been swapped.\n");
         PS_SWAP (in.x0, in.x1);
     }
     if (in.y0 > in.y1) {
+        psError (PS_ERR_BAD_PARAMETER_VALUE, true,
+                 "Invalid region in psRegionForImage.  y0 > y1.  Values have been swapped.\n");
         PS_SWAP (in.y0, in.y1);
     }
@@ -717,8 +730,14 @@
 {
 
-    if (input == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL,true,
-                PS_ERRORTEXT_psImage_IMAGE_NULL);
-        return unexposedValue;
+    /*    if (input == NULL) {
+            psError(PS_ERR_BAD_PARAMETER_NULL,true,
+                    PS_ERRORTEXT_psImage_IMAGE_NULL);
+            return unexposedValue;
+        }
+    */
+    PS_ASSERT_IMAGE_NON_NULL(input, unexposedValue);
+    if (input->row0 != 0 || input->col0 != 0) {
+        x += input->col0;
+        y += input->row0;
     }
 
Index: /trunk/psLib/src/types/psPixels.c
===================================================================
--- /trunk/psLib/src/types/psPixels.c	(revision 6749)
+++ /trunk/psLib/src/types/psPixels.c	(revision 6750)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-28 02:53:03 $
+ *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-01 02:43:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -168,7 +168,17 @@
     float y1 = region.y1;
 
+    if ( (x0 < 0 || x1 < 0) || (y0 < 0 || y1 < 0) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                PS_ERRORTEXT_psPixels_REGION_INVALID,
+                (int)y0,(int)y1,(int)x0,(int)x1);
+        psFree(out);
+        return NULL;
+    }
+
     // determine the output image size
     int numRows = y1-y0;
     int numCols = x1-x0;
+    numRows += 1;
+    numCols += 1;
     if (numRows < 1 || numCols < 1) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
@@ -205,5 +215,5 @@
         float y = data[p].y;
         // pixel in region?
-        if (x >= x0 && x < x1 && y >= y0 && y < y1) {
+        if (x >= x0 && x <= x1 && y >= y0 && y <= y1) {
             outData[(int)(y-y0)][(int)(x-x0)] |= maskVal;
         }
Index: /trunk/psLib/test/imageops/tst_psImagePixelExtract.c
===================================================================
--- /trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 6749)
+++ /trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 6750)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-02-24 23:43:15 $
+*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-04-01 02:43:57 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -21,4 +21,5 @@
 static psS32 testImageCut(void);
 static psS32 testImageRadialCut(void);
+static psS32 testImageRowColError(void);
 static psS32 testImageRowColF32(void);
 static psS32 testImageRowColF64(void);
@@ -37,5 +38,6 @@
                               {testImageSlice, 552, "psImageSlice", 0, false},
                               {testImageCut, 555, "psImageCut", 0, false},
-                              {testImageRadialCut, 557, "psImageRadialCut", 0, false},
+                              {testImageRadialCut, 556, "psImageRadialCut", 0, false},
+                              {testImageRowColError, 557, "testImageRowColError", 0, false},
                               {testImageRowColF32, 558, "psImageRowColF32", 0, false},
                               {testImageRowColF64, 559, "psImageRowColF64", 0, false},
@@ -765,14 +767,20 @@
 }
 
-psS32 testImageRowColF64(void)
-{
-    psVector *rowcol = NULL;
-    psVector *empty = NULL;
+psS32 testImageRowColError(void)
+{
     psImage *image = NULL;
-    psImage *emptyImage = NULL;
+    psVector *out = NULL;
+    int num = 0;
+
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 1;
+    }
+
 
     image = psImageAlloc(3, 3, PS_TYPE_F64);
-    rowcol = psVectorAlloc(3, PS_TYPE_F64);
-
+    *(psS32*)&(image->row0) = 5;
+    *(psS32*)&(image->col0) = 10;
     image->data.F64[0][0] = 666.666;
     image->data.F64[1][0] = 66.6;
@@ -785,4 +793,31 @@
     image->data.F64[2][2] = 66.66;
 
+
+
+    psFree(out);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColF64(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_F64);
+    rowcol = psVectorAlloc(3, PS_TYPE_F64);
+
+    image->data.F64[0][0] = 666.666;
+    image->data.F64[1][0] = 66.6;
+    image->data.F64[2][0] = 6.66;
+    image->data.F64[0][1] = 6.6;
+    image->data.F64[1][1] = 6.666;
+    image->data.F64[2][1] = 66.666;
+    image->data.F64[0][2] = 666.6;
+    image->data.F64[1][2] = 666.66;
+    image->data.F64[2][2] = 66.66;
+
     //Test for error with NULL image
     empty = psImageCol(empty, emptyImage, 0);
Index: /trunk/psLib/test/imageops/tst_psImageStats.c
===================================================================
--- /trunk/psLib/test/imageops/tst_psImageStats.c	(revision 6749)
+++ /trunk/psLib/test/imageops/tst_psImageStats.c	(revision 6750)
@@ -543,9 +543,10 @@
     psRegion reg;
     reg.x0 = 0;
-    reg.x1 = 1;
+    reg.x1 = 0;
     reg.y0 = 0;
-    reg.y1 = 5;
+    reg.y1 = 4;
+
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
     numPix = psImageCountPixelMask(in, reg, 1);
-
     if (numPix != -1) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
@@ -587,5 +588,5 @@
     if (numPix2 != 2) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psImageCountPixelMask returned incorrect pixel count %ld\n", numPix2);
+                "psImageCountPixelMask returned incorrect pixel count %ld (!=2)\n", numPix2);
         return 4;
     }
@@ -613,4 +614,5 @@
     reg.x1 = 1;
     reg.y1 = 1;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
     numPix2 = psImageCountPixelMask(in2, reg, 1);
     if (numPix2 != -1) {
Index: /trunk/psLib/test/imageops/verified/tst_psImageInterpolate.stderr
===================================================================
--- /trunk/psLib/test/imageops/verified/tst_psImageInterpolate.stderr	(revision 6749)
+++ /trunk/psLib/test/imageops/verified/tst_psImageInterpolate.stderr	(revision 6750)
@@ -17,5 +17,5 @@
     Following should generate an error message
 <DATE><TIME>|<HOST>|E|psImagePixelInterpolate (FILE:LINENO)
-    Can not operate on a NULL psImage.
+    Unallowable operation: psImage input or its data is NULL.
 <DATE><TIME>|<HOST>|I|testInterpolateError
     Following should generate an error message
Index: /trunk/psLib/test/imageops/verified/tst_psImagePixelExtract.stderr
===================================================================
--- /trunk/psLib/test/imageops/verified/tst_psImagePixelExtract.stderr	(revision 6749)
+++ /trunk/psLib/test/imageops/verified/tst_psImagePixelExtract.stderr	(revision 6750)
@@ -24,17 +24,17 @@
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psImageSlice (FILE:LINENO)
-    Specified psRegion parameter, x0=301.000000, is out of range [0,300].
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psImageSlice (FILE:LINENO)
-    Specified psRegion parameter, y0=201.000000, is out of range [0,200].
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psImageSlice (FILE:LINENO)
-    Specified psRegion parameter, x1=301.000000=301, is out of range [0,300].
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psImageSlice (FILE:LINENO)
-    Specified psRegion parameter, y1=201.000000=201, is out of range [0,200].
+    Specified psRegion parameter, x0=301.000000, is out of range [0,299].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psImageSlice (FILE:LINENO)
+    Specified psRegion parameter, y0=201.000000, is out of range [0,199].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psImageSlice (FILE:LINENO)
+    Specified psRegion parameter, x1=301.000000=301, is out of range [0,299].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psImageSlice (FILE:LINENO)
+    Specified psRegion parameter, y1=201.000000=201, is out of range [0,199].
 <DATE><TIME>|<HOST>|I|testImageSlice
     Following should be an error.
@@ -61,33 +61,25 @@
     The following should be an error.
 <DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (-1.000000,10.000000)->(240.000000,180.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
-<DATE><TIME>|<HOST>|I|testImageCut
-    The following should be an error.
-<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (300.000000,10.000000)->(240.000000,180.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
-<DATE><TIME>|<HOST>|I|testImageCut
-    The following should be an error.
-<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (20.000000,10.000000)->(-1.000000,180.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
-<DATE><TIME>|<HOST>|I|testImageCut
-    The following should be an error.
-<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (20.000000,10.000000)->(300.000000,180.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
-<DATE><TIME>|<HOST>|I|testImageCut
-    The following should be an error.
-<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (20.000000,-1.000000)->(240.000000,180.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
-<DATE><TIME>|<HOST>|I|testImageCut
-    The following should be an error.
-<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (20.000000,200.000000)->(240.000000,180.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
-<DATE><TIME>|<HOST>|I|testImageCut
-    The following should be an error.
-<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (20.000000,10.000000)->(240.000000,-1.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
-<DATE><TIME>|<HOST>|I|testImageCut
-    The following should be an error.
-<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
-    Specified line, (20.000000,10.000000)->(240.000000,200.000000), does not entirely lie in psImage's boundaries, [0:299,0:199].
+    Specified psRegion parameter, x0=-1.000000, is out of range [0,300].
+<DATE><TIME>|<HOST>|I|testImageCut
+    The following should be an error.
+<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
+    Specified psRegion parameter, x0=300.000000, is out of range [0,300].
+<DATE><TIME>|<HOST>|I|testImageCut
+    The following should be an error.
+<DATE><TIME>|<HOST>|I|testImageCut
+    The following should be an error.
+<DATE><TIME>|<HOST>|I|testImageCut
+    The following should be an error.
+<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
+    Specified psRegion parameter, y0=-1.000000, is out of range [0,200].
+<DATE><TIME>|<HOST>|I|testImageCut
+    The following should be an error.
+<DATE><TIME>|<HOST>|E|psImageCut (FILE:LINENO)
+    Specified psRegion parameter, y0=200.000000, is out of range [0,200].
+<DATE><TIME>|<HOST>|I|testImageCut
+    The following should be an error.
+<DATE><TIME>|<HOST>|I|testImageCut
+    The following should be an error.
 <DATE><TIME>|<HOST>|I|testImageCut
     Following should be an error (NULL image).
@@ -148,4 +140,17 @@
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psImagePixelExtract.c                                  *
+*            TestPoint: psImage{testImageRowColError}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<DATE><TIME>|<HOST>|I|testImageRowColError
+    Following should generate error message
+<DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO)
+    Can not operate on a NULL psImage.
+
+---> TESTPOINT PASSED (psImage{testImageRowColError} | tst_psImagePixelExtract.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psImagePixelExtract.c                                  *
 *            TestPoint: psImage{psImageRowColF32}                                  *
 *             TestType: Positive                                                   *
Index: /trunk/psLib/test/imageops/verified/tst_psImageStats.stderr
===================================================================
--- /trunk/psLib/test/imageops/verified/tst_psImageStats.stderr	(revision 6749)
+++ /trunk/psLib/test/imageops/verified/tst_psImageStats.stderr	(revision 6750)
@@ -622,8 +622,12 @@
 \**********************************************************************************/
 
+<HOST>|I|testImageCountPixel
+    Following should generate error message
 <HOST>|E|psImageCountPixelMask (FILE:LINENO)
-    Can not operate on a NULL psImage.
+    Unallowable operation: psImage mask or its data is NULL.
+<HOST>|I|testImageCountPixel
+    Following should generate error message
 <HOST>|E|psImageCountPixelMask (FILE:LINENO)
-    psRegion input contains 0 pixels
+    Specified psRegion parameter, x0=1.000000, is out of range [0,0].
 
 ---> TESTPOINT PASSED (psImage{psImageCountPixel} | tst_psImageStats.c)
Index: /trunk/psLib/test/types/tst_psPixels.c
===================================================================
--- /trunk/psLib/test/types/tst_psPixels.c	(revision 6749)
+++ /trunk/psLib/test/types/tst_psPixels.c	(revision 6750)
@@ -5,7 +5,7 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.4 $
+ *  @version $Revision: 1.5 $
  *           $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-28 02:53:03 $
+ *  @date $Date: 2006-04-01 02:43:57 $
  *
  *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
@@ -378,4 +378,11 @@
         psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL for invalid range");
         return 21;
+    }
+    // Test for invalid region
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for invalid range");
+    mask = psPixelsToMask(mask,pixels,psRegionSet(0,-1,0,10),1);
+    if(mask != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL for invalid range");
+        return 22;
     }
 
Index: /trunk/psLib/test/types/verified/tst_psPixels.stderr
===================================================================
--- /trunk/psLib/test/types/verified/tst_psPixels.stderr	(revision 6749)
+++ /trunk/psLib/test/types/verified/tst_psPixels.stderr	(revision 6750)
@@ -44,4 +44,8 @@
 <DATE><TIME>|<HOST>|E|psPixelsToMask (FILE:LINENO)
     Specified psRegion, [10:0,10:0], does not specify a valid region.
+<DATE><TIME>|<HOST>|I|testPixelsToMask
+    Following should generate an error for invalid range
+<DATE><TIME>|<HOST>|E|psPixelsToMask (FILE:LINENO)
+    Specified psRegion, [0:10,0:-1], does not specify a valid region.
 
 ---> TESTPOINT PASSED (psPixels{psPixelsToMask} | tst_psPixels.c)
