1 #include <math.h> 2 #include <string.h> 3 #include <grass/raster.h> 4 5 #define LIKELIHOOD float 6 7 struct files 8 { 9 int output_fd; 10 int goodness_fd; 11 struct Categories output_labels; 12 13 int *band_fd; 14 int nbands; 15 16 DCELL *cellbuf; 17 CELL *outbuf; 18 char *isdata; 19 }; 20 21 struct parms 22 { 23 char *output_map; 24 char *goodness_map; 25 char *group; 26 char *subgroup; 27 char *sigfile; 28 int blocksize; 29 int ml; 30 }; 31 32 /* parse.c */ 33 int parse(int, char *[], struct parms *); 34 35 /* closefiles.c */ 36 int closefiles(struct parms *, struct files *); 37 38 /* openfiles.c */ 39 int openfiles(struct parms *, struct files *); 40 41 /* Suboutines in alpha_max.c */ 42 void alpha_max(double ***, double *, int, double); 43 void line_search(double ***, double *, int, double *, double); 44 int normalize(double[3]); 45 double func(double); 46 double log_like(double ***, double[3], int); 47 void gradient(double[3], double ***, double[3], int); 48 49 /* Subroutines in multialloc.c */ 50 char *multialloc(size_t, int, ...); 51 void multifree(char *, int); 52 unsigned char **get_img(int, int, size_t); 53 void free_img(unsigned char **); 54 55 /* Subroutine in solve.c */ 56 double solve(double (*)(double), double, double, double, int *); 57 58 /* Subroutine in invert.c */ 59 int invert(double **, int); 60 61 #ifdef GRASS_IMAGERY_H 62 int segment(struct SigSet *, struct parms *, struct files *); 63 64 /* read_sig.c */ 65 int read_signatures(struct parms *, struct SigSet *); 66 67 /* labels.c */ 68 int create_output_labels(struct SigSet *, struct files *); 69 70 /* write_img.c */ 71 int write_img(unsigned char **, float **, int, int, struct SigSet *, struct parms *, 72 struct files *); 73 #endif 74 75 /* Look for prototypes that use the Region structure in region.h */ 76