IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 15, 2005, 10:09:03 AM (20 years ago)
Author:
gusciora
Message:

SubtractBias was recoded. Significant mods to removeBadPixels.
Additional mods to other files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/detrend/tst_pmMaskBadPixels.c

    r5169 r5516  
    1717 *  @author Ross Harman, MHPCC
    1818 *
    19  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    20  *  @date $Date: 2005-09-28 20:42:52 $
     19 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     20 *  @date $Date: 2005-11-15 20:09:03 $
    2121 *
    2222 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232printf(STRING);                                                                                              \
    3333printf("\n");                                                                                                \
    34 for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
    35     for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
    36         if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                     \
    37             printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));                 \
    38         } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                                  \
    39             printf("%d", (int)IMAGE->data.TYPE[i][j]);                                                       \
     34for(int i=(IMAGE)->numRows-1; i>-1; i--) {                                                                     \
     35    for(int j=0; j<(IMAGE)->numCols; j++) {                                                                    \
     36        if(PS_IS_PSELEMTYPE_COMPLEX((IMAGE)->type.type)) {                                                     \
     37            printf("%f+%fi ", creal((IMAGE)->data.TYPE[i][j]), cimag((IMAGE)->data.TYPE[i][j]));                 \
     38        } else if(PS_IS_PSELEMTYPE_INT((IMAGE)->type.type)) {                                                  \
     39            printf("%d", (int)(IMAGE)->data.TYPE[i][j]);                                                       \
    4040        } else {                                                                                             \
    41             printf("%f", (double)IMAGE->data.TYPE[i][j]);                                                    \
     41            printf("%f", (double)(IMAGE)->data.TYPE[i][j]);                                                    \
    4242        }                                                                                                    \
    4343    }                                                                                                        \
     
    4848
    4949#define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS)                                                    \
    50 psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                          \
    51 for(int i=0; i<NAME->numRows; i++) {                                                                         \
    52     for(int j=0; j<NAME->numCols; j++) {                                                                     \
    53         NAME->data.TYPE[i][j] = VALUE;                                                                       \
     50(NAME) = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                             \
     51for(int i=0; i<(NAME)->numRows; i++) {                                                                         \
     52    for(int j=0; j<(NAME)->numCols; j++) {                                                                     \
     53        (NAME)->data.TYPE[i][j] = VALUE;                                                                       \
    5454    }                                                                                                        \
    5555}
    56 
    5756
    5857static int testMaskBadPixels1(void);
     
    8079                              {testMaskBadPixels9, 885, "pmMaskBadPixels - Attempt to use offset greater than input image", 0, false},
    8180                              {testMaskBadPixels10, 885, "pmMaskBadPixels - Attempt to use complex input image", 0, false},
    82                               {testMaskBadPixels11, 885, "pmMaskBadPixels - Attempt to use non-mask type mask image", 0, false},
     81                              {testMaskBadPixels11, 885, "pmMaskBadPixels - Attempt to use non-mask type mask image", 0, false        },
    8382                              {NULL}
    8483                          };
    8584
     85/*
     86    #define PS_TYPE_MASK PS_TYPE_U8
     87    #define PS_TYPE_MASK_DATA U8
     88    #define PS_TYPE_MASK_NAME "psU8"
     89*/
    8690
    8791int main(int argc, char* argv[])
     
    9296
    9397
     98#define NUM_ROWS 50
     99#define NUM_COLS 50
     100#define DEFAULT_IMAGE_VAL 0.0
     101#define DEFAULT_MASK_VAL 0
     102#define MASK_VAL 1
     103#define SAT_VAL  100.0
     104#define GROW_VAL 1
     105#define GROW_RAD 10
    94106int testMaskBadPixels1( void )
    95107{
     108    //
    96109    // Test A - Create mask based on maskVal argument
    97     CREATE_AND_SET_IMAGE(inImage1,F64,0,50,50);
    98     CREATE_AND_SET_IMAGE(mask1,U8,0,50,50)
    99     //    pmReadout *inReadout = pmReadoutAlloc(0, 0, inImage1);
    100     pmReadout *inReadout = pmReadoutAlloc(NULL);
    101     inReadout->row0 = 0;
    102     inReadout->col0 = 0;
    103     inReadout->image = inImage1;
    104     mask1->data.PS_TYPE_MASK_DATA[24][24]=1;
    105     PRINT_MATRIX(mask1, U8, "Data mask:");
    106     pmMaskBadPixels(inReadout, mask1, 1, 100.0, 0, 0);
     110    //
     111
     112    pmReadout *inReadout = pmReadoutAlloc(NULL);
     113    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     114    inReadout->image->row0 = 0;
     115    inReadout->image->col0 = 0;
     116    inReadout->row0 = 0;
     117    inReadout->col0 = 0;
     118
     119    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     120    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     121    maskReadout->image->data.PS_TYPE_MASK_DATA[NUM_ROWS/2][NUM_COLS/2]=1;
     122    maskReadout->image->row0 = 0;
     123    maskReadout->image->col0 = 0;
     124
     125    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
     126
     127    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     128    PRINT_MATRIX(inReadout->mask, PS_TYPE_MASK_DATA, "Resulting mask:");
     129
     130    psFree(inReadout);
     131    psFree(maskReadout);
     132
     133    return 0;
     134}
     135
     136int testMaskBadPixels2( void )
     137{
     138    //
     139    // Test B - Create mask based on saturation argument
     140    //
     141
     142    pmReadout *inReadout = pmReadoutAlloc(NULL);
     143    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     144    inReadout->image->row0 = 0;
     145    inReadout->image->col0 = 0;
     146    inReadout->row0 = 0;
     147    inReadout->col0 = 0;
     148    inReadout->image->data.F32[NUM_ROWS/2][NUM_COLS/2] = 150.0;
     149
     150    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     151    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     152
     153    //PS_IMAGE_PRINT_F32(inReadout->image);
     154    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
     155    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
    107156    PRINT_MATRIX(inReadout->mask, U8, "Resulting mask:");
    108     psFree(mask1);
    109     psFree(inReadout);
    110 
    111     return 0;
    112 }
    113 
    114 int testMaskBadPixels2( void )
    115 {
    116     // Test B - Create mask based on saturation argument
    117     CREATE_AND_SET_IMAGE(inImage2,F64,150.0,50,50);
    118     CREATE_AND_SET_IMAGE(mask2,U8,0,50,50)
    119     //    pmReadout *inReadout2 = pmReadoutAlloc(0, 0, inImage2);
    120     pmReadout *inReadout2 = pmReadoutAlloc(NULL);
    121     inReadout2->row0 = 0;
    122     inReadout2->col0 = 0;
    123     inReadout2->image = inImage2;
    124     PRINT_MATRIX(mask2, U8, "Data mask:");
    125     pmMaskBadPixels(inReadout2, mask2, 0, 100.0, 0, 0);
    126     PRINT_MATRIX(inReadout2->mask, U8, "Resulting mask:");
    127     psFree(mask2);
    128     psFree(inReadout2);
     157
     158    psFree(inReadout);
     159    psFree(maskReadout);
    129160
    130161    return 0;
     
    133164int testMaskBadPixels3( void )
    134165{
     166    //
    135167    // Test C - Create mask based on growVal and grow arguments
    136     CREATE_AND_SET_IMAGE(inImage3,F64,50.0,50,50);
    137     CREATE_AND_SET_IMAGE(mask3,U8,0,50,50)
    138     //    pmReadout *inReadout3 = pmReadoutAlloc(0, 0, inImage3);
    139     pmReadout *inReadout3 = pmReadoutAlloc(NULL);
    140     inReadout3->row0 = 0;
    141     inReadout3->col0 = 0;
    142     inReadout3->image = inImage3;
    143     mask3->data.PS_TYPE_MASK_DATA[24][24]=1;
    144     mask3->data.PS_TYPE_MASK_DATA[4][3]=1;
    145     mask3->data.PS_TYPE_MASK_DATA[4][46]=1;
    146     PRINT_MATRIX(mask3, U8, "Data mask:");
    147     pmMaskBadPixels(inReadout3, mask3, 0, 100.0, 1, 10);
    148     PRINT_MATRIX(inReadout3->mask, U8, "Resulting mask:");
    149     psFree(mask3);
    150     psFree(inReadout3);
     168    //
     169
     170    pmReadout *inReadout = pmReadoutAlloc(NULL);
     171    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     172    inReadout->image->row0 = 0;
     173    inReadout->image->col0 = 0;
     174    inReadout->row0 = 0;
     175    inReadout->col0 = 0;
     176    inReadout->image->data.F32[NUM_ROWS/2][NUM_COLS/2]=GROW_VAL;
     177    inReadout->image->data.F32[NUM_ROWS/4][NUM_COLS/4]=GROW_VAL;
     178    inReadout->image->data.F32[NUM_ROWS/4][NUM_COLS-(NUM_COLS/4)]=GROW_VAL;
     179
     180    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     181    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS);
     182
     183    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
     184    //PS_IMAGE_PRINT_F32(inReadout->image);
     185    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     186    PRINT_MATRIX(inReadout->mask, U8, "Resulting mask:");
     187
     188    psFree(inReadout);
     189    psFree(maskReadout);
    151190
    152191    return 0;
     
    155194int testMaskBadPixels4( void )
    156195{
     196    //
    157197    // Test D - Auto Create mask based on maskVal argument
    158     CREATE_AND_SET_IMAGE(inImage4,F64,50.0,50,50);
    159     CREATE_AND_SET_IMAGE(mask4,U8,0,50,50)
    160     CREATE_AND_SET_IMAGE(mask4i,U8,0,50,50)
    161     //    pmReadout *inReadout4 = pmReadoutAlloc(0, 0, inImage4);
    162     pmReadout *inReadout4 = pmReadoutAlloc(NULL);
    163     inReadout4->row0 = 0;
    164     inReadout4->col0 = 0;
    165     inReadout4->image = inImage4;
    166     inReadout4->mask = mask4i;
    167     mask4->data.PS_TYPE_MASK_DATA[24][24]=1;
    168     PRINT_MATRIX(mask4, U8, "Data mask:");
    169     pmMaskBadPixels(inReadout4, mask4, 0, 100.0, 1, 10);
    170     PRINT_MATRIX(inReadout4->mask, U8, "Resulting mask:");
    171     psFree(mask4);
    172     psFree(inReadout4);
     198    //
     199
     200    pmReadout *inReadout = pmReadoutAlloc(NULL);
     201    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     202    inReadout->image->row0 = 0;
     203    inReadout->image->col0 = 0;
     204    inReadout->row0 = 0;
     205    inReadout->col0 = 0;
     206
     207    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     208    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     209    maskReadout->image->data.PS_TYPE_MASK_DATA[NUM_ROWS/2][NUM_COLS/2]=1;
     210
     211    PRINT_MATRIX(maskReadout->image, U8, "Data mask:");
     212    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     213    PRINT_MATRIX(inReadout->mask, U8, "Resulting mask:");
     214
     215    psFree(inReadout);
     216    psFree(maskReadout);
    173217
    174218    return 0;
     
    177221int testMaskBadPixels5( void )
    178222{
     223    //
    179224    // Test E - Attempt to use null mask
    180     CREATE_AND_SET_IMAGE(inImage5,F64,50.0,50,50);
    181     //    pmReadout *inReadout5 = pmReadoutAlloc(0, 0, inImage5);
    182     pmReadout *inReadout5 = pmReadoutAlloc(NULL);
    183     inReadout5->row0 = 0;
    184     inReadout5->col0 = 0;
    185     inReadout5->image = inImage5;
    186     pmMaskBadPixels(inReadout5, NULL, 0, 100.0, 1, 10);
    187     psFree(inReadout5);
     225    //
     226
     227    pmReadout *inReadout = pmReadoutAlloc(NULL);
     228    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     229    inReadout->image->row0 = 0;
     230    inReadout->image->col0 = 0;
     231    inReadout->row0 = 0;
     232    inReadout->col0 = 0;
     233
     234    pmMaskBadPixels(inReadout, NULL, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     235    psFree(inReadout);
    188236
    189237    return 0;
     
    192240int testMaskBadPixels6( void )
    193241{
     242    //
    194243    // Test F - Attempt tp use null input image
    195     CREATE_AND_SET_IMAGE(mask6,U8,0,50,50)
    196     //    pmReadout *inReadout6 = pmReadoutAlloc(0, 0, NULL);
    197     pmReadout *inReadout6 = pmReadoutAlloc(NULL);
    198     inReadout6->row0 = 0;
    199     inReadout6->col0 = 0;
    200     inReadout6->mask = mask6;
    201     pmMaskBadPixels(inReadout6, mask6, 0, 100.0, 1, 10);
    202     psFree(inReadout6);
     244    //
     245
     246    pmReadout *inReadout = pmReadoutAlloc(NULL);
     247    inReadout->row0 = 0;
     248    inReadout->col0 = 0;
     249
     250    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     251    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     252
     253    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     254
     255    psFree(inReadout);
     256    psFree(maskReadout);
    203257
    204258    return 0;
     
    207261int testMaskBadPixels7( void )
    208262{
     263    //
    209264    // Test G - Attempt to use input image bigger than mask
    210     CREATE_AND_SET_IMAGE(inImage7,F64,0.0,60,60);
    211     CREATE_AND_SET_IMAGE(mask7,U8,0,50,50)
    212     CREATE_AND_SET_IMAGE(mask7i,U8,0,50,50)
    213     //    pmReadout *inReadout7 = pmReadoutAlloc(0, 0, inImage7);
    214     pmReadout *inReadout7 = pmReadoutAlloc(NULL);
    215     inReadout7->row0 = 0;
    216     inReadout7->col0 = 0;
    217     inReadout7->image = inImage7;
    218     inReadout7->mask = mask7i;
    219     pmMaskBadPixels(inReadout7, mask7, 0, 100.0, 1, 10);
    220     psFree(mask7);
    221     psFree(inReadout7);
     265    //
     266
     267    pmReadout *inReadout = pmReadoutAlloc(NULL);
     268    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS+10, NUM_COLS+10);
     269    inReadout->image->row0 = 0;
     270    inReadout->image->col0 = 0;
     271    inReadout->row0 = 0;
     272    inReadout->col0 = 0;
     273
     274    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     275    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     276
     277    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     278
     279    psFree(inReadout);
     280    psFree(maskReadout);
    222281
    223282    return 0;
     
    226285int testMaskBadPixels8( void )
    227286{
    228     // Test H - Attempt to use input image mask bigger than mask
    229     CREATE_AND_SET_IMAGE(inImage8,F64,0.0,50,50);
    230     CREATE_AND_SET_IMAGE(mask8,U8,0,50,50)
    231     CREATE_AND_SET_IMAGE(mask8i,U8,0,60,60)
    232     //    pmReadout *inReadout8 = pmReadoutAlloc(0, 0, inImage8);
    233     pmReadout *inReadout8 = pmReadoutAlloc(NULL);
    234     inReadout8->row0 = 0;
    235     inReadout8->col0 = 0;
    236     inReadout8->image = inImage8;
    237     inReadout8->mask = mask8i;
    238     pmMaskBadPixels(inReadout8, mask8, 0, 100.0, 1, 10);
    239     psFree(mask8);
    240     psFree(inReadout8);
     287    //
     288    // Test H - Attempt to use mask bigger than image
     289    //
     290
     291    pmReadout *inReadout = pmReadoutAlloc(NULL);
     292    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     293    inReadout->image->row0 = 0;
     294    inReadout->image->col0 = 0;
     295    inReadout->row0 = 0;
     296    inReadout->col0 = 0;
     297
     298    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     299    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS+10, NUM_COLS+10)
     300
     301    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     302
     303    psFree(inReadout);
     304    psFree(maskReadout);
    241305
    242306    return 0;
     
    245309int testMaskBadPixels9( void )
    246310{
     311    //
    247312    // Test I - Attempt to use offset greater than input image
    248     CREATE_AND_SET_IMAGE(inImage9,F64,0.0,50,50);
    249     CREATE_AND_SET_IMAGE(mask9,U8,0,50,50)
    250     CREATE_AND_SET_IMAGE(mask9i,U8,0,50,50)
    251     //    pmReadout *inReadout9 = pmReadoutAlloc(0, 0, inImage9);
    252     pmReadout *inReadout9 = pmReadoutAlloc(NULL);
    253     inReadout9->image = inImage9;
    254     inReadout9->mask = mask9i;
    255     inReadout9->row0 = 0;
    256     inReadout9->col0 = 0;
    257     *(int*)&inReadout9->col0 = 150;
    258     *(int*)&inReadout9->row0 = 150;
    259     pmMaskBadPixels(inReadout9, mask9, 0, 100.0, 1, 10);
    260     psFree(mask9);
    261     psFree(inReadout9);
     313    //
     314
     315    pmReadout *inReadout = pmReadoutAlloc(NULL);
     316    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     317    inReadout->image->row0 = 0;
     318    inReadout->image->col0 = 0;
     319    inReadout->row0 = 0;
     320    inReadout->col0 = 0;
     321    *(int*)&inReadout->image->col0 = 150;
     322    *(int*)&inReadout->image->row0 = 150;
     323
     324    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     325    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     326    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     327
     328    psFree(inReadout);
     329    psFree(maskReadout);
    262330
    263331    return 0;
     
    266334int testMaskBadPixels10( void )
    267335{
     336    //
    268337    // Test J - Attempt to use complex input image
    269     CREATE_AND_SET_IMAGE(inImage10,C64,50.0,50,50);
    270     CREATE_AND_SET_IMAGE(mask10,U8,0,50,50)
    271     CREATE_AND_SET_IMAGE(mask10i,U8,0,50,50)
    272     //    pmReadout *inReadout10 = pmReadoutAlloc(0, 0, inImage10);
    273     pmReadout *inReadout10 = pmReadoutAlloc(NULL);
    274     inReadout10->row0 = 0;
    275     inReadout10->col0 = 0;
    276     inReadout10->image = inImage10;
    277     inReadout10->mask = mask10i;
    278     pmMaskBadPixels(inReadout10, mask10, 0, 100.0, 1, 10);
    279     psFree(mask10);
    280     psFree(inReadout10);
     338    //
     339
     340    pmReadout *inReadout = pmReadoutAlloc(NULL);
     341    CREATE_AND_SET_IMAGE(inReadout->image, C64, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     342    inReadout->image->row0 = 0;
     343    inReadout->image->col0 = 0;
     344    inReadout->row0 = 0;
     345    inReadout->col0 = 0;
     346
     347    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     348    CREATE_AND_SET_IMAGE(maskReadout->image, U8, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     349
     350    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     351
     352    psFree(inReadout);
     353    psFree(maskReadout);
    281354
    282355    return 0;
     
    285358int testMaskBadPixels11( void )
    286359{
    287     // Test K - Attempt to use non-mask type mask image
    288     CREATE_AND_SET_IMAGE(inImage11,F64,50.0,50,50);
    289     CREATE_AND_SET_IMAGE(mask11,F64,0,50,50)
    290     CREATE_AND_SET_IMAGE(mask11i,U8,0,50,50)
    291     //    pmReadout *inReadout11 = pmReadoutAlloc(0, 0, inImage11);
    292     pmReadout *inReadout11 = pmReadoutAlloc(NULL);
    293     inReadout11->row0 = 0;
    294     inReadout11->col0 = 0;
    295     inReadout11->image = inImage11;
    296     inReadout11->mask = mask11i;
    297     pmMaskBadPixels(inReadout11, mask11, 0, 100.0, 1, 10);
    298     psFree(mask11);
    299     psFree(inReadout11);
    300 
    301     return 0;
    302 }
    303 
     360    //
     361    // Test K - Attempt to use mask image with wrong data type.
     362    //
     363
     364    pmReadout *inReadout = pmReadoutAlloc(NULL);
     365    CREATE_AND_SET_IMAGE(inReadout->image, F32, DEFAULT_IMAGE_VAL, NUM_ROWS, NUM_COLS);
     366    inReadout->image->row0 = 0;
     367    inReadout->image->col0 = 0;
     368    inReadout->row0 = 0;
     369    inReadout->col0 = 0;
     370
     371    pmReadout *maskReadout = pmReadoutAlloc(NULL);
     372    CREATE_AND_SET_IMAGE(maskReadout->image, F64, DEFAULT_MASK_VAL, NUM_ROWS, NUM_COLS)
     373
     374    pmMaskBadPixels(inReadout, maskReadout, MASK_VAL, SAT_VAL, GROW_VAL, GROW_RAD);
     375
     376    psFree(inReadout);
     377    psFree(maskReadout);
     378
     379    return 0;
     380}
     381
Note: See TracChangeset for help on using the changeset viewer.