Index: /trunk/psLib/psLib.kdevses
===================================================================
--- /trunk/psLib/psLib.kdevses	(revision 2155)
+++ /trunk/psLib/psLib.kdevses	(revision 2156)
@@ -2,10 +2,20 @@
 <!DOCTYPE KDevPrjSession>
 <KDevPrjSession>
- <DocsAndViews NumberOfDocuments="1" >
+ <DocsAndViews NumberOfDocuments="3" >
   <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/Doxyfile" >
-   <View0 line="25" Type="???" >
-    <AdditionalSettings Top="2" Width="1165" Attach="1" Height="926" Left="2" MinMaxMode="0" />
+   <View0 line="27" Type="???" >
+    <AdditionalSettings Top="2" Width="1212" Attach="1" Height="1027" Left="2" MinMaxMode="0" />
    </View0>
   </Doc0>
+  <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageExtraction.c" >
+   <View0 line="311" Type="???" >
+    <AdditionalSettings Top="2" Width="1212" Attach="1" Height="752" Left="2" MinMaxMode="0" />
+   </View0>
+  </Doc1>
+  <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageErrors.dat" >
+   <View0 line="21" Type="???" >
+    <AdditionalSettings Top="2" Width="1212" Attach="1" Height="1001" Left="2" MinMaxMode="0" />
+   </View0>
+  </Doc2>
  </DocsAndViews>
  <pluginList>
Index: /trunk/psLib/test/image/tst_psImageExtraction.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageExtraction.c	(revision 2155)
+++ /trunk/psLib/test/image/tst_psImageExtraction.c	(revision 2156)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-13 23:34:58 $
+*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-15 20:00:56 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -44,6 +44,6 @@
 int testImageSlice(void)
 {
-    const int r = 1000;
-    const int c = 2000;
+    const int r = 200;
+    const int c = 300;
     const int m = r / 2 -1;
     const int n = r / 4 -1;
@@ -99,7 +99,7 @@
     \
     for (int i=0;i<out->n;i++) { \
-        if (fabs(out->data.F64[i]-image->data.F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF32)r) { \
+        if (fabs(out->data.F64[i]-image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF64)r) { \
             psError(__func__,"Improper result at position %d.  Got %g, expected %g",i, \
-                    out->data.F64[i],image->data.F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \
+                    out->data.F64[i],image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \
             return TESTNUM*4+3; \
         } \
@@ -120,27 +120,34 @@
     psFree(image);
 
-    // test MxN case
-    PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_X_POS, m, i, n / 2, 0 );
-    PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_X_NEG, m, m - 1 - i, n / 2, 1 );
-    PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_Y_POS, n, m / 2, i, 2 );
-    PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_Y_NEG, n, m / 2, n - 1 - i, 3 );
-
-    // test Mx1 case
-    PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_X_POS, m, i, 0, 4 );
-    PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_X_NEG, m, m - 1 - i, 0, 5 );
-    PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_Y_POS, 1, m / 2, 0, 6 );
-    PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_Y_NEG, 1, m / 2, 0, 7 );
-
-    // test 1xN case
-    PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_X_POS, 1, 0, n / 2, 8 );
-    PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_X_NEG, 1, 0, n / 2, 9 );
-    PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_Y_POS, n, 0, i, 10 );
-    PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_Y_NEG, n, 0, n - 1 - i, 11 );
-
-    // test 1x1 case
-    PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_X_POS, 1, 0, 0, 12 );
-    PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_X_NEG, 1, 0, 0, 13 );
-    PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_Y_POS, 1, 0, 0, 14 );
-    PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_Y_NEG, 1, 0, 0, 15 );
+    #define PSIMAGESLICE_TEST(TYPE) \
+    /* test MxN case */ \
+    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_X_POS, m, i, n / 2, 0 ); \
+    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_X_NEG, m, m - 1 - i, n / 2, 1 ); \
+    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_Y_POS, n, m / 2, i, 2 ); \
+    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_Y_NEG, n, m / 2, n - 1 - i, 3 ); \
+    \
+    /* test Mx1 case */ \
+    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_X_POS, m, i, 0, 4 ); \
+    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_X_NEG, m, m - 1 - i, 0, 5 ); \
+    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_Y_POS, 1, m / 2, 0, 6 ); \
+    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_Y_NEG, 1, m / 2, 0, 7 ); \
+    \
+    /* test 1xN case */ \
+    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_X_POS, 1, 0, n / 2, 8 ); \
+    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_X_NEG, 1, 0, n / 2, 9 ); \
+    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_Y_POS, n, 0, i, 10 ); \
+    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_Y_NEG, n, 0, n - 1 - i, 11 ); \
+    \
+    /* test 1x1 case */ \
+    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_X_POS, 1, 0, 0, 12 ); \
+    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_X_NEG, 1, 0, 0, 13 ); \
+    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_Y_POS, 1, 0, 0, 14 ); \
+    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_Y_NEG, 1, 0, 0, 15 ); \
+
+    PSIMAGESLICE_TEST(F32);
+    PSIMAGESLICE_TEST(F64);
+    PSIMAGESLICE_TEST(U16);
+
+    image = psImageAlloc( c, r, PS_TYPE_F32 );
 
     /*
@@ -180,5 +187,4 @@
         return 102;
     }
-
     /*
 
Index: /trunk/psLib/test/image/verified/tst_psImageExtraction.stderr
===================================================================
--- /trunk/psLib/test/image/verified/tst_psImageExtraction.stderr	(revision 2155)
+++ /trunk/psLib/test/image/verified/tst_psImageExtraction.stderr	(revision 2156)
@@ -138,47 +138,45 @@
     Following should be an error.
 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Specified subset range, [200:<LINENO>,100:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
+    Specified statistic can not be NULL.
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Specified slice direction, 5, is invalid.
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Specified subset range, [301:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Specified subset range, [30:<LINENO>,201:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Specified statistic option, 0, is not valid.  Must specify one and only one statistic type.
 <DATE><TIME>|<HOST>|I|testImageSlice
     Following should be an error mask size != image size.
 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Input psImage mask size, 200x300, does not match psImage input size, 300x200.
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error invalid mask type.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
+    Input psImage mask type, psS8, is not the supported mask datatype of psU8.
+<DATE><TIME>|<HOST>|I|testImageSlice
+    Following should be an error invalid image type.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     Specified psImage type, psU8, is not supported.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error invalid mask type.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Input psImage mask size, 2000x1000, does not match psImage input size, 1000x2000.
-<DATE><TIME>|<HOST>|I|testImageSlice
-    Following should be an error invalid image type.
-<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
-    Specified psImage type, psU8, is not supported.
-<DATE><TIME>|<HOST>|E|psLib.sysUtils.psFree
-    Block 12148, allocated at psImage.c:<LINENO>, freed multiple times at tst_psImageExtraction.c:<LINENO>.
 
 ---> TESTPOINT PASSED (psImage{psImageSlice} | tst_psImageExtraction.c)
