cluster.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef GRASS_CLUSTER_H
  2. #define GRASS_CLUSTER_H
  3. #include <grass/gis.h>
  4. #include <grass/imagery.h>
  5. struct Cluster
  6. {
  7. int nbands; /* number of bands */
  8. int npoints; /* number of points */
  9. DCELL **points; /* array of points */
  10. int np;
  11. double *band_sum; /* sum over each band */
  12. double *band_sum2; /* sum of squares over each band */
  13. int *class; /* class of each point */
  14. int *reclass; /* for removing empty classes */
  15. int *count; /* number of points in each class */
  16. int *countdiff; /* change in count */
  17. double **sum; /* sum over band per class */
  18. double **sumdiff; /* change in sum */
  19. double **sum2; /* sum of squares per band per class */
  20. double **mean; /* initial class means */
  21. struct Signature S; /* final signature(s) */
  22. int nclasses; /* number of classes */
  23. int merge1, merge2;
  24. int iteration; /* number of iterations */
  25. double percent_stable; /* percentage stable */
  26. };
  27. #include <grass/defs/cluster.h>
  28. #endif