00001 #define SDC_DESPIKE_SIG \ 00002 int sdc_despike(\ 00003 int *image, /* To ble cleaned */ \ 00004 char *mask, /* Ignore these - guaranteed unchanged */ \ 00005 int nx, int ny, /* Size (nx,ny) of image */ \ 00006 int neighbour, /* Number of neighbour iterations */ \ 00007 char *kernel, /* Neighbour convolution. Generated if needed */ \ 00008 int kernel_size, /* Note: kernel is square */ \ 00009 int xbox, int ybox, /* Size of median box for detection */ \ 00010 int max_var_low, /* Max variation above median in "low" areas */ \ 00011 float max_factor_hi,/* Max factor above median in "high" areas */ \ 00012 int limit, /* Value separating high from low areas */ \ 00013 int *badblobs, /* Blobs of "bad pixels", convert to missing */ \ 00014 int sizeofbads, /* Number of pre-flagged bad pixels */ \ 00015 int *nspikes, /* Number of pixels flagged */ \ 00016 int **oldvalues, /* Old values of flagged pixels */ \ 00017 int **spikelocs, /* Their one-dimensional index location */ \ 00018 int **newvalues) /* And their *new* values */ 00019 00020 /* Additional notes: 00021 00022 - Bad blobs are filled in, using the same box median as for spiked pixels, 00023 but do not appear in the output oldvalues/spikelocs/newvalues. 00024 00025 - The value of BLANK/MISSING is hardcoded at 0x80000000 00026 00027 - Existing BLANK/MISSING pixels *and* masked pixels are *unchanged* upon 00028 exit - this also goes for pixels flagged as bad blobs - i.e. 00029 masking/pre-existing missing pixels take precedence. 00030 00031 - As with the AIA routine, a fake mask is generated if needed 00032 00033 - The kernel is a *square* array used for flagging neighbours of "primary" 00034 spike pixels, through convolution. If kernel_size or kernel is zero, a 00035 default 3x3 crosshair kernel is used. 00036 00037 - As with the AIA routine, *oldvalues, *spikelocs, and *newvalues should be 00038 free()'d by the caller. All other malloc'ed pointers are freed internally. 00039 00040 */ 00041 00042