Changeset 36717 for trunk/ppStack/src/ppStackCombineFinal.c
- Timestamp:
- May 1, 2014, 4:02:29 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackCombineFinal.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackCombineFinal.c
r33093 r36717 3 3 // This is the doomsday switch. 4 4 // #define TESTING // Enable test output 5 6 //MEH -- adhoc addition to blank mask border of final stack since rejection different/none on order of KERNEL.SIZE with overlap in CombineInitial 7 static 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 5 44 6 45 bool ppStackCombineFinal(ppStackThreadData *stack, psArray *covariances, ppStackOptions *options, … … 20 59 psAssert(recipe, "We've thrown an error on this before."); 21 60 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 22 64 23 65 // Grow the list of rejected pixels, if desired … … 109 151 #endif 110 152 153 //MEH blank mask/manual reject border on final stack -- 154 if (sizeBlank > 0) { 155 stackBorderMask(outRO->image,outRO->mask,outRO->variance,numCols,numRows,sizeBlank,maskBlank); 156 stackBorderMask(expRO->image,expRO->mask,expRO->variance,numCols,numRows,sizeBlank,0); 157 } 158 111 159 if (options->stats) { 112 160 // only add the timer if it has not been set (convolved stack)
Note:
See TracChangeset
for help on using the changeset viewer.
