IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 27, 2006, 5:21:19 PM (20 years ago)
Author:
Paul Price
Message:

Changing p_psGetStatsValue over to psStatsSingleOption and psStatsGetValue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmImageCombine.c

    r7769 r8004  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2006-06-30 23:59:49 $
     10 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-07-28 03:21:19 $
    1212 *
    1313 *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
     
    4545    psS32 numIter,                      ///< Number of rejection iterations
    4646    psF32 sigmaClip,                    ///< Number of standard deviations at which to reject
    47     const psStats *stats)               ///< Statistics to use in the combination
     47    psStats *stats)               ///< Statistics to use in the combination
    4848{
    4949
     
    9898    }
    9999    PS_ASSERT_PTR_NON_NULL(stats, combine);
     100    psStatsOptions statistic = psStatsSingleOption(stats->options);
     101    if (statistic == 0) {
     102        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Multiple or no statistics options set: %x\n", statistic);
     103        return combine;
     104    }
    100105
    101106    // Allocate and initialize the combined image, if necessary.
     
    185190                // Combine all the pixels, using the specified stat.
    186191
    187                 stats = psVectorStats((psStats *) stats, pixelData, pixelErrors, pixelMask, maskVal);
    188                 psF64 combinedPixel;
    189                 psBool rc = p_psGetStatValue(stats, &combinedPixel);
    190                 if (rc != true) {
    191                     psLogMsg(__func__, PS_LOG_WARN, "WARNING: could not combine pixels (%d, %d) with the specified stat.\n", row, col);
    192                 }
     192                stats = psVectorStats(stats, pixelData, pixelErrors, pixelMask, maskVal);
     193                psF64 combinedPixel = psStatsGetValue(stats, statistic);
     194
    193195                if (iter == 0) {
    194196                    combine->data.F32[row][col] = (psF32) combinedPixel;
     
    202204                for (psS32 im = 0 ; im < numImages ; im++) {
    203205                    stdevStats = psVectorStats(stdevStats, pixelData, pixelErrors, pixelMask, maskVal);
    204                     psF64 stdev;
    205                     psBool rc = p_psGetStatValue(stdevStats, &stdev);
    206                     if (rc != true) {
    207                         psLogMsg(__func__, PS_LOG_WARN, "WARNING: could not compute the standard deviation of pixel (%d, %d).\n", row, col);
    208                         psLogMsg(__func__, PS_LOG_WARN, "WARNING: could not combine pixels (%d, %d) with the specified stat.\n", row, col);
    209                     }
     206                    psF64 stdev = stdevStats->sampleStdev;
    210207
    211208                    if (!(pixelMask->data.U8[im] & maskVal)) {
     
    289286                }
    290287                // Combine all the pixels, using the specified stat.
    291                 stats = psVectorStats((psStats *) stats, pixelData, pixelErrors, pixelMask, maskVal);
    292                 psF64 tmpF64;
    293                 psBool rc = p_psGetStatValue(stats, &tmpF64);
    294                 combine->data.F32[row][col] = (psF32) tmpF64;
    295                 if (rc != true) {
    296                     psLogMsg(__func__, PS_LOG_WARN, "WARNING: could not combine pixels (%d, %d) with the specified stat.\n", row, col);
    297                 }
     288                stats = psVectorStats(stats, pixelData, pixelErrors, pixelMask, maskVal);
     289                combine->data.F32[row][col] = psStatsGetValue(stats, statistic);
    298290            }
    299291        }
Note: See TracChangeset for help on using the changeset viewer.