- Timestamp:
- Jul 11, 2008, 8:35:04 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080706/psModules/src/objects/pmSourceSky.c
r15980 r18472 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $9 * @date $Date: 2008-0 1-02 20:39:04 $8 * @version $Revision: 1.16.18.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-07-11 18:35:04 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 43 43 The source.pixels and source.mask must already exist 44 45 This function modifies the source mask; it should only be called before the object aperture is defined 44 46 *****************************************************************************/ 45 47 … … 49 51 psF32 Radius, 50 52 psMaskType maskVal, 51 psMaskType mark )53 psMaskType markVal) 52 54 { 53 55 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__); … … 69 71 psRegion srcRegion; 70 72 73 // maskVal is used to test for rejected pixels, and must include markVal 74 maskVal |= markVal; 75 71 76 srcRegion = psRegionForSquare(peak->x, peak->y, Radius); 72 77 srcRegion = psRegionForImage(mask, srcRegion); 73 78 74 psImageMaskRegion(mask, srcRegion, "OR", mark );79 psImageMaskRegion(mask, srcRegion, "OR", markVal); 75 80 psStats *myStats = psStatsAlloc(statsOptions); 76 if (!psImageStats(myStats, image, mask, maskVal | mark)) {81 if (!psImageStats(myStats, image, mask, maskVal)) { 77 82 psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n"); 78 83 psFree(myStats); 79 84 return false; 80 85 } 81 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(mark ));86 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(markVal)); 82 87 double value = psStatsGetValue(myStats, statistic); 83 88 psFree(myStats); … … 101 106 psF32 Radius, 102 107 psMaskType maskVal, 103 psMaskType mark 108 psMaskType markVal 104 109 ) 105 110 { … … 110 115 PS_ASSERT_PTR_NON_NULL(source->peak, false); 111 116 PS_ASSERT_INT_POSITIVE(Radius, false); 117 118 // maskVal is used to test for rejected pixels, and must include markVal 119 maskVal |= markVal; 112 120 113 121 psStatsOptions statistic = psStatsSingleOption(statsOptions); … … 125 133 srcRegion = psRegionForImage(mask, srcRegion); 126 134 127 psImageMaskRegion(mask, srcRegion, "OR", mark );135 psImageMaskRegion(mask, srcRegion, "OR", markVal); 128 136 psStats *myStats = psStatsAlloc(statsOptions); 129 if (!psImageStats(myStats, image, mask, maskVal | mark)) {137 if (!psImageStats(myStats, image, mask, maskVal)) { 130 138 psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n"); 131 139 psFree(myStats); 132 140 return false; 133 141 } 134 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(mark ));142 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(markVal)); 135 143 double value = psStatsGetValue(myStats, statistic); 136 144 psFree(myStats);
Note:
See TracChangeset
for help on using the changeset viewer.
