00001 #include "sadie.h"
00002 #include "proto.h"
00003
00004
00005
00006
00007
00008
00009
00010
00011 void NONMAXSUPRX (
00012 IMAGE *in,
00013 IMAGE **out
00014
00015 ) { register short i, j, k, n;
00016 char msg[SLEN];
00017
00018
00019
00020 if (!CHECKIMG(in)) {
00021 MESSAGE('E'," Can't identify image.");
00022 goto the_end;
00023 } else if (in->nbnd > 1) {
00024 MESSAGE('E'," Image must be single-band.");
00025 goto the_end;
00026 }
00027
00028
00029
00030 if (!CHECKIMG(*out)) GETMEM(in->nbnd,in->nlin,in->npix,out);
00031 if (!*out) goto the_end;
00032
00033
00034
00035
00036 for (j=0; j<in->nlin; j++) {
00037 for (k=0; k<in->npix; k++) {
00038
00039 if ((k < 1)||(k > in->npix-2)) {
00040
00041 (*out)->data[0][j][k] = 0.0;
00042 } else if (((k>0)&&(in->data[0][j][k-1] > in->data[0][j][k]))
00043 || ((k<in->npix-1)&&(in->data[0][j][k+1] > in->data[0][j][k]))) {
00044
00045 (*out)->data[0][j][k] = 0.0;
00046 } else {
00047 (*out)->data[0][j][k] = in->data[0][j][k];
00048 }
00049 }
00050 }
00051
00052
00053 the_end:
00054
00055 }