IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 17, 2014, 12:32:26 PM (12 years ago)
Author:
eugene
Message:

merge changes (from past YEAR) into trunk

Location:
branches/eam_branches/ipp-ops-20130712/ppStack/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-ops-20130712/ppStack/src

  • branches/eam_branches/ipp-ops-20130712/ppStack/src/ppStackCombineFinal.c

    r33093 r37067  
    44// #define TESTING                         // Enable test output
    55
     6//MEH -- adhoc addition to blank mask border of final stack since rejection different/none on order of KERNEL.SIZE with overlap in CombineInitial
     7static void stackBorderMask(psImage *image, // Image to mark as blank
     8                            psImage *mask, // Mask to mark as blank (or NULL)
     9                            psImage *variance, // Weight map to mark as blank (or NULL)
     10                            int numCols, int numRows, // Size of image
     11                            int size, // Size to mark blank
     12                            psImageMaskType blank // Blank mask value
     13    )
     14{
     15    for (int y = size; y < numRows - size; y++) {
     16        for (int x = 0; x < size; x++) {
     17            image->data.F32[y][x] = NAN;
     18            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     19            variance->data.F32[y][x] = NAN;
     20        }
     21        for (int x = numCols - size; x < numCols; x++) {
     22            image->data.F32[y][x] = NAN;
     23            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     24            variance->data.F32[y][x] = NAN;
     25        }
     26    }
     27    for (int y = 0; y < size; y++) {
     28        for (int x = 0; x < numCols; x++) {
     29            image->data.F32[y][x] = NAN;
     30            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     31            variance->data.F32[y][x] = NAN;
     32        }
     33    }
     34    for (int y = numRows - size; y < numRows; y++) {
     35        for (int x = 0; x < numCols; x++) {
     36            image->data.F32[y][x] = NAN;
     37            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     38            variance->data.F32[y][x] = NAN;
     39        }
     40    }
     41    return;
     42}
     43
     44
    645bool ppStackCombineFinal(ppStackThreadData *stack, psArray *covariances, ppStackOptions *options,
    7                          pmConfig *config, bool safe, bool normalise, bool grow)
     46                         pmConfig *config, bool safe, bool normalise, bool grow, bool bscaleoffset)
    847{
    948    psAssert(stack, "Require stack");
     
    2059    psAssert(recipe, "We've thrown an error on this before.");
    2160    float poorFrac = psMetadataLookupF32(NULL, recipe, "POOR.FRACTION"); // Fraction for "poor"
     61
     62    int sizeBlank = psMetadataLookupS32(NULL, recipe, "MASK.BLANKBORDER"); // Pixels to mask BLANK from edge
     63    psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels
    2264
    2365    // Grow the list of rejected pixels, if desired
     
    65107        PS_ARRAY_ADD_SCALAR(job->args, safe, PS_TYPE_U8);
    66108        PS_ARRAY_ADD_SCALAR(job->args, normalise, PS_TYPE_U8);
     109        PS_ARRAY_ADD_SCALAR(job->args, bscaleoffset, PS_TYPE_U8);
    67110        if (!psThreadJobAddPending(job)) {
    68111            psFree(reject);
     
    109152#endif
    110153
     154    //MEH blank mask/manual reject border on final stack --
     155    if (sizeBlank > 0) {
     156        stackBorderMask(outRO->image,outRO->mask,outRO->variance,numCols,numRows,sizeBlank,maskBlank);
     157        stackBorderMask(expRO->image,expRO->mask,expRO->variance,numCols,numRows,sizeBlank,0);
     158    }
     159
    111160    if (options->stats) {
    112161        // only add the timer if it has not been set (convolved stack)
Note: See TracChangeset for help on using the changeset viewer.