Changeset 9611 for trunk/psModules/src/imcombine/pmReadoutCombine.c
- Timestamp:
- Oct 17, 2006, 10:13:04 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmReadoutCombine.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmReadoutCombine.c
r9541 r9611 1 /** @file pmReadoutCombine.c2 *3 * This file will contain a module which will combine multiple readout images.4 *5 * @author GLG, MHPCC6 *7 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $8 * @date $Date: 2006-10-13 22:11:02 $9 *10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii11 *12 */13 14 1 #ifdef HAVE_CONFIG_H 15 2 #include <config.h> … … 27 14 #include "pmReadoutCombine.h" 28 15 29 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 30 // File-static (private) functions 31 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 32 33 // Return the statistic of interest 34 static inline double getStat(const psStats *stats, // Statistics structure 35 psStatsOptions option // Statistics option 36 ) 37 { 38 assert(stats); 39 40 switch (option) { 41 case PS_STAT_SAMPLE_MEAN: 42 return stats->sampleMean; 43 case PS_STAT_SAMPLE_MEDIAN: 44 return stats->sampleMedian; 45 case PS_STAT_SAMPLE_STDEV: 46 return stats->sampleStdev; 47 case PS_STAT_ROBUST_MEDIAN: 48 return stats->robustMedian; 49 case PS_STAT_ROBUST_STDEV: 50 return stats->robustStdev; 51 case PS_STAT_FITTED_MEAN: 52 return stats->fittedMean; 53 case PS_STAT_FITTED_STDEV: 54 return stats->fittedStdev; 55 case PS_STAT_CLIPPED_MEAN: 56 return stats->clippedMean; 57 case PS_STAT_CLIPPED_STDEV: 58 return stats->clippedStdev; 59 case PS_STAT_MAX: 60 return stats->max; 61 case PS_STAT_MIN: 62 return stats->min; 63 default: 64 psAbort(__func__, "Bad option: %x\n", option); 65 } 66 return NAN; 67 } 16 //#define SHOW_BUSY 1 // Show that the function is busy 68 17 69 18 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 82 31 params->fracHigh = 0.0; 83 32 params->iter = 1; 84 params->rej = 3.0;33 params->rej = INFINITY; 85 34 86 35 return params; … … 88 37 89 38 90 /****************************************************************************** 91 XXX: Maybe add support for S16 and S32 types. Currently, only F32 supported. 92 *****************************************************************************/ 93 bool pmReadoutCombine(pmReadout *output, 94 psArray *inputs, 95 const psVector *zero, 96 const psVector *scale, 97 pmCombineParams *params 98 ) 39 // XXX: Maybe add support for S16 and S32 types. Currently, only F32 supported. 40 bool pmReadoutCombine(pmReadout *output, const psArray *inputs, const psVector *zero, const psVector *scale, 41 const pmCombineParams *params) 99 42 { 100 43 // Check inputs 101 44 PS_ASSERT_PTR_NON_NULL(output, false); 102 PS_ASSERT_ PTR_NON_NULL(inputs, false);45 PS_ASSERT_ARRAY_NON_NULL(inputs, false); 103 46 PS_ASSERT_PTR_NON_NULL(params, false); 104 47 if (zero) { … … 307 250 for (int i = minInputRows; i < maxInputRows; i++) { 308 251 int yOut = i - output->row0; // y position on output readout 309 #if 0252 #ifdef SHOW_BUSY 310 253 311 254 if (psTraceGetLevel("psModules.imcombine") > 9) { … … 325 268 psImage *image = readout->image; // The readout image 326 269 327 #if 0 328 // This should have been taken care of already: 270 #if 0 // This should have been taken care of already: 329 271 // Check bounds 330 272 if (xIn < 0 || xIn >= image->numCols || yIn < 0 || yIn >= image->numRows) { … … 382 324 // Combination 383 325 psVectorStats(stats, pixels, weights, mask, 1); 384 outputImage[yOut][xOut] = getStat(stats, params->combine);326 outputImage[yOut][xOut] = psStatsGetValue(stats, params->combine); 385 327 if (haveWeights) { 386 float stdev = getStat(stats, combineStdev);328 float stdev = psStatsGetValue(stats, combineStdev); 387 329 outputWeight[yOut][xOut] = PS_SQR(stdev); // Variance 388 330 } 389 331 } 390 332 } 391 #if 0333 #ifdef SHOW_BUSY 392 334 if (psTraceGetLevel("psModules.imcombine") > 9) { 393 335 printf("\n");
Note:
See TracChangeset
for help on using the changeset viewer.
