Changeset 1804 for trunk/psModules/src/pmFlatField.c
- Timestamp:
- Sep 14, 2004, 8:08:14 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmFlatField.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmFlatField.c
r1803 r1804 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-09-14 18:0 4:31$17 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-09-14 18:08:14 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 95 95 96 96 // Macro for all PS types 97 #define PM_FLAT_DIVISION(TYPE) \98 case PS_TYPE_##TYPE: \99 for(j = inImage->row0; j < inImage->numRows; j++) { \100 for(i = inImage->col0; i < inImage->numCols; i++) { \101 if(creal(flatImage->data.TYPE[j][i]) <= 0.0) { \102 /* Negative or zero flat pixels shall be masked in input image as PM_MASK_FLAT */ \103 inMaskImage->data.F64[j][i] = PM_MASK_FLAT; \104 } else if(flatMaskImage->data.TYPE[j][i]){ \105 /* Pixels masked in the flat shall be masked with same values in the output */ \106 inMaskImage->data.TYPE[j][i] = flatMaskImage->data.TYPE[j][i]; \107 } \108 if(creal(flatImage->data.TYPE[j][i]) < 0.0) { \109 /* Negative pixels from the flat image may be set to zero */ \110 inImage->data.TYPE[j][i] = 0.0 \111 } else if(fabs(flatImage->data.TYPE[j][i]) < FLT_EPSILON) {\112 psError(__func__, " : Line %d - Divide by zero. Row: %d Col: %d",__LINE__, j, i);\113 } else {\114 /* Module shall divide the input image by the flat-fielded image */\115 inImage->data.TYPE[j][i] = inImage->data.TYPE[j][i]/flatImage->data.TYPE[j][i];\116 }\117 }\118 }\119 break;97 #define PM_FLAT_DIVISION(TYPE) \ 98 case PS_TYPE_##TYPE: \ 99 for(j = inImage->row0; j < inImage->numRows; j++) { \ 100 for(i = inImage->col0; i < inImage->numCols; i++) { \ 101 if(creal(flatImage->data.TYPE[j][i]) <= 0.0) { \ 102 /* Negative or zero flat pixels shall be masked in input image as PM_MASK_FLAT */ \ 103 inMaskImage->data.F64[j][i] = PM_MASK_FLAT; \ 104 } else if(flatMaskImage->data.TYPE[j][i]){ \ 105 /* Pixels masked in the flat shall be masked with same values in the output */ \ 106 inMaskImage->data.TYPE[j][i] = flatMaskImage->data.TYPE[j][i]; \ 107 } \ 108 if(creal(flatImage->data.TYPE[j][i]) < 0.0) { \ 109 /* Negative pixels from the flat image may be set to zero */ \ 110 inImage->data.TYPE[j][i] = 0.0; \ 111 } else if(fabs(flatImage->data.TYPE[j][i]) < FLT_EPSILON) { \ 112 psError(__func__, " : Line %d - Divide by zero. Row: %d Col: %d",__LINE__, j, i); \ 113 } else { \ 114 /* Module shall divide the input image by the flat-fielded image */ \ 115 inImage->data.TYPE[j][i] = inImage->data.TYPE[j][i]/flatImage->data.TYPE[j][i]; \ 116 } \ 117 } \ 118 } \ 119 break; 120 120 121 121 switch(inType) {
Note:
See TracChangeset
for help on using the changeset viewer.
