IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 15, 2009, 2:10:35 PM (16 years ago)
Author:
bills
Message:

Completion to previous fix. If component is completely excised set the STREAK
bit in all pixels in the mask image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksremove.c

    r26407 r26408  
    3434    }
    3535
    36     // Values to set for masked pixels
    37     psU32 maskStreak = 0;           // for the image and weight (usually NAN, MAXINT for integer images)
    38     psU32 maskMask = 0;             // value looked up for MASK.STREAK
    39 
    4036    psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS");
    4137
     
    118114
    119115        // now that we've read the input files, lookup the mask values
    120         if (maskStreak == 0) {
    121             strkGetMaskValues(sfiles, &maskStreak, &maskMask);
    122         }
     116        strkGetMaskValues(sfiles);
    123117
    124118        totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols;
     
    142136                    // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel
    143137                    // is excised as part of the destreaking process)
    144                     exciseNonWarpedPixels(sfiles, maskStreak);
     138                    exciseNonWarpedPixels(sfiles, sfiles->maskStreak);
    145139
    146140                    psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED"));
     
    149143                psTimerStart("REMOVE_STREAKS");
    150144
    151                 totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, maskStreak);
     145                totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, sfiles->maskStreak);
    152146
    153147                psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));
     
    155149                if (nanForRelease) {
    156150                    // set any pixels that were masked, to NAN (unless they are already NAN)
    157                     setMaskedToNAN(sfiles, maskMask, true);
     151                    setMaskedToNAN(sfiles, sfiles->maskMask, true);
    158152                }
    159153
     
    173167        }
    174168
    175         censorSources(sfiles, maskStreak);
     169        censorSources(sfiles, sfiles->maskStreak);
    176170
    177171        // write the destreaked "temporary" images and the recovery images
     
    512506}
    513507
     508static void
     509setStreakBits(psImage *maskImage, psU32 maskStreak)
     510{
     511    for (int y=0 ; y < maskImage->numRows; y++) {
     512        for (int x=0 ; x < maskImage->numCols; x++) {
     513            maskImage->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskStreak;
     514        }
     515    }
     516}
     517
    514518// set the image for the output files to the contents of the corresponding input file.
    515519static bool
     
    582586            // Note: we don't excise the mask pixels even if exciseAll is true.
    583587            setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, false);
     588            if (exciseAll) {
     589                strkGetMaskValues(sf);
     590               
     591                setStreakBits(sf->inMask->image, sf->maskStreak);
     592            }
    584593            if (sf->outChMask) {
    585594                sf->outChMask->header = (psMetadata *) psMemIncrRefCounter(sf->outMask->header);
Note: See TracChangeset for help on using the changeset viewer.