IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 13, 2007, 10:29:48 AM (18 years ago)
Author:
Paul Price
Message:

Build a fake image to do statistics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeMask.c

    r10085 r15603  
    99#include <pslib.h>
    1010#include <psmodules.h>
     11#include <ppStats.h>
    1112
    1213#include "ppMerge.h"
     
    99100            pmReadout *roOut = pmReadoutAlloc(cellOut); // Output readout
    100101            roOut->mask = pmMaskIdentifyBadPixels(suspect, options->maskBad, options->combine->maskVal);
     102
     103            // Statistics on the merged cell
     104            if (data->statsFile) {
     105                if (!data->stats) {
     106                    data->stats = psMetadataAlloc();
     107                }
     108
     109                // Build a fake image to do statistics
     110                roOut->image = psImageAlloc(roOut->mask->numCols, roOut->mask->numRows, PS_TYPE_F32);
     111                psImageInit(roOut->image, 1.0);
     112                if (!ppStatsFPA(data->stats, data->out, view,
     113                                options->combine->maskVal | pmConfigMask("BLANK", config),
     114                                config)) {
     115                    psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to generate stats for image.\n");
     116                    return false;
     117                }
     118                psFree(roOut->image);
     119                roOut->image = NULL;
     120            }
     121
    101122            psFree(roOut);              // Drop reference
    102123
Note: See TracChangeset for help on using the changeset viewer.