IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2156


Ignore:
Timestamp:
Oct 15, 2004, 10:00:56 AM (22 years ago)
Author:
desonia
Message:

fixed test of psImageSlice.

Location:
trunk/psLib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/psLib.kdevses

    r2144 r2156  
    22<!DOCTYPE KDevPrjSession>
    33<KDevPrjSession>
    4  <DocsAndViews NumberOfDocuments="1" >
     4 <DocsAndViews NumberOfDocuments="3" >
    55  <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/Doxyfile" >
    6    <View0 line="25" Type="???" >
    7     <AdditionalSettings Top="2" Width="1165" Attach="1" Height="926" Left="2" MinMaxMode="0" />
     6   <View0 line="27" Type="???" >
     7    <AdditionalSettings Top="2" Width="1212" Attach="1" Height="1027" Left="2" MinMaxMode="0" />
    88   </View0>
    99  </Doc0>
     10  <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageExtraction.c" >
     11   <View0 line="311" Type="???" >
     12    <AdditionalSettings Top="2" Width="1212" Attach="1" Height="752" Left="2" MinMaxMode="0" />
     13   </View0>
     14  </Doc1>
     15  <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageErrors.dat" >
     16   <View0 line="21" Type="???" >
     17    <AdditionalSettings Top="2" Width="1212" Attach="1" Height="1001" Left="2" MinMaxMode="0" />
     18   </View0>
     19  </Doc2>
    1020 </DocsAndViews>
    1121 <pluginList>
  • trunk/psLib/test/image/tst_psImageExtraction.c

    r2093 r2156  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-10-13 23:34:58 $
     8*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-10-15 20:00:56 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4444int testImageSlice(void)
    4545{
    46     const int r = 1000;
    47     const int c = 2000;
     46    const int r = 200;
     47    const int c = 300;
    4848    const int m = r / 2 -1;
    4949    const int n = r / 4 -1;
     
    9999    \
    100100    for (int i=0;i<out->n;i++) { \
    101         if (fabs(out->data.F64[i]-image->data.F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF32)r) { \
     101        if (fabs(out->data.F64[i]-image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF64)r) { \
    102102            psError(__func__,"Improper result at position %d.  Got %g, expected %g",i, \
    103                     out->data.F64[i],image->data.F32[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \
     103                    out->data.F64[i],image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]); \
    104104            return TESTNUM*4+3; \
    105105        } \
     
    120120    psFree(image);
    121121
    122     // test MxN case
    123     PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_X_POS, m, i, n / 2, 0 );
    124     PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_X_NEG, m, m - 1 - i, n / 2, 1 );
    125     PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_Y_POS, n, m / 2, i, 2 );
    126     PSIMAGESLICE_TEST1(F32, m, n, PS_CUT_Y_NEG, n, m / 2, n - 1 - i, 3 );
    127 
    128     // test Mx1 case
    129     PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_X_POS, m, i, 0, 4 );
    130     PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_X_NEG, m, m - 1 - i, 0, 5 );
    131     PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_Y_POS, 1, m / 2, 0, 6 );
    132     PSIMAGESLICE_TEST1(F32, m, 1, PS_CUT_Y_NEG, 1, m / 2, 0, 7 );
    133 
    134     // test 1xN case
    135     PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_X_POS, 1, 0, n / 2, 8 );
    136     PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_X_NEG, 1, 0, n / 2, 9 );
    137     PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_Y_POS, n, 0, i, 10 );
    138     PSIMAGESLICE_TEST1(F32, 1, n, PS_CUT_Y_NEG, n, 0, n - 1 - i, 11 );
    139 
    140     // test 1x1 case
    141     PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_X_POS, 1, 0, 0, 12 );
    142     PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_X_NEG, 1, 0, 0, 13 );
    143     PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_Y_POS, 1, 0, 0, 14 );
    144     PSIMAGESLICE_TEST1(F32, 1, 1, PS_CUT_Y_NEG, 1, 0, 0, 15 );
     122    #define PSIMAGESLICE_TEST(TYPE) \
     123    /* test MxN case */ \
     124    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_X_POS, m, i, n / 2, 0 ); \
     125    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_X_NEG, m, m - 1 - i, n / 2, 1 ); \
     126    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_Y_POS, n, m / 2, i, 2 ); \
     127    PSIMAGESLICE_TEST1(TYPE, m, n, PS_CUT_Y_NEG, n, m / 2, n - 1 - i, 3 ); \
     128    \
     129    /* test Mx1 case */ \
     130    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_X_POS, m, i, 0, 4 ); \
     131    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_X_NEG, m, m - 1 - i, 0, 5 ); \
     132    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_Y_POS, 1, m / 2, 0, 6 ); \
     133    PSIMAGESLICE_TEST1(TYPE, m, 1, PS_CUT_Y_NEG, 1, m / 2, 0, 7 ); \
     134    \
     135    /* test 1xN case */ \
     136    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_X_POS, 1, 0, n / 2, 8 ); \
     137    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_X_NEG, 1, 0, n / 2, 9 ); \
     138    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_Y_POS, n, 0, i, 10 ); \
     139    PSIMAGESLICE_TEST1(TYPE, 1, n, PS_CUT_Y_NEG, n, 0, n - 1 - i, 11 ); \
     140    \
     141    /* test 1x1 case */ \
     142    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_X_POS, 1, 0, 0, 12 ); \
     143    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_X_NEG, 1, 0, 0, 13 ); \
     144    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_Y_POS, 1, 0, 0, 14 ); \
     145    PSIMAGESLICE_TEST1(TYPE, 1, 1, PS_CUT_Y_NEG, 1, 0, 0, 15 ); \
     146
     147    PSIMAGESLICE_TEST(F32);
     148    PSIMAGESLICE_TEST(F64);
     149    PSIMAGESLICE_TEST(U16);
     150
     151    image = psImageAlloc( c, r, PS_TYPE_F32 );
    145152
    146153    /*
     
    180187        return 102;
    181188    }
    182 
    183189    /*
    184190
  • trunk/psLib/test/image/verified/tst_psImageExtraction.stderr

    r2105 r2156  
    138138    Following should be an error.
    139139<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    140     Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
    141 <DATE><TIME>|<HOST>|I|testImageSlice
    142     Following should be an error.
    143 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    144     Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
    145 <DATE><TIME>|<HOST>|I|testImageSlice
    146     Following should be an error.
    147 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    148     Specified subset range, [200:<LINENO>,100:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
    149 <DATE><TIME>|<HOST>|I|testImageSlice
    150     Following should be an error.
    151 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    152     Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
    153 <DATE><TIME>|<HOST>|I|testImageSlice
    154     Following should be an error.
    155 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    156     Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
    157 <DATE><TIME>|<HOST>|I|testImageSlice
    158     Following should be an error.
    159 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    160     Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
    161 <DATE><TIME>|<HOST>|I|testImageSlice
    162     Following should be an error.
    163 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    164     Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
    165 <DATE><TIME>|<HOST>|I|testImageSlice
    166     Following should be an error.
    167 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    168     Input psImage mask size, 2000x1000, does not match psImage input size, 1919250543x543519841.
     140    Specified statistic can not be NULL.
     141<DATE><TIME>|<HOST>|I|testImageSlice
     142    Following should be an error.
     143<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     144    Specified slice direction, 5, is invalid.
     145<DATE><TIME>|<HOST>|I|testImageSlice
     146    Following should be an error.
     147<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     148    Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     149<DATE><TIME>|<HOST>|I|testImageSlice
     150    Following should be an error.
     151<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     152    Specified subset range, [301:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     153<DATE><TIME>|<HOST>|I|testImageSlice
     154    Following should be an error.
     155<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     156    Specified subset range, [30:<LINENO>,201:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     157<DATE><TIME>|<HOST>|I|testImageSlice
     158    Following should be an error.
     159<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     160    Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     161<DATE><TIME>|<HOST>|I|testImageSlice
     162    Following should be an error.
     163<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     164    Specified subset range, [30:<LINENO>,20:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>].
     165<DATE><TIME>|<HOST>|I|testImageSlice
     166    Following should be an error.
     167<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     168    Specified statistic option, 0, is not valid.  Must specify one and only one statistic type.
    169169<DATE><TIME>|<HOST>|I|testImageSlice
    170170    Following should be an error mask size != image size.
    171171<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     172    Input psImage mask size, 200x300, does not match psImage input size, 300x200.
     173<DATE><TIME>|<HOST>|I|testImageSlice
     174    Following should be an error invalid mask type.
     175<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
     176    Input psImage mask type, psS8, is not the supported mask datatype of psU8.
     177<DATE><TIME>|<HOST>|I|testImageSlice
     178    Following should be an error invalid image type.
     179<DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    172180    Specified psImage type, psU8, is not supported.
    173 <DATE><TIME>|<HOST>|I|testImageSlice
    174     Following should be an error invalid mask type.
    175 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    176     Input psImage mask size, 2000x1000, does not match psImage input size, 1000x2000.
    177 <DATE><TIME>|<HOST>|I|testImageSlice
    178     Following should be an error invalid image type.
    179 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice
    180     Specified psImage type, psU8, is not supported.
    181 <DATE><TIME>|<HOST>|E|psLib.sysUtils.psFree
    182     Block 12148, allocated at psImage.c:<LINENO>, freed multiple times at tst_psImageExtraction.c:<LINENO>.
    183181
    184182---> TESTPOINT PASSED (psImage{psImageSlice} | tst_psImageExtraction.c)
Note: See TracChangeset for help on using the changeset viewer.