00001 #include "sadie.h"
00002 #include "proto.h"
00003
00004
00005
00006
00007
00008
00009
00010
00011 void ISOLATE (
00012 IMAGE *in,
00013 double value,
00014 IMAGE **out
00015
00016 ) { register int i, j, k;
00017 char msg[SLEN];
00018
00019
00020
00021 if (!CHECKIMG(in)) {
00022 MESSAGE('E'," Can't identify image.");
00023 goto the_end;
00024 }
00025
00026
00027 if (!CHECKIMG(*out)) GETMEM(in->nbnd,in->nlin,in->npix,out);
00028 if (!*out) goto the_end;
00029
00030
00031 for (i=0; i<in->nbnd; i++) {
00032 for (j=0; j<in->nlin; j++) {
00033 for (k=0; k<in->npix; k++) {
00034 if (in->data[i][j][k] > ((PIXEL)value + (PIXEL)0.01)) {
00035 (*out)->data[i][j][k] = (PIXEL)0.0;
00036 } else if (in->data[i][j][k] < ((PIXEL)value - (PIXEL)0.01)) {
00037 (*out)->data[i][j][k] = (PIXEL)0.0;
00038 } else {
00039 (*out)->data[i][j][k] = (PIXEL)value;
00040 }
00041 }
00042 }
00043 }
00044
00045 the_end:
00046
00047 }