Changeset 35081 for trunk/psModules/src/imcombine/pmStack.c
- Timestamp:
- Feb 1, 2013, 5:01:08 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmStack.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmStack.c
r34842 r35081 1385 1385 1386 1386 psVector *pixelData = psVectorAlloc(input->n,PS_TYPE_F32); 1387 psVector *pixelMask = psVectorAlloc(input->n,PS_TYPE_VECTOR_MASK); 1387 1388 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); 1388 1389 … … 1392 1393 pmReadout *ro = stack->data[i]; 1393 1394 psImage *image = ro->image; 1395 pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0; 1394 1396 pixelData->data.F32[i] = image->data.F32[y][x]; 1397 if (isfinite(image->data.F32[y][x])&& 1398 (fabs(image->data.F32[y][x]) < 1e5)) { 1399 pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0; 1400 } 1401 else { 1402 pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 1403 } 1404 #if (0) 1405 if ((x == 59)&&(y > 40)&&(y < 50)) { 1406 fprintf(stderr,"%d %d %d %d %g\n", 1407 x,y,i,pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i],pixelData->data.F32[i]); 1408 } 1395 1409 } 1396 if (!psVectorStats(stats,pixelData,NULL,NULL,0)) { 1410 #endif 1411 if (!psVectorStats(stats,pixelData,NULL,pixelMask,1)) { 1397 1412 psError(PS_ERR_UNKNOWN, false, "Unable to calculate median"); 1398 1413 psFree(stats); 1399 1414 psFree(pixelData); 1415 psFree(pixelMask); 1400 1416 psFree(stack); 1401 1417 return(false); … … 1403 1419 combined->image->data.F32[y][x] = stats->robustMedian; 1404 1420 combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = 0; 1421 #if (0) 1422 if ((x == 59)&&(y > 40)&&(y < 50)) { 1423 fprintf(stderr,"%d %d %d %d %g\n", 1424 x,y,-1,combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x], 1425 combined->image->data.F32[y][x]); 1426 } 1427 #endif 1405 1428 } 1406 1429 } … … 1408 1431 psFree(stats); 1409 1432 psFree(pixelData); 1433 psFree(pixelMask); 1410 1434 psFree(stack); 1411 1435 return (true);
Note:
See TracChangeset
for help on using the changeset viewer.
