Index: trunk/psLib/test/image/tst_psImageExtraction.c
===================================================================
--- trunk/psLib/test/image/tst_psImageExtraction.c	(revision 1369)
+++ trunk/psLib/test/image/tst_psImageExtraction.c	(revision 1404)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-02 18:30:10 $
+*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-06 21:50:14 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -27,5 +27,5 @@
                               }
                           };
-                          
+
 int main( int argc, char* argv[] )
 {
@@ -41,11 +41,12 @@
     psVector* out = NULL;
     psImage* image = psImageAlloc( c, r, PS_TYPE_F32 );
+    psVector* positions = psVectorAlloc( r, PS_TYPE_U32 );
     psImage* mask = psImageAlloc( c, r, PS_TYPE_MASK );
     psStats* stat = psStatsAlloc( PS_STAT_SAMPLE_MEDIAN );
-    
+
     /*
         This function shall extract pixels from a specified region of a psImage
         structure into a vector using a specified statistical method.
-    
+
         Verify the returned psVector structure contains expected data, if the 
         input psImage input has known data and the psStats structure specifies 
@@ -57,33 +58,50 @@
      
      */
-    
+
     for ( int row = 0;row < r;row++ ) {
-            psF32* imageRow = image->data.F32[ row ];
-            psMaskType* maskRow = image->data.V[ row ];
-            psF32 rowOffset = ( psF32 ) row / ( psF32 ) r;
-            for ( int col = 0;col < c;col++ ) {
-                    imageRow[ col ] = ( psF32 ) col + rowOffset;
-                    maskRow[ col ] = 0;
-                }
+        psF32* imageRow = image->data.F32[ row ];
+        psMaskType* maskRow = image->data.V[ row ];
+        psF32 rowOffset = ( psF32 ) row / ( psF32 ) r;
+        for ( int col = 0;col < c;col++ ) {
+            imageRow[ col ] = ( psF32 ) col + rowOffset;
+            maskRow[ col ] = 0;
         }
-        
+    }
+
     // test MxN case
-    
+
     #define PSIMAGESLICE_TEST1(M,N,DIRECTION,TRUTH_SIZE,TRUTHPIX_X,TRUTHPIX_Y,TESTNUM) \
-    out = psImageSlice(out,image,mask,1,c/10,r/10,M,N,DIRECTION,stat); \
+    out = psImageSlice(out,positions,image,mask,1,c/10,r/10,M,N,DIRECTION,stat); \
     \
     if (out->n != TRUTH_SIZE) { \
-            psError(__func__,"Number of results is wrong (%d, not %d)", \
-                    out->n,n); \
-            return TESTNUM*2+1; \
-        } \
+        psError(__func__,"Number of results is wrong (%d, not %d)", \
+                out->n,n); \
+        return TESTNUM*4+1; \
+    } \
+    \
+    if (positions->n != TRUTH_SIZE) { \
+        psError(__func__,"Number of results for positions vector is wrong (%d, not %d)", \
+                out->n,n); \
+        return TESTNUM*4+2; \
+    } \
     \
     for (int i=0;i<out->n;i++) { \
-            if (abs(out->data.F64[i]-image->data.F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF32)r) { \
-                    psError(__func__,"Improper result at position %d.",i); \
-                    return TESTNUM*2+2; \
-                } \
-        }
-        
+        if (abs(out->data.F64[i]-image->data.F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF32)r) { \
+            psError(__func__,"Improper result at position %d.",i); \
+            return TESTNUM*4+3; \
+        } \
+        if (DIRECTION == PS_CUT_X_POS || DIRECTION == PS_CUT_X_NEG) { \
+            if (positions->data.U32[i] != c/10+TRUTHPIX_X) { \
+                psError(__func__,"Improper postions result @ %d.",i); \
+                return TESTNUM*4+4; \
+            } \
+        } else { \
+            if (positions->data.U32[i] != r/10+TRUTHPIX_Y) { \
+                psError(__func__,"Improper postions result @ %d.",i); \
+                return TESTNUM*4+4; \
+            } \
+        } \
+    }
+
     // test MxN case
     PSIMAGESLICE_TEST1( m, n, PS_CUT_X_POS, m, i, n / 2, 0 );
@@ -91,5 +109,5 @@
     PSIMAGESLICE_TEST1( m, n, PS_CUT_Y_POS, n, m / 2, i, 2 );
     PSIMAGESLICE_TEST1( m, n, PS_CUT_Y_NEG, n, m / 2, n - 1 - i, 3 );
-    
+
     // test Mx1 case
     PSIMAGESLICE_TEST1( m, 1, PS_CUT_X_POS, m, i, 0, 4 );
@@ -97,5 +115,5 @@
     PSIMAGESLICE_TEST1( m, 1, PS_CUT_Y_POS, 1, m / 2, 0, 6 );
     PSIMAGESLICE_TEST1( m, 1, PS_CUT_Y_NEG, 1, m / 2, 0, 7 );
-    
+
     // test 1xN case
     PSIMAGESLICE_TEST1( 1, n, PS_CUT_X_POS, 1, 0, n / 2, 8 );
@@ -103,5 +121,5 @@
     PSIMAGESLICE_TEST1( 1, n, PS_CUT_Y_POS, n, 0, n - 1 - i, 10 );
     PSIMAGESLICE_TEST1( 1, n, PS_CUT_Y_NEG, n, 0, n - 1 - i, 11 );
-    
+
     // test 1x1 case
     PSIMAGESLICE_TEST1( 1, 1, PS_CUT_X_POS, 1, 0, 0, 12 );
@@ -109,18 +127,18 @@
     PSIMAGESLICE_TEST1( 1, 1, PS_CUT_Y_POS, 1, 0, 0, 14 );
     PSIMAGESLICE_TEST1( 1, 1, PS_CUT_Y_NEG, 1, 0, 0, 15 );
-    
+
     /*
        Verify the returned psVector structure pointer is null and program 
        execution doesn't stop, if input psImage input is null.
-    
-    */
-    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, NULL, NULL, 0, c / 10, r / 10, 1, 1, PS_CUT_X_POS, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving a NULL image, psImageSlice didn't return NULL as expected" );
-            return 41;
-        }
-        
-        
+
+    */
+    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
+    out = psImageSlice( out, NULL, NULL, NULL, 0, c / 10, r / 10, 1, 1, PS_CUT_X_POS, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving a NULL image, psImageSlice didn't return NULL as expected" );
+        return 101;
+    }
+
+
     /*
        Verify the returned psVector structure pointer is null and program 
@@ -128,12 +146,12 @@
     */
     psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, image, mask, 1, c / 10, r / 10, 1, 1, PS_CUT_X_POS, NULL );
-    if ( out != NULL ) {
-            psError( __func__, "Giving a NULL stat struct, psImageSlice didn't return NULL as expected" );
-            return 42;
-        }
-        
-    /*
-    
+    out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, 1, PS_CUT_X_POS, NULL );
+    if ( out != NULL ) {
+        psError( __func__, "Giving a NULL stat struct, psImageSlice didn't return NULL as expected" );
+        return 102;
+    }
+
+    /*
+
        Verify the returned psVector structure pointer is null and program 
        executions doesn't stop, if the input direction is not set to one of 
@@ -141,10 +159,10 @@
     */
     psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, image, mask, 1, c / 10, r / 10, 1, 1, 5, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving a bogus direction flag, psImageSlice didn't return NULL as expected" );
-            return 43;
-        }
-        
+    out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, 1, 5, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving a bogus direction flag, psImageSlice didn't return NULL as expected" );
+        return 103;
+    }
+
     /*
        Verify the returned psVector structure pointer is null and program 
@@ -152,10 +170,10 @@
     */
     psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, image, mask, 1, c / 10, r / 10, 0, 0, PS_CUT_X_POS, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving a 0x0 region, psImageSlice didn't return NULL as expected" );
-            return 44;
-        }
-        
+    out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 0, 0, PS_CUT_X_POS, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving a 0x0 region, psImageSlice didn't return NULL as expected" );
+        return 104;
+    }
+
     /*
        Verify the returned psVector structure pointer is null and program 
@@ -164,31 +182,31 @@
     */
     psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, image, mask, 1, c + 1, r / 10, 1, 1, PS_CUT_X_POS, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving an invalid x position, psImageSlice didn't return NULL as expected" );
-            return 45;
-        }
-        
-    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, image, mask, 1, c / 10, r + 1, 1, 1, PS_CUT_X_POS, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving an invalid y position, psImageSlice didn't return NULL as expected" );
-            return 46;
-        }
-        
-    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, image, mask, 1, c / 10, r / 10, c, 1, PS_CUT_X_POS, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving an invalid numCols, psImageSlice didn't return NULL as expected" );
-            return 47;
-        }
-        
-    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
-    out = psImageSlice( out, image, mask, 1, c / 10, r / 10, 1, r, PS_CUT_X_POS, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
-            return 48;
-        }
-        
+    out = psImageSlice( out, NULL, image, mask, 1, c + 1, r / 10, 1, 1, PS_CUT_X_POS, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving an invalid x position, psImageSlice didn't return NULL as expected" );
+        return 105;
+    }
+
+    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
+    out = psImageSlice( out, NULL, image, mask, 1, c / 10, r + 1, 1, 1, PS_CUT_X_POS, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving an invalid y position, psImageSlice didn't return NULL as expected" );
+        return 106;
+    }
+
+    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
+    out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, c, 1, PS_CUT_X_POS, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving an invalid numCols, psImageSlice didn't return NULL as expected" );
+        return 107;
+    }
+
+    psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
+    out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, r, PS_CUT_X_POS, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
+        return 108;
+    }
+
     /*
        Verify the returned psVector structure pointer is null and program 
@@ -198,24 +216,18 @@
     psLogMsg( __func__, PS_LOG_INFO, "Following should be an error." );
     stat->options = 0;
-    out = psImageSlice( out, image, mask, 1, c / 10, r / 10, 1, 1, PS_CUT_X_POS, stat );
-    if ( out != NULL ) {
-            psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
-            return 49;
-        }
-        
+    out = psImageSlice( out, NULL, image, mask, 1, c / 10, r / 10, 1, 1, PS_CUT_X_POS, stat );
+    if ( out != NULL ) {
+        psError( __func__, "Giving an invalid numRows, psImageSlice didn't return NULL as expected" );
+        return 109;
+    }
+
     psFree( image );
+    psFree( positions );
     psFree( mask );
     psFree( out );
     psFree( stat );
-    
+
     return 0;
-    
+
 }
 
-
-
-
-
-
-
-
Index: trunk/psLib/test/image/verified/tst_psImage.stderr
===================================================================
--- trunk/psLib/test/image/verified/tst_psImage.stderr	(revision 1369)
+++ trunk/psLib/test/image/verified/tst_psImage.stderr	(revision 1404)
@@ -5,29 +5,29 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I| testImageAlloc|#546 - psImageAlloc shall allocate memory for a psImage structure
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 101h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 102h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 104h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 108h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 301h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 302h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 304h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 308h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 404h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 408h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 808h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
- <DATE> <TIME> |<HOST>|I| testImageAlloc|Testing psImage with type 810h
- <DATE> <TIME> |<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|#546 - psImageAlloc shall allocate memory for a psImage structure
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 101h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 102h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 104h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 108h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 301h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 302h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 304h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 308h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 404h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 408h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 808h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
+<DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 810h
+<DATE><TIME>|<HOST>|E|   psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0).
 
 ---> TESTPOINT PASSED (psImage{psImageAlloc} | tst_psImage.c)
@@ -39,43 +39,43 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|testImageSubset|memcpy(&preSubsetStruct,original,sizeof(psImage));
- <DATE> <TIME> |<HOST>|I|testImageSubset|subset1 = psImageAlloc(c/4,r/4,PS_TYPE_U8);
- <DATE> <TIME> |<HOST>|I|testImageSubset|subset2 = psImageSubset(subset1,original,c/2,r/2,c/4,r/4);
- <DATE> <TIME> |<HOST>|I|testImageSubset|subset3 = psImageSubset(NULL,original,c/2,r/2,0,0);
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure is equal to the input psImage structure parameter out, if input parameter out is specified.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify a new psImage structure is created, if input parameter out is set to null.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure contains expected values in the row member, if the input psImage structure image contains known values.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure members nrow and ncol are equal to the input parameter nrow and ncol respectively.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure member type is equal to the input psImage structure member type.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure members row0 and col0 are equal to the input parameters row0 and col0 respectively.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure member parent is equal to the input psImage structure pointer image.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure member Nchildren is equal to zero.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure member children is null.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the input psImage structure image only has the following members changed: 1) Nchildren is increased by one. 2) parent contains pointer psImage structure out at parent[Nchildren-1].
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameter image is null. Also verified the input psImage structure is not modified.
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image because input image or its pixel buffer is NULL.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program  execution doesn't stop, if the input parameters nrow and/or ncol are zero. Also verify input psImage structure is not modified.
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image because number of rows or columns are zero (64x0).
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image because number of rows or columns are zero (0x128).
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameters row0 and col0 are not within the range of values of psImage structure image.
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (128,0) is not a valid pixel location.
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (0,256) is not a valid pixel location.
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (-1,0) is not a valid pixel location.
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (0,-1) is not a valid pixel location.
- <DATE> <TIME> |<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program execution doesn't stop if the input parameters nrow, ncol, row0 and col0 specify a range of data not within the input psImage structure image.  Also verify the input psImage structure is not modified.
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image outside of image boundaries (size=128x256, subset=[64:128,0:128]).
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image outside of image boundaries (size=128x256, subset=[0:64,128:256]).
- <DATE> <TIME> |<HOST>|I|testImageSubset|An error should follow...
- <DATE> <TIME> |<HOST>|E|  psImageSubset|Can not subset image outside of image boundaries (size=128x256, subset=[64:128,128:256]).
- <DATE> <TIME> |<HOST>|I|testImageSubset|psImageFreeChildren shall deallocate any children images of a psImage structure
+<DATE><TIME>|<HOST>|I|testImageSubset|memcpy(&preSubsetStruct,original,sizeof(psImage));
+<DATE><TIME>|<HOST>|I|testImageSubset|subset1 = psImageAlloc(c/4,r/4,PS_TYPE_U8);
+<DATE><TIME>|<HOST>|I|testImageSubset|subset2 = psImageSubset(subset1,original,c/2,r/2,c/4,r/4);
+<DATE><TIME>|<HOST>|I|testImageSubset|subset3 = psImageSubset(NULL,original,c/2,r/2,0,0);
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure is equal to the input psImage structure parameter out, if input parameter out is specified.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify a new psImage structure is created, if input parameter out is set to null.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure contains expected values in the row member, if the input psImage structure image contains known values.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure members nrow and ncol are equal to the input parameter nrow and ncol respectively.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure member type is equal to the input psImage structure member type.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure members row0 and col0 are equal to the input parameters row0 and col0 respectively.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure member parent is equal to the input psImage structure pointer image.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure member Nchildren is equal to zero.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure member children is null.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the input psImage structure image only has the following members changed: 1) Nchildren is increased by one. 2) parent contains pointer psImage structure out at parent[Nchildren-1].
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameter image is null. Also verified the input psImage structure is not modified.
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image because input image or its pixel buffer is NULL.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program  execution doesn't stop, if the input parameters nrow and/or ncol are zero. Also verify input psImage structure is not modified.
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image because number of rows or columns are zero (64x0).
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image because number of rows or columns are zero (0x128).
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameters row0 and col0 are not within the range of values of psImage structure image.
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (128,0) is not a valid pixel location.
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (0,256) is not a valid pixel location.
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (-1,0) is not a valid pixel location.
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image because col0,row0 (0,-1) is not a valid pixel location.
+<DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure pointer is null and program execution doesn't stop if the input parameters nrow, ncol, row0 and col0 specify a range of data not within the input psImage structure image.  Also verify the input psImage structure is not modified.
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image outside of image boundaries (size=128x256, subset=[64:<LINENO>,0:<LINENO>]).
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image outside of image boundaries (size=128x256, subset=[0:<LINENO>,128:<LINENO>]).
+<DATE><TIME>|<HOST>|I|testImageSubset|An error should follow...
+<DATE><TIME>|<HOST>|E|  psImageSubset|Can not subset image outside of image boundaries (size=128x256, subset=[64:<LINENO>,128:<LINENO>]).
+<DATE><TIME>|<HOST>|I|testImageSubset|psImageFreeChildren shall deallocate any children images of a psImage structure
 
 ---> TESTPOINT PASSED (psImage{psImageSubset} | tst_psImage.c)
@@ -87,14 +87,14 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psU8
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psU16
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psU32
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psS8
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psS16
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psS32
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psF32
- <DATE> <TIME> |<HOST>|I|  testImageCopy|Image Copy Test for psF64
- <DATE> <TIME> |<HOST>|I|  testImageCopy|An error should follow...
- <DATE> <TIME> |<HOST>|E|    psImageCopy|Can not copy image because input image or its pixel buffer is NULL.
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psU8
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psU16
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psU32
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psS8
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psS16
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psS32
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psF32
+<DATE><TIME>|<HOST>|I|  testImageCopy|Image Copy Test for psF64
+<DATE><TIME>|<HOST>|I|  testImageCopy|An error should follow...
+<DATE><TIME>|<HOST>|E|    psImageCopy|Can not copy image because input image or its pixel buffer is NULL.
 
 ---> TESTPOINT PASSED (psImage{psImageCopy} | tst_psImage.c)
Index: trunk/psLib/test/image/verified/tst_psImageFFT.stderr
===================================================================
--- trunk/psLib/test/image/verified/tst_psImageFFT.stderr	(revision 1369)
+++ trunk/psLib/test/image/verified/tst_psImageFFT.stderr	(revision 1404)
@@ -23,8 +23,8 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|testImageComple|Following should be an error (type mismatch).
- <DATE> <TIME> |<HOST>|E| psImageComplex|The inputs to psImageComplex must be the same type.
- <DATE> <TIME> |<HOST>|I|testImageComple|Following should be an error (size mismatch).
- <DATE> <TIME> |<HOST>|E| psImageComplex|The inputs to psImageComplex must be the same dimensions.
+<DATE><TIME>|<HOST>|I|testImageComple|Following should be an error (type mismatch).
+<DATE><TIME>|<HOST>|E| psImageComplex|The inputs to psImageComplex must be the same type.
+<DATE><TIME>|<HOST>|I|testImageComple|Following should be an error (size mismatch).
+<DATE><TIME>|<HOST>|E| psImageComplex|The inputs to psImageComplex must be the same dimensions.
 
 ---> TESTPOINT PASSED (psFFT{psImageComplex} | tst_psImageFFT.c)
Index: trunk/psLib/test/image/verified/tst_psImageManip.stderr
===================================================================
--- trunk/psLib/test/image/verified/tst_psImageManip.stderr	(revision 1369)
+++ trunk/psLib/test/image/verified/tst_psImageManip.stderr	(revision 1404)
@@ -5,17 +5,17 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|  testImageClip|psImageClip shall limit the minimum and maximum data value within a psImage structure
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of F64 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of F32 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of S32 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of S16 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of S8 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of U32 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of U16 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of U8 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of C32 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Testing clipping of C64 imagery
- <DATE> <TIME> |<HOST>|I|  testImageClip|Following should be an error (max<min)
- <DATE> <TIME> |<HOST>|E|    psImageClip|psImageClip can not be invoked with max < min.
+<DATE><TIME>|<HOST>|I|  testImageClip|psImageClip shall limit the minimum and maximum data value within a psImage structure
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of F64 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of F32 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of S32 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of S16 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of S8 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of U32 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of U16 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of U8 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of C32 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Testing clipping of C64 imagery
+<DATE><TIME>|<HOST>|I|  testImageClip|Following should be an error (max<min)
+<DATE><TIME>|<HOST>|E|    psImageClip|psImageClip can not be invoked with max < min.
 
 ---> TESTPOINT PASSED (psImage{psImageClip} | tst_psImageManip.c)
@@ -27,5 +27,5 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|testImageClipNA|psImageClipNaN shall modified pixel values of NaN with a specified value
+<DATE><TIME>|<HOST>|I|testImageClipNA|psImageClipNaN shall modified pixel values of NaN with a specified value
 
 ---> TESTPOINT PASSED (psImage{psImageClipNAN} | tst_psImageManip.c)
@@ -37,31 +37,31 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|testImageClipCo|psImageClipNaN shall modified pixel values of NaN with a specified value
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Testing clipping at 409.6+256i to 682.667+512i for psC32
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Testing clipping at 409.6+256i to 682.667+512i for psC64
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Can not perform clip on NULL image
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|psImageClipComplexRegion can not be invoked with max < min in the real image space.
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|psImageClipComplexRegion can not be invoked with max < min in the imaginary image space.
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|psImageClipComplexRegion can not be invoked with max < min in the real image space.
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmin (-6.80565e+38+0i) is outside of image's psC32 pixel range
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmin (6.80565e+38+0i) is outside of image's psC32 pixel range
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmin (-0-6.80565e+38i) is outside of image's psC32 pixel range
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmin (0+6.80565e+38i) is outside of image's psC32 pixel range
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmax (-6.80565e+38+0i) is outside of image's psC32 pixel range
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmax (6.80565e+38+0i) is outside of image's psC32 pixel range
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmax (-0-6.80565e+38i) is outside of image's psC32 pixel range
- <DATE> <TIME> |<HOST>|I|testImageClipCo|Following should be an error:
- <DATE> <TIME> |<HOST>|E|psImageClipComp|Specified vmax (0+6.80565e+38i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|psImageClipNaN shall modified pixel values of NaN with a specified value
+<DATE><TIME>|<HOST>|I|testImageClipCo|Testing clipping at 409.6+256i to 682.667+512i for psC32
+<DATE><TIME>|<HOST>|I|testImageClipCo|Testing clipping at 409.6+256i to 682.667+512i for psC64
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Can not perform clip on NULL image
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|psImageClipComplexRegion can not be invoked with max < min in the real image space.
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|psImageClipComplexRegion can not be invoked with max < min in the imaginary image space.
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|psImageClipComplexRegion can not be invoked with max < min in the real image space.
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmin (-6.80565e+38+0i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmin (6.80565e+38+0i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmin (-0-6.80565e+38i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmin (0+6.80565e+38i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmax (-6.80565e+38+0i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmax (6.80565e+38+0i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmax (-0-6.80565e+38i) is outside of image's psC32 pixel range
+<DATE><TIME>|<HOST>|I|testImageClipCo|Following should be an error:
+<DATE><TIME>|<HOST>|E|psImageClipComp|Specified vmax (0+6.80565e+38i) is outside of image's psC32 pixel range
 
 ---> TESTPOINT PASSED (psImage{psImageClipComplexRegion} | tst_psImageManip.c)
@@ -73,10 +73,10 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|testImageOverla|Following should error as overlay isn't within image boundaries
- <DATE> <TIME> |<HOST>|E|psImageOverlayS|Overlay image (32,64 -> 159,319) is partially outside of the input image (128 x 256).
- <DATE> <TIME> |<HOST>|I|testImageOverla|Following should error as overlay is NULL
- <DATE> <TIME> |<HOST>|E|psImageOverlayS|one of the input images was NULL.
- <DATE> <TIME> |<HOST>|I|testImageOverla|Following should error as image input is NULL
- <DATE> <TIME> |<HOST>|E|psImageOverlayS|one of the input images was NULL.
+<DATE><TIME>|<HOST>|I|testImageOverla|Following should error as overlay isn't within image boundaries
+<DATE><TIME>|<HOST>|E|psImageOverlayS|Overlay image (32,64 -> 159,319) is partially outside of the input image (128 x 256).
+<DATE><TIME>|<HOST>|I|testImageOverla|Following should error as overlay is NULL
+<DATE><TIME>|<HOST>|E|psImageOverlayS|one of the input images was NULL.
+<DATE><TIME>|<HOST>|I|testImageOverla|Following should error as image input is NULL
+<DATE><TIME>|<HOST>|E|psImageOverlayS|one of the input images was NULL.
 
 ---> TESTPOINT PASSED (psImage{psImageOverlay} | tst_psImageManip.c)
@@ -88,15 +88,15 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|E|   psImageRebin|Input image is NULL.
- <DATE> <TIME> |<HOST>|I| testImageRebin|Following should be an error.
- <DATE> <TIME> |<HOST>|E|   psImageRebin|The scale must be positive.
- <DATE> <TIME> |<HOST>|I| testImageRebin|Following should be an error.
- <DATE> <TIME> |<HOST>|E|   psImageRebin|The stats input can not be NULL.
- <DATE> <TIME> |<HOST>|I| testImageRebin|Following should be an error.
- <DATE> <TIME> |<HOST>|E|   psImageRebin|The stat options didn't specify a single supported statistic type.
- <DATE> <TIME> |<HOST>|I| testImageRebin|Following should be an error.
- <DATE> <TIME> |<HOST>|E|   psImageRebin|The stat options didn't specify a single supported statistic type.
- <DATE> <TIME> |<HOST>|I| testImageRebin|Following should be an error.
- <DATE> <TIME> |<HOST>|E|   psImageRebin|The stat options didn't specify a single supported statistic type.
+<DATE><TIME>|<HOST>|E|   psImageRebin|Input image is NULL.
+<DATE><TIME>|<HOST>|I| testImageRebin|Following should be an error.
+<DATE><TIME>|<HOST>|E|   psImageRebin|The scale must be positive.
+<DATE><TIME>|<HOST>|I| testImageRebin|Following should be an error.
+<DATE><TIME>|<HOST>|E|   psImageRebin|The stats input can not be NULL.
+<DATE><TIME>|<HOST>|I| testImageRebin|Following should be an error.
+<DATE><TIME>|<HOST>|E|   psImageRebin|The stat options didn't specify a single supported statistic type.
+<DATE><TIME>|<HOST>|I| testImageRebin|Following should be an error.
+<DATE><TIME>|<HOST>|E|   psImageRebin|The stat options didn't specify a single supported statistic type.
+<DATE><TIME>|<HOST>|I| testImageRebin|Following should be an error.
+<DATE><TIME>|<HOST>|E|   psImageRebin|The stat options didn't specify a single supported statistic type.
 
 ---> TESTPOINT PASSED (psImage{psImageRebin} | tst_psImageManip.c)
@@ -108,6 +108,6 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|  testImageRoll|Following should generate an error.
- <DATE> <TIME> |<HOST>|E|    psImageRoll|Input image can not be NULL.
+<DATE><TIME>|<HOST>|I|  testImageRoll|Following should generate an error.
+<DATE><TIME>|<HOST>|E|    psImageRoll|Input image can not be NULL.
 
 ---> TESTPOINT PASSED (psImage{psImageRoll} | tst_psImageManip.c)
@@ -119,6 +119,6 @@
 \**********************************************************************************/
 
- <DATE> <TIME> |<HOST>|I|testImageRotate|Following should be an error
- <DATE> <TIME> |<HOST>|E|  psImageRotate|The input image was NULL.
+<DATE><TIME>|<HOST>|I|testImageRotate|Following should be an error
+<DATE><TIME>|<HOST>|E|  psImageRotate|The input image was NULL.
 
 ---> TESTPOINT PASSED (psImage{psImageRotate} | tst_psImageManip.c)
Index: trunk/psLib/test/image/verified/tst_psImageStats01.stderr
===================================================================
--- trunk/psLib/test/image/verified/tst_psImageStats01.stderr	(revision 1369)
+++ trunk/psLib/test/image/verified/tst_psImageStats01.stderr	(revision 1404)
@@ -1,3 +1,3 @@
- <DATE> <TIME> |<HOST>|E|   psImageStats|The input image can not be NULL.
- <DATE> <TIME> |<HOST>|E|   psImageStats|The input psStats struct can not be NULL.
- <DATE> <TIME> |<HOST>|E|   psImageStats|No statistic option/operation was specified.
+<DATE><TIME>|<HOST>|E|   psImageStats|The input image can not be NULL.
+<DATE><TIME>|<HOST>|E|   psImageStats|The input psStats struct can not be NULL.
+<DATE><TIME>|<HOST>|E|   psImageStats|No statistic option/operation was specified.
