Changeset 26408 for trunk/magic/remove/src/streaksremove.c
- Timestamp:
- Dec 15, 2009, 2:10:35 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksremove.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r26407 r26408 34 34 } 35 35 36 // Values to set for masked pixels37 psU32 maskStreak = 0; // for the image and weight (usually NAN, MAXINT for integer images)38 psU32 maskMask = 0; // value looked up for MASK.STREAK39 40 36 psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS"); 41 37 … … 118 114 119 115 // 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); 123 117 124 118 totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols; … … 142 136 // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel 143 137 // is excised as part of the destreaking process) 144 exciseNonWarpedPixels(sfiles, maskStreak);138 exciseNonWarpedPixels(sfiles, sfiles->maskStreak); 145 139 146 140 psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED")); … … 149 143 psTimerStart("REMOVE_STREAKS"); 150 144 151 totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, maskStreak);145 totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, sfiles->maskStreak); 152 146 153 147 psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS")); … … 155 149 if (nanForRelease) { 156 150 // set any pixels that were masked, to NAN (unless they are already NAN) 157 setMaskedToNAN(sfiles, maskMask, true);151 setMaskedToNAN(sfiles, sfiles->maskMask, true); 158 152 } 159 153 … … 173 167 } 174 168 175 censorSources(sfiles, maskStreak);169 censorSources(sfiles, sfiles->maskStreak); 176 170 177 171 // write the destreaked "temporary" images and the recovery images … … 512 506 } 513 507 508 static void 509 setStreakBits(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 514 518 // set the image for the output files to the contents of the corresponding input file. 515 519 static bool … … 582 586 // Note: we don't excise the mask pixels even if exciseAll is true. 583 587 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 } 584 593 if (sf->outChMask) { 585 594 sf->outChMask->header = (psMetadata *) psMemIncrRefCounter(sf->outMask->header);
Note:
See TracChangeset
for help on using the changeset viewer.
