Changeset 1874
- Timestamp:
- Sep 23, 2004, 3:34:43 PM (22 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 edited
-
pmMaskBadPixels.c (modified) (2 diffs)
-
tst_pmMaskBadPixels.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmMaskBadPixels.c
r1870 r1874 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-09-2 3 23:33:54$21 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-09-24 01:34:43 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 86 86 psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true, 87 87 PS_ERRORTEXT_pmMaskBadPixels_SIZE_MASK_IMAGE, 88 in Image->numRows, inImage->numCols, mask->numRows, mask->numCols);88 inMask->numRows, inMask->numCols, mask->numRows, mask->numCols); 89 89 return false; 90 90 } -
trunk/psModules/src/tst_pmMaskBadPixels.c
r1870 r1874 3 3 * @brief Contains the tests for pmMaskBadPixels: 4 4 * 5 * Test A - Create mask based on maskVal argument 6 * Test B - Create mask based on saturation argument 7 * Test C - Create mask based on growVal and grow arguments 8 * Test D - Auto Create mask based on maskVal argument 9 * Test E - Attempt to use null mask 10 * Test F - Attempt tp use null input image 11 * Test G - Attempt to use input image bigger than mask 12 * Test H - Attempt to use input image mask bigger than mask 13 * Test I - Attempt to use offset greater than input image 14 * Test J - Attempt to use complex input image 15 * Test K - Attempt to use non-mask type mask image 16 * 5 17 * @author Ross Harman, MHPCC 6 18 * 7 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-09-2 3 23:33:54$19 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-09-24 01:34:43 $ 9 21 * 10 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 67 79 CREATE_AND_SET_IMAGE(inImage1,F64,0,50,50); 68 80 CREATE_AND_SET_IMAGE(mask1,U8,0,50,50) 69 psReadout *inReadout = psReadoutAlloc(0, 0, inImage1);81 psReadout *inReadout = psReadoutAlloc(0, 0, inImage1); 70 82 mask1->data.PS_TYPE_MASK_DATA[24][24]=1; 71 83 PRINT_MATRIX(mask1, U8, "Data mask:"); … … 83 95 CREATE_AND_SET_IMAGE(inImage2,F64,150.0,50,50); 84 96 CREATE_AND_SET_IMAGE(mask2,U8,0,50,50) 85 psReadout *inReadout2 = psReadoutAlloc(0, 0, inImage2);97 psReadout *inReadout2 = psReadoutAlloc(0, 0, inImage2); 86 98 PRINT_MATRIX(mask2, U8, "Data mask:"); 87 99 pmMaskBadPixels(inReadout2, mask2, 0, 100.0, 0, 0); … … 98 110 CREATE_AND_SET_IMAGE(inImage3,F64,50.0,50,50); 99 111 CREATE_AND_SET_IMAGE(mask3,U8,0,50,50) 100 psReadout *inReadout3 = psReadoutAlloc(0, 0, inImage3);112 psReadout *inReadout3 = psReadoutAlloc(0, 0, inImage3); 101 113 mask3->data.PS_TYPE_MASK_DATA[24][24]=1; 114 mask3->data.PS_TYPE_MASK_DATA[4][3]=1; 115 mask3->data.PS_TYPE_MASK_DATA[4][46]=1; 102 116 PRINT_MATRIX(mask3, U8, "Data mask:"); 103 117 pmMaskBadPixels(inReadout3, mask3, 0, 100.0, 1, 10); … … 110 124 111 125 112 // Test D - Create mask based on maskVal argument starting with non-null mask113 printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test D - Create mask based on maskVal argument starting with non-null mask");126 // Test D - Auto Create mask based on maskVal argument 127 printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test D - Auto create mask based on maskVal argument"); 114 128 CREATE_AND_SET_IMAGE(inImage4,F64,50.0,50,50); 115 129 CREATE_AND_SET_IMAGE(mask4,U8,0,50,50) 116 130 CREATE_AND_SET_IMAGE(mask4i,U8,0,50,50) 117 psReadout *inReadout4 = psReadoutAlloc(0, 0, inImage4);131 psReadout *inReadout4 = psReadoutAlloc(0, 0, inImage4); 118 132 inReadout4->mask = mask4i; 119 133 mask4->data.PS_TYPE_MASK_DATA[24][24]=1; … … 124 138 psFree(inReadout4); 125 139 psFree(inImage4); 126 printFooter(stdout, "pmMaskBadPixels", "Test D - Create mask based on maskVal argument starting with non-null mask", true); 127 printf("\n\n\n"); 128 140 printFooter(stdout, "pmMaskBadPixels", "Test D - Auto create mask based on maskVal argument", true); 141 printf("\n\n\n"); 142 143 144 // Test E - Attempt to use null mask 145 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test E - Attempt to use null mask", 146 "Null not allowed for mask image", 0); 147 CREATE_AND_SET_IMAGE(inImage5,F64,50.0,50,50); 148 psReadout *inReadout5 = psReadoutAlloc(0, 0, inImage5); 149 pmMaskBadPixels(inReadout4, NULL, 0, 100.0, 1, 10); 150 psFree(inReadout5); 151 psFree(inImage5); 152 printFooter(stdout, "pmMaskBadPixels", "Test E - Attempt to use null mask", true); 153 printf("\n\n\n"); 154 155 156 // Test F - Attempt tp use null input image 157 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test F - Attempt tp use null input image", 158 "Null not allowed for input image", 0); 159 160 CREATE_AND_SET_IMAGE(mask6,U8,0,50,50) 161 psReadout *inReadout6 = psReadoutAlloc(0, 0, NULL); 162 inReadout6->mask = mask6; 163 pmMaskBadPixels(inReadout6, mask6, 0, 100.0, 1, 10); 164 psFree(inReadout6); 165 printFooter(stdout, "pmMaskBadPixels", "Test F - Attempt tp use null input image", true); 166 printf("\n\n\n"); 167 168 169 // Test G - Attempt to use input image bigger than mask 170 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test G - Attempt to use input image bigger than mask", 171 "Input image size exceeds that of mask image", 0); 172 CREATE_AND_SET_IMAGE(inImage7,F64,0.0,60,60); 173 CREATE_AND_SET_IMAGE(mask7,U8,0,50,50) 174 CREATE_AND_SET_IMAGE(mask7i,U8,0,50,50) 175 psReadout *inReadout7 = psReadoutAlloc(0, 0, inImage7); 176 inReadout4->mask = mask7i; 177 pmMaskBadPixels(inReadout4, mask7, 0, 100.0, 1, 10); 178 psFree(mask7); 179 psFree(inReadout7); 180 psFree(inImage7); 181 printFooter(stdout, "pmMaskBadPixels", "Test G - Attempt to use input image bigger than mask", true); 182 printf("\n\n\n"); 183 184 185 // Test H - Attempt to use input image mask bigger than mask 186 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test H - Attempt to use input image mask bigger than mask", 187 "Input image mask size exceeds that of mask image", 0); 188 CREATE_AND_SET_IMAGE(inImage8,F64,0.0,50,50); 189 CREATE_AND_SET_IMAGE(mask8,U8,0,50,50) 190 CREATE_AND_SET_IMAGE(mask8i,U8,0,60,60) 191 psReadout *inReadout8 = psReadoutAlloc(0, 0, inImage8); 192 inReadout8->mask = mask8i; 193 pmMaskBadPixels(inReadout8, mask8, 0, 100.0, 1, 10); 194 psFree(mask8); 195 psFree(inReadout8); 196 psFree(inImage8); 197 printFooter(stdout, "pmMaskBadPixels", "Test H - Attempt to use input image mask bigger than mask", true); 198 printf("\n\n\n"); 199 200 201 // Test I - Attempt to use offset greater than input image 202 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test I - Attempt to use offset greater than input image", 203 "Total offset >= input image size", 0); 204 CREATE_AND_SET_IMAGE(inImage9,F64,0.0,50,50); 205 CREATE_AND_SET_IMAGE(mask9,U8,0,50,50) 206 CREATE_AND_SET_IMAGE(mask9i,U8,0,50,50) 207 psReadout *inReadout9 = psReadoutAlloc(0, 0, inImage9); 208 inReadout9->mask = mask9i; 209 *(int*)&inReadout->col0 = 150; 210 *(int*)&inReadout->row0 = 150; 211 pmMaskBadPixels(inReadout9, mask9, 0, 100.0, 1, 10); 212 psFree(mask9); 213 psFree(inReadout9); 214 psFree(inImage9); 215 printFooter(stdout, "pmMaskBadPixels", "Test I - Attempt to use offset greater than input image", true); 216 printf("\n\n\n"); 217 218 219 // Test J - Attempt to use complex input image 220 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test J - Attempt to use complex input image", 221 "Complex types not allowed for input image", 0); 222 CREATE_AND_SET_IMAGE(inImage10,C64,50.0,50,50); 223 CREATE_AND_SET_IMAGE(mask10,U8,0,50,50) 224 CREATE_AND_SET_IMAGE(mask10i,U8,0,50,50) 225 psReadout *inReadout10 = psReadoutAlloc(0, 0, inImage10); 226 inReadout10->mask = mask10i; 227 pmMaskBadPixels(inReadout10, mask10, 0, 100.0, 1, 10); 228 psFree(mask10); 229 psFree(inReadout10); 230 psFree(inImage10); 231 printFooter(stdout, "pmMaskBadPixels", "Test J - Attempt to use complex input image", true); 232 printf("\n\n\n"); 233 234 235 // Test K - Attempt to use non-mask type mask image 236 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test K - Attempt to use non-mask type mask image", 237 "Mask must be PS_TYPE_MASK type", 0); 238 CREATE_AND_SET_IMAGE(inImage11,F64,50.0,50,50); 239 CREATE_AND_SET_IMAGE(mask11,F64,0,50,50) 240 CREATE_AND_SET_IMAGE(mask11i,U8,0,50,50) 241 psReadout *inReadout11 = psReadoutAlloc(0, 0, inImage10); 242 inReadout11->mask = mask11i; 243 pmMaskBadPixels(inReadout11, mask11, 0, 100.0, 1, 10); 244 psFree(mask11); 245 psFree(inReadout11); 246 psFree(inImage11); 247 printFooter(stdout, "pmMaskBadPixels", "Test K - Attempt to use non-mask type mask image", true); 248 printf("\n\n\n"); 129 249 130 250 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
