Index: unk/psLib/test/image/tst_psImageStats00.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats00.c	(revision 3311)
+++ 	(revision )
@@ -1,204 +1,0 @@
-/*****************************************************************************
-   This routine must ensure that the psHistogram structure is correctly
-   allocated and populated by the psImageHistogram() function.
-*****************************************************************************/
-#include <stdio.h>
-#include "pslib.h"
-#include "psTest.h"
-#include "psMemory.h"
-#include "psImage.h"
-#include "psImageStats.h"
-#define NUM_BINS 20
-#define IMAGE_SIZE 20
-#define N 32
-#define M 64
-
-psS32 main()
-{
-    psHistogram * myHist = NULL;
-    psHistogram *myHist2 = NULL;
-    psImage *tmpImage = NULL;
-    psImage *tmpMask = NULL;
-    psS32 testStatus = true;
-    psS32 memLeaks = 0;
-    psS32 nb = 0;
-    psS32 i = 0;
-    psS32 j = 0;
-    psS32 IMAGE_X_SIZE = 0;
-    psS32 IMAGE_Y_SIZE = 0;
-    psS32 currentId = 0;
-
-    currentId = psMemGetId();
-    for ( nb = 0;nb < 6;nb++ ) {
-        if ( nb == 0 ) {
-            IMAGE_X_SIZE = 1;
-            IMAGE_Y_SIZE = 1;
-        }
-        if ( nb == 1 ) {
-            IMAGE_X_SIZE = 1;
-            IMAGE_Y_SIZE = N;
-        }
-        if ( nb == 2 ) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = 1;
-        }
-        if ( nb == 3 ) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = N;
-        }
-        if ( nb == 4 ) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = M;
-        }
-        if ( nb == 5 ) {
-            IMAGE_X_SIZE = M;
-            IMAGE_Y_SIZE = N;
-        }
-        printf( "*******************************\n" );
-        printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE );
-        printf( "*******************************\n" );
-        /*********************************************************************/
-        /*  Allocate and initialize data structures                      */
-        /*********************************************************************/
-        tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
-
-        for ( i = 0;i < tmpImage->numRows;i++ ) {
-            for ( j = 0;j < tmpImage->numCols;j++ ) {
-                tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j + 0.1 );
-            }
-        }
-        tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
-        for ( i = 0;i < tmpMask->numRows;i++ ) {
-            for ( j = 0;j < tmpMask->numCols;j++ ) {
-                if ( ( i > ( tmpMask->numRows / 2 ) ) &&
-                        ( j > ( tmpMask->numCols / 2 ) ) ) {
-                    tmpMask->data.U8[ i ][ j ] = 1;
-                } else {
-                    tmpMask->data.U8[ i ][ j ] = 0;
-                }
-            }
-        }
-
-        /*************************************************************************/
-        /*  Calculate Histogram with no mask                             */
-        /*************************************************************************/
-        printPositiveTestHeader( stdout,
-                                 "psImageStats functions",
-                                 "Calculate Histogram, no mask" );
-
-        myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
-                                   NUM_BINS );
-        myHist = psImageHistogram( myHist, tmpImage, NULL, 0 );
-        for ( i = 0;i < NUM_BINS;i++ ) {
-            printf( "Bin number %d bounds: (%.1f - %.1f) data (%f)\n", i,
-                    myHist->bounds->data.F32[ i ],
-                    myHist->bounds->data.F32[ i + 1 ],
-                    myHist->nums->data.F32[ i ] );
-        }
-        psFree( myHist );
-
-        psMemCheckCorruption( 1 );
-        printFooter( stdout,
-                     "psImageStats functions",
-                     "Calculate Histogram, no mask",
-                     testStatus );
-
-        /*************************************************************************/
-        /*  Calculate Histogram with mask                                */
-        /*************************************************************************/
-        printPositiveTestHeader( stdout,
-                                 "psImageStats functions",
-                                 "Calculate Histogram with mask" );
-
-        myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
-                                   NUM_BINS );
-        myHist = psImageHistogram( myHist, tmpImage, tmpMask, 1 );
-        for ( i = 0;i < NUM_BINS;i++ ) {
-            printf( "Bin number %d bounds: (%.2f - %.2f) data (%f)\n", i,
-                    myHist->bounds->data.F32[ i ],
-                    myHist->bounds->data.F32[ i + 1 ],
-                    myHist->nums->data.F32[ i ] );
-        }
-
-        psMemCheckCorruption( 1 );
-        printFooter( stdout,
-                     "psImageStats functions",
-                     "Calculate Histogram with mask",
-                     testStatus );
-
-        /*************************************************************************/
-        /*  Deallocate data structures                                   */
-        /*************************************************************************/
-        printPositiveTestHeader( stdout,
-                                 "psImageStats functions",
-                                 "Deallocate the psHistogram/psImage structure." );
-        psFree( myHist );
-        psFree( tmpImage );
-        psFree( tmpMask );
-
-        psMemCheckCorruption( 1 );
-        memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-        if ( 0 != memLeaks ) {
-            psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
-        }
-
-        printFooter( stdout,
-                     "psImageStats functions",
-                     "Deallocate the psHistogram/psImage structure.",
-                     testStatus );
-    }
-    printPositiveTestHeader( stdout,
-                             "psImageStats functions",
-                             "Calling psImageHistogram() with NULL parameters" );
-
-    tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
-    myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ),
-                               NUM_BINS );
-    myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 );
-    if ( myHist2 != NULL ) {
-        printf( "ERROR: myHist2 not equal to NULL\n" );
-    }
-
-    myHist2 = psImageHistogram( myHist, NULL, NULL, 0 );
-    myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 );
-    if ( myHist2 != NULL ) {
-        printf( "ERROR: myHist2 not equal to NULL\n" );
-    }
-
-
-    tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_S8 );
-    for ( i = 0;i < tmpMask->numRows;i++ ) {
-        for ( j = 0;j < tmpMask->numCols;j++ ) {
-            if ( ( i > ( tmpMask->numRows / 2 ) ) &&
-                    ( j > ( tmpMask->numCols / 2 ) ) ) {
-                tmpMask->data.S8[ i ][ j ] = 1;
-            } else {
-                tmpMask->data.S8[ i ][ j ] = 0;
-            }
-        }
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid mask type.");
-    myHist2 = psImageHistogram(myHist,tmpImage,tmpMask,1);
-    if (myHist2 != NULL) {
-        printf("ERROR: myHist2 not equal to NULL\n");
-    }
-
-    psFree( tmpMask );
-    psFree(myHist);
-    psFree(myHist2);
-    psFree( tmpImage );
-    psMemCheckCorruption( 1 );
-
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if ( 0 != memLeaks ) {
-        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
-    }
-
-    printFooter( stdout,
-                 "psImageStats functions",
-                 "Calling psImageHistogram() with NULL parameters",
-                 testStatus );
-
-    return ( !testStatus );
-}
Index: unk/psLib/test/image/tst_psImageStats01.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats01.c	(revision 3311)
+++ 	(revision )
@@ -1,199 +1,0 @@
-/*****************************************************************************
-   This routine must ensure that the psImageStats() routine can correctly
-   call the psVectorStats() routine.  Since the psVectorStats() will be
-   thouroughly tested elsewhere, we will only test psImageStats() with
-   the PS_STAT_SAMPLE_MEAN here.
-*****************************************************************************/
-#include <stdio.h>
-#include "pslib.h"
-#include "psTest.h"
-#include "psMemory.h"
-#include "psImage.h"
-#include "psImageStats.h"
-#define NUM_BINS 20
-#define N 32
-#define M 64
-
-psS32 main()
-{
-    psStats * myStats = NULL;
-    psStats *myStats2 = NULL;
-    psImage *tmpImage = NULL;
-    psImage *tmpMask = NULL;
-    psS32 testStatus = true;
-    psS32 memLeaks = 0;
-    psS32 nb = 0;
-    psS32 i = 0;
-    psS32 j = 0;
-    psS32 IMAGE_X_SIZE = 0;
-    psS32 IMAGE_Y_SIZE = 0;
-    psS32 currentId = 0;
-
-    currentId = psMemGetId();
-    for ( nb = 0;nb < 6;nb++ ) {
-        if ( nb == 0 ) {
-            IMAGE_X_SIZE = 1;
-            IMAGE_Y_SIZE = 1;
-        }
-        if ( nb == 1 ) {
-            IMAGE_X_SIZE = 1;
-            IMAGE_Y_SIZE = N;
-        }
-        if ( nb == 2 ) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = 1;
-        }
-        if ( nb == 3 ) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = N;
-        }
-        if ( nb == 4 ) {
-            IMAGE_X_SIZE = N;
-            IMAGE_Y_SIZE = M;
-        }
-        if ( nb == 5 ) {
-            IMAGE_X_SIZE = M;
-            IMAGE_Y_SIZE = N;
-        }
-        printf( "*******************************\n" );
-        printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE );
-        printf( "*******************************\n" );
-
-        /*************************************************************************/
-        /*  Allocate and initialize data structures                      */
-        /*************************************************************************/
-        tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
-
-        for ( i = 0;i < tmpImage->numRows;i++ ) {
-            for ( j = 0;j < tmpImage->numCols;j++ ) {
-                tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
-            }
-        }
-        tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
-        for ( i = 0;i < tmpMask->numRows;i++ ) {
-            for ( j = 0;j < tmpMask->numCols;j++ ) {
-                if ( ( i > ( tmpMask->numRows / 2 ) ) &&
-                        ( j > ( tmpMask->numCols / 2 ) ) ) {
-                    tmpMask->data.U8[ i ][ j ] = 1;
-                } else {
-                    tmpMask->data.U8[ i ][ j ] = 0;
-                }
-            }
-        }
-
-        myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN );
-        /*************************************************************************/
-        /*  Calculate Sample Mean with no mask                           */
-        /*************************************************************************/
-        printPositiveTestHeader( stdout,
-                                 "psImageStats functions",
-                                 "Calculate Sample Mean, no mask %d" );
-        psStats* tmpStats = myStats;
-        myStats = psImageStats( myStats, tmpImage, NULL, 0 );
-        if ( myStats != tmpStats ) {
-            printf("ERROR: input psStats not equal to return psStats\n");
-            psAbort(__func__,"Failed input psStats equal to returned psStats");
-        }
-        printf( "The sample mean was %.2f\n", myStats->sampleMean );
-
-        psMemCheckCorruption( 1 );
-
-        printFooter( stdout,
-                     "psImageStats functions",
-                     "Calculate Sample Mean, no mask",
-                     testStatus );
-
-        /*************************************************************************/
-        /*  Calculate Sample Mean with mask                              */
-        /*************************************************************************/
-        printPositiveTestHeader( stdout,
-                                 "psImageStats functions",
-                                 "Calculate Sample Mean with mask" );
-
-        myStats = psImageStats( myStats, tmpImage, tmpMask, 1 );
-        printf( "The sample mean was %.2f\n", myStats->sampleMean );
-
-        psMemCheckCorruption( 1 );
-
-        printFooter( stdout,
-                     "psImageStats functions",
-                     "Calculate Sample Mean with mask",
-                     testStatus );
-
-        /*************************************************************************/
-        /*  Deallocate data structures                                   */
-        /*************************************************************************/
-        printPositiveTestHeader( stdout,
-                                 "psImageStats functions",
-                                 "Deallocate the psStats/psImage structure." );
-        psFree( myStats );
-        psFree( tmpImage );
-        psFree( tmpMask );
-
-        psMemCheckCorruption( 1 );
-        memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-        if ( 0 != memLeaks ) {
-            psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
-        }
-
-        printFooter( stdout,
-                     "psImageStats functions",
-                     "Deallocate the psStats/psImage structure.",
-                     testStatus );
-    }
-
-    /*************************************************************************/
-    /*  Test With Various Null Inputs                                        */
-    /*************************************************************************/
-    printPositiveTestHeader( stdout,
-                             "psImageStats functions",
-                             "Test With Various Null Inputs" );
-
-    tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 );
-    tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 );
-    myStats = psStatsAlloc( 0 );
-
-    myStats2 = psImageStats( myStats, NULL, NULL, 0 );
-    if ( myStats2 != NULL ) {
-        printf( "ERROR: myStats2 = psImageStats(myStats, NULL, NULL, 0) != NULL\n" );
-    }
-
-    myStats2 = psImageStats( NULL, tmpImage, NULL, 0 );
-    if ( myStats2 != NULL ) {
-        printf( "ERROR: myStats2 = psImageStats(NULL, tmpImage, NULL, 0) != NULL\n" );
-    }
-
-    myStats2 = psImageStats( myStats, tmpImage, NULL, 0 );
-
-    psFree( myStats );
-    psFree( tmpImage );
-    psFree( tmpMask );
-
-    psMemCheckCorruption( 1 );
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if ( 0 != memLeaks ) {
-        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
-    }
-
-    tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32);
-    tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U32);
-    myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN );
-    myStats2 = psImageStats( myStats, tmpImage, tmpMask, 0 );
-    if ( myStats2 != NULL ) {
-        printf( "ERROR: psImageStats did not return null when mask is invalid type.\n");
-    }
-    psFree(tmpImage);
-    psFree(tmpMask);
-    psFree(myStats);
-    psMemCheckCorruption(1);
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if( memLeaks != 0 ) {
-        psAbort(__func__, "Memory Leaks! (%d leaks)", memLeaks);
-    }
-
-    printFooter( stdout,
-                 "psImageStats functions",
-                 "Test With Various Null Inputs",
-                 testStatus );
-    return ( !testStatus );
-}
Index: unk/psLib/test/image/tst_psImageStats02.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats02.c	(revision 3311)
+++ 	(revision )
@@ -1,146 +1,0 @@
-/*****************************************************************************
-   This routine must ensure that the psImageFitPolynomial() and
-   psImageEvalPolynomial() rotines work correctly.
- 
-   XXX: After you debug, set CHEBY_X_DIM != CHEBY_Y_DIM.
-   XXX: use non-square images.
-*****************************************************************************/
-#include <stdio.h>
-#include "pslib.h"
-#include "psTest.h"
-#include "psMemory.h"
-#include "psImage.h"
-#include "psImageStats.h"
-#include <float.h>
-#include <math.h>
-#define IMAGE_SIZE 64
-#define CHEBY_X_DIM 8
-#define CHEBY_Y_DIM 8
-#define THRESHOLD 10
-psS32 main()
-{
-    psStats * myStats = NULL;
-    psImage *tmpImage = NULL;
-    psImage *outImage = NULL;
-    psImage *nullImage = NULL;
-    psPolynomial2D *my2DPoly = NULL;
-    psPolynomial2D *null2DPoly = NULL;
-    psS32 testStatus = true;
-    psS32 memLeaks = 0;
-    psS32 i = 0;
-    psS32 j = 0;
-    psS32 currentId = 0;
-
-    currentId = psMemGetId();
-    /*************************************************************************/
-    /*  Allocate and initialize data structures                      */
-    /*************************************************************************/
-    tmpImage = psImageAlloc( IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32 );
-    outImage = psImageAlloc( IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32 );
-    for ( i = 0;i < IMAGE_SIZE;i++ ) {
-        for ( j = 0;j < IMAGE_SIZE;j++ ) {
-            tmpImage->data.F32[ i ][ j ] = 4.0;
-            tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j );
-            tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i );
-            outImage->data.F32[ i ][ j ] = 0.0;
-        }
-    }
-    my2DPoly = psPolynomial2DAlloc( CHEBY_X_DIM, CHEBY_Y_DIM, PS_POLYNOMIAL_CHEB );
-    /*************************************************************************/
-    /*  Calculate Chebyshev Polynomials, no mask                     */
-    /*************************************************************************/
-    printPositiveTestHeader( stdout,
-                             "psImageStats functions",
-                             "Calculate Chebyshev Polynomials, no mask" );
-
-    my2DPoly = psImageFitPolynomial( my2DPoly, tmpImage );
-    for ( i = 0;i < CHEBY_X_DIM;i++ ) {
-        for ( j = 0;j < CHEBY_Y_DIM;j++ ) {
-            printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, 0.0001f+my2DPoly->coeff[ i ][ j ] );
-        }
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error message for NULL coeffs argument.");
-    null2DPoly = psImageFitPolynomial( NULL, tmpImage );
-    if ( null2DPoly != NULL ) {
-        printf("ERROR: psImageFitPolynomial did not return NULL with invalid coeffs argument.");
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be a error message for NULL input argument.");
-    null2DPoly = psImageFitPolynomial( null2DPoly, NULL );
-    if ( null2DPoly != NULL ) {
-        printf("ERROR: psImageFitPolynomial did not return NULL with null input image.");
-    }
-
-    psMemCheckCorruption( 1 );
-    printFooter( stdout,
-                 "psImageStats functions",
-                 "Calculate Chebyshev Polynomials, no mask",
-                 testStatus );
-    /*************************************************************************/
-    /*  Evaluate Chebyshev Polynomials, no mask                      */
-    /*************************************************************************/
-    printPositiveTestHeader( stdout,
-                             "psImageStats functions",
-                             "Calculate Chebyshev Polynomials, no mask" );
-
-    outImage = psImageEvalPolynomial( outImage, my2DPoly );
-    for ( i = 0;i < IMAGE_SIZE;i++ ) {
-        for ( j = 0;j < IMAGE_SIZE;j++ ) {
-
-            //             printf("pixel[%d][%d] is (%f, %f)\n", i, j,
-            //                     tmpImage->data.F32[i][j],
-            //                     outImage->data.F32[i][j]);
-            if ( fabs( outImage->data.F32[ i ][ j ] - tmpImage->data.F32[ i ][ j ] ) > THRESHOLD ) {
-                printf( "Pixel (%d, %d) is %.2f, should be %.2f\n", i, j,
-                        outImage->data.F32[ i ][ j ],
-                        tmpImage->data.F32[ i ][ j ] );
-            }
-
-        }
-    }
-
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error message for NULL coeffs argument.");
-    nullImage = psImageEvalPolynomial( outImage, NULL );
-    if ( nullImage != NULL ) {
-        printf("ERROR: psImageEvalPolynomial did not return NULL with invalid coeffs argument.");
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be a error message for NULL input argument.");
-    nullImage = psImageEvalPolynomial( NULL, my2DPoly );
-    if ( nullImage != NULL ) {
-        printf("ERROR: psImageEvalPolynomial did not return NULL with null input image.");
-    }
-
-
-    psMemCheckCorruption( 1 );
-    printFooter( stdout,
-                 "psImageStats functions",
-                 "Calculate Chebyshev Polynomials, no mask",
-                 testStatus );
-
-    /*************************************************************************/
-    /*  Deallocate data structures                                   */
-    /*************************************************************************/
-    printPositiveTestHeader( stdout,
-                             "psImageStats functions",
-                             "Deallocate the psStats/psImage structure." );
-    psFree( myStats );
-    psFree( tmpImage );
-    psFree( outImage );
-    psFree( my2DPoly );
-
-    psMemCheckCorruption( 1 );
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if ( 0 != memLeaks ) {
-        psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );
-    }
-
-    printFooter( stdout,
-                 "psImageStats functions",
-                 "Deallocate the psStats/psImage structure.",
-                 testStatus );
-
-    return ( !testStatus );
-}
Index: unk/psLib/test/image/tst_psImageStats03.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats03.c	(revision 3311)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*****************************************************************************
-    This routine must ensure that the psImagePixelInterpolation() routine
-    works correctly.
- *****************************************************************************/
-#include <stdio.h>
-#include "pslib.h"
-#include "psTest.h"
-#include "psMemory.h"
-#include "psImage.h"
-#include "psImageStats.h"
-#include <float.h>
-#include <math.h>
-#define IMAGE_SIZE 10
-
-psS32 main()
-{
-    psImage *tmpImage   = NULL;
-    psS32 testStatus      = true;
-    psS32 memLeaks        = 0;
-    psS32 i               = 0;
-    psS32 j               = 0;
-    float pixel         = 0.0;
-    float x             = 0.0;
-    float y             = 0.0;
-    psS32 currentId       = psMemGetId();
-
-    /*************************************************************************/
-    /*  Allocate and initialize data structures                      */
-    /*************************************************************************/
-    printPositiveTestHeader(stdout,
-                            "psImageStats functions",
-                            "psImagePixelInterpolation()");
-
-    tmpImage = psImageAlloc(IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32);
-    for (i=0;i<IMAGE_SIZE;i++) {
-        for (j=0;j<IMAGE_SIZE;j++) {
-            tmpImage->data.F32[i][j] = 4.0;
-            tmpImage->data.F32[i][j] = (float) (i + j) + (4.0 * (float) i);
-            tmpImage->data.F32[i][j] = (float) (i + j);
-            printf("%.1f ", tmpImage->data.F32[i][j]);
-        }
-        printf("\n");
-    }
-    for (i=0;i<IMAGE_SIZE-1;i++) {
-        for (j=0;j<IMAGE_SIZE-1;j++) {
-            x = 0.2 + (float) i;
-            y = 0.2 + (float) j;
-            pixel = psImagePixelInterpolate(tmpImage,
-                                            x, y,
-                                            NULL, 0,
-                                            0,
-                                            PS_INTERPOLATE_BILINEAR);
-            printf("%.1f ", pixel);
-        }
-        printf("\n");
-    }
-
-    for (i=0;i<IMAGE_SIZE-1;i++) {
-        for (j=0;j<IMAGE_SIZE-1;j++) {
-            x = 0.2 + (float) i;
-            y = 0.2 + (float) j;
-            pixel = psImagePixelInterpolate(tmpImage,
-                                            x, y,
-                                            NULL,0,
-                                            0,
-                                            PS_INTERPOLATE_BILINEAR);
-            printf("image[%.1f][%.1f] is interpolated at %.1f\n", x, y, pixel);
-        }
-    }
-
-
-    psFree(tmpImage);
-    psMemCheckCorruption(1);
-    printFooter(stdout,
-                "psImageStats functions",
-                "psImagePixelInterpolation()",
-                testStatus);
-
-    /*************************************************************************/
-    /*  Deallocate data structures                                   */
-    /*************************************************************************/
-    // GUS: replace with psFree()?
-    //    psImageFree(tmpImage);
-
-    psMemCheckCorruption(1);
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (0 != memLeaks) {
-        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
-    }
-
-    return (!testStatus);
-}
Index: unk/psLib/test/image/tst_psImageStats04.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats04.c	(revision 3311)
+++ 	(revision )
@@ -1,185 +1,0 @@
-/*****************************************************************************
-This routine must ensure that the 
-    psImageFitPolynomial()
-    psImageEvalPolynomial()
-functions work correctly.
- 
-XXX: We do not check image pixels.
- *****************************************************************************/
-#include <stdio.h>
-#include "pslib.h"
-#include "psTest.h"
-#include "psMemory.h"
-#include "psImage.h"
-#include "psImageStats.h"
-#include <float.h>
-#include <math.h>
-#define IMAGE_SIZE 5
-#define NUM_COLS IMAGE_SIZE
-#define NUM_ROWS IMAGE_SIZE
-#define ERROR_TOL 0.1
-#define A 1.0
-#define B 2.0
-#define C 3.0
-#define D 4.0
-#define E 5.0
-#define F 6.0
-
-#define I_POLY(X, Y) \
-((A) + (B * X) + (C * Y) + (D * X * Y) + (E * X * X) + (F * Y * Y)) \
-
-psS32 FitChebyF32(int numCols, int numRows)
-{
-    psImage *tmpImage     = NULL;
-    psImage *outImage     = NULL;
-    psS32 testStatus      = true;
-    psS32 memLeaks        = 0;
-    psS32 i               = 0;
-    psS32 j               = 0;
-    psS32 currentId       = psMemGetId();
-    float chi2 = 0.0;
-
-
-    printf("psImageFitPolynomial(), psImageEvalPolynom(): (%d by %d)\n", numRows, numCols);
-
-    /*************************************************************************/
-    /*  Allocate and initialize data structures                      */
-    /*************************************************************************/
-
-    printPositiveTestHeader(stdout,
-                            "psImageStats functions",
-                            "psImageFitPolynomial(), psImageEvalPolynom()");
-
-    tmpImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    outImage = psImageAlloc(numCols, numRows, PS_TYPE_F32);
-    for (i=0;i<numRows;i++) {
-        for (j=0;j<numCols;j++) {
-            tmpImage->data.F32[i][j] = I_POLY(((float) i), ((float) j));
-        }
-    }
-
-    psPolynomial2D *chebys = psPolynomial2DAlloc(5, 5, PS_POLYNOMIAL_CHEB);
-
-    chebys = psImageFitPolynomial(chebys, tmpImage);
-
-    outImage = psImageEvalPolynomial(outImage, chebys);
-
-    chi2 = 0.0;
-    for (i=0;i<numRows;i++) {
-        for (j=0;j<numCols;j++) {
-            float expect = tmpImage->data.F32[i][j];
-            float actual = outImage->data.F32[i][j];
-            chi2+= (actual-expect) * (actual-expect);
-            if (fabs((actual - expect) / expect) > ERROR_TOL) {
-                printf("pixel [%d][%d] is %.2f should be %.2f\n", i, j, actual, expect);
-            }
-        }
-    }
-    chi2/= ((float) (numCols * numRows));
-    printf("The chi-squared per pixel is %f\n", chi2);
-
-    psFree(tmpImage);
-    psFree(outImage);
-    psFree(chebys);
-    psMemCheckCorruption(1);
-    printFooter(stdout,
-                "psImageStats functions",
-                "psImagePixelInterpolation()",
-                testStatus);
-
-    /*************************************************************************/
-    /*  Deallocate data structures                                   */
-    /*************************************************************************/
-    psMemCheckCorruption(1);
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (0 != memLeaks) {
-        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
-    }
-
-    return(!testStatus);
-}
-
-psS32 FitChebyF64(int numCols, int numRows)
-{
-    psImage *tmpImage     = NULL;
-    psImage *outImage     = NULL;
-    psS32 testStatus      = true;
-    psS32 memLeaks        = 0;
-    psS32 i               = 0;
-    psS32 j               = 0;
-    psS32 currentId       = psMemGetId();
-    double chi2 = 0.0;
-
-
-    printf("psImageFitPolynomial(), psImageEvalPolynom(): (%d by %d)\n", numRows, numCols);
-
-    /*************************************************************************/
-    /*  Allocate and initialize data structures                      */
-    /*************************************************************************/
-
-    printPositiveTestHeader(stdout,
-                            "psImageStats functions",
-                            "psImageFitPolynomial(), psImageEvalPolynom()");
-
-    tmpImage = psImageAlloc(numCols, numRows, PS_TYPE_F64);
-    outImage = psImageAlloc(numCols, numRows, PS_TYPE_F64);
-    for (i=0;i<numRows;i++) {
-        for (j=0;j<numCols;j++) {
-            tmpImage->data.F64[i][j] = I_POLY(((double) i), ((double) j));
-        }
-    }
-
-    psPolynomial2D *chebys = psPolynomial2DAlloc(5, 5, PS_POLYNOMIAL_CHEB);
-
-    chebys = psImageFitPolynomial(chebys, tmpImage);
-
-    outImage = psImageEvalPolynomial(outImage, chebys);
-
-    chi2 = 0.0;
-    for (i=0;i<numRows;i++) {
-        for (j=0;j<numCols;j++) {
-            double expect = tmpImage->data.F64[i][j];
-            double actual = outImage->data.F64[i][j];
-            chi2+= (actual-expect) * (actual-expect);
-            if (fabs((actual - expect) / expect) > ERROR_TOL) {
-                printf("pixel [%d][%d] is %.2f should be %.2f\n", i, j, actual, expect);
-            }
-        }
-    }
-    chi2/= ((double) (numCols * numRows));
-    printf("The chi-squared per pixel is %f\n", chi2);
-
-    psFree(tmpImage);
-    psFree(outImage);
-    psFree(chebys);
-    psMemCheckCorruption(1);
-    printFooter(stdout,
-                "psImageStats functions",
-                "psImagePixelInterpolation()",
-                testStatus);
-
-    /*************************************************************************/
-    /*  Deallocate data structures                                   */
-    /*************************************************************************/
-    psMemCheckCorruption(1);
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (0 != memLeaks) {
-        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
-    }
-
-    return(!testStatus);
-}
-
-int main()
-{
-    FitChebyF32(1, 1);
-    FitChebyF32(1, NUM_ROWS);
-    FitChebyF32(1, 1);
-    FitChebyF32(NUM_COLS, 1);
-    FitChebyF32(NUM_COLS, NUM_ROWS);
-    FitChebyF64(1, 1);
-    FitChebyF64(1, NUM_ROWS);
-    FitChebyF64(1, 1);
-    FitChebyF64(NUM_COLS, 1);
-    FitChebyF64(NUM_COLS, NUM_ROWS);
-}
