grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

imagery.h
Go to the documentation of this file.
1#ifndef GRASS_IMAGERY_H
2#define GRASS_IMAGERY_H
3
4#include <grass/gis.h>
5#include <grass/raster.h>
6
7/* File/directory name lengths */
8#define INAME_LEN GNAME_MAX /* coupled to raster map name length */
9
11{
12 unsigned char *table; /* color table for min-max values */
13 unsigned char *index; /* data translation index */
14 unsigned char *buf; /* data buffer for reading color file */
15 int fd; /* for image i/o */
16 CELL min, max; /* min,max CELL values */
17 int n; /* index into Ref_Files */
18};
19
21{
22 char name[INAME_LEN]; /* length is not in sync with other definitions */
24};
25
26struct Ref
27{
28 int nfiles;
29 struct Ref_Files *file;
30 struct Ref_Color red, grn, blu;
31};
32
34{
35 char title[75];
36 char id[2][75];
37 char desc[5][75];
38};
39
41{
42 int count;
43 double *e1;
44 double *n1;
45 double *z1;
46 double *e2;
47 double *n2;
48 double *z2;
49 int *status;
50};
51
52struct One_Sig
53{
54 char desc[100];
56 double *mean; /* one mean for each band */
57 double **var; /* covariance band-band */
58 int status; /* may be used to 'delete' a signature */
59 float r, g, b; /* color */
61};
62
64{
65 int nbands;
66 int nsigs;
67 char title[100];
68 struct One_Sig *sig;
69};
70
71struct SubSig
72{
73 double N;
74 double pi;
75 double *means;
76 double **R;
77 double **Rinv;
78 double cnst;
79 int used;
80};
81
83{
85 int count;
86 double **x; /* pixel list: x[npixels][nbands] */
87 double **p; /* prob p[npixels][subclasses] */
88};
89
91{
93 char *title;
94 int used;
95 int type;
97 struct SubSig *SubSig;
99};
100
101struct SigSet
102{
105 char *title;
107};
108
109/* IClass */
110
111/*! Holds statistical values for creating histograms and raster maps for one class.
112
113 One class is represented by one category (cat).
114*/
115typedef struct
116{
117 int cat; /*!< class */
118 const char *name; /*!< signature description (class name) */
119 const char *color; /*!< class color (RRR:GGG:BBB)*/
120 int nbands; /*!< number of bands */
121
122 int ncells; /*!< number of cells in training areas */
123
124 int *band_min; /*!< minimum value for each band */
125 int *band_max; /*!< maximum value for each band */
126 float *band_sum; /*!< sum of values for each band */
127 float *band_mean; /*!< mean of values for each band */
128 float *band_stddev; /*!< standard deviation for each band */
129
130 float **band_product; /*!< sum of products of cell category values of 2 bands */
131 int **band_histo; /*!< number of cells for cell category value (0-256) for each band */
132
133 int *band_range_min; /*!< min range of values to create raster map */
134 int *band_range_max; /*!< max range of values to create raster map */
135 float nstd; /*!< multiplier of standard deviation */
136
137
139
140/* wx.iscatt backend */
141
142#define SC_SCATT_DATA 0
143#define SC_SCATT_CONDITIONS 1
144
145/*! Holds list of all categories.
146 It can contain selected areas for scatter plots (SC_SCATT_CONDITIONS type)
147 or computed scatter plots (SC_SCATT_DATA type).
148*/
149struct scCats
150{
151 int type; /*!< SC_SCATT_DATA -> computed scatter plots, SC_SCATT_CONDITIONS ->
152 set conditions for scatter plots to be computed */
153
154 int n_cats; /*!< number of allocated categories */
155
156 int n_bands; /*!< number of analyzed bands */
157 int n_scatts; /*!< number of possible scattter plots, which can be created from bands */
158
159 int n_a_cats; /*!< number of used/active categories */
160 int * cats_ids; /*!< (cat_idx->cat_id) array index is internal idx (position in cats_arr)
161 and id is saved in it's position*/
162 int * cats_idxs; /*!< (cat_id->cat_idx) array index is id and internal idx is saved
163 in it's position*/
164
165 struct scScatts ** cats_arr; /*!< array of pointers to struct scScatts */
166};
167
168
169/*! Holds list of all scatter plots, which belongs to category.
170*/
172{
173 int n_a_scatts; /*!< number of used/active scatter plots*/
174
175 int * scatts_bands; /*!< array of bands, which represents the scatter plots,
176 every scatter plot has assigned two bads
177 (size of the array is n_a_scatts * 2 -> idx*2)*/
178 int * scatt_idxs; /*!< (scatt_id->scatt_idx) internal idx of the scatter plot
179 (position in scatts_arr)*/
180
181 struct scdScattData ** scatts_arr; /*!< array of pointers to scdScattData */
182};
183
184/*! Holds scatter plot data.
185*/
187{
188 int n_vals; /*!< Number of values in scatter plot
189 (length of b_conds_arr or scatt_vals_arr arrays). */
190
191 unsigned char * b_conds_arr; /*!< array of selected areas
192 (used for SC_SCATT_CONDITIONS type) otherwise NULL */
193 unsigned int * scatt_vals_arr; /*!< array of computed areas
194 (used for SC_SCATT_DATA type) otherwise NULL */
195};
196
197#define SIGNATURE_TYPE_MIXED 1
198
199#define GROUPFILE "CURGROUP"
200#define SUBGROUPFILE "CURSUBGROUP"
201
202#include <grass/defs/imagery.h>
203
204#endif
int CELL
Definition: gis.h:603
#define INAME_LEN
Definition: imagery.h:8
int npixels
Definition: imagery.h:84
double ** p
Definition: imagery.h:87
double ** x
Definition: imagery.h:86
int count
Definition: imagery.h:85
int nsubclasses
Definition: imagery.h:96
long classnum
Definition: imagery.h:92
int type
Definition: imagery.h:95
char * title
Definition: imagery.h:93
struct SubSig * SubSig
Definition: imagery.h:97
int used
Definition: imagery.h:94
double * z2
Definition: imagery.h:48
int * status
Definition: imagery.h:49
double * e2
Definition: imagery.h:46
double * e1
Definition: imagery.h:43
double * n2
Definition: imagery.h:47
double * n1
Definition: imagery.h:44
double * z1
Definition: imagery.h:45
const char * color
Definition: imagery.h:119
int * band_range_max
Definition: imagery.h:134
int ** band_histo
Definition: imagery.h:131
float * band_sum
Definition: imagery.h:126
const char * name
Definition: imagery.h:118
float * band_stddev
Definition: imagery.h:128
int * band_range_min
Definition: imagery.h:133
float * band_mean
Definition: imagery.h:127
float ** band_product
Definition: imagery.h:130
int status
Definition: imagery.h:58
int npoints
Definition: imagery.h:55
char desc[100]
Definition: imagery.h:54
double * mean
Definition: imagery.h:56
double ** var
Definition: imagery.h:57
float g
Definition: imagery.h:59
float b
Definition: imagery.h:59
float r
Definition: imagery.h:59
int have_color
Definition: imagery.h:60
int fd
Definition: imagery.h:15
unsigned char * index
Definition: imagery.h:13
CELL min
Definition: imagery.h:16
unsigned char * table
Definition: imagery.h:12
unsigned char * buf
Definition: imagery.h:14
int n
Definition: imagery.h:17
CELL max
Definition: imagery.h:16
char mapset[GNAME_MAX]
Definition: imagery.h:23
char name[GNAME_MAX]
Definition: imagery.h:22
Definition: imagery.h:27
struct Ref_Color red grn blu
Definition: imagery.h:30
int nfiles
Definition: imagery.h:28
struct Ref_Files * file
Definition: imagery.h:29
int nbands
Definition: imagery.h:103
struct ClassSig * ClassSig
Definition: imagery.h:106
int nclasses
Definition: imagery.h:104
char * title
Definition: imagery.h:105
int nsigs
Definition: imagery.h:66
struct One_Sig * sig
Definition: imagery.h:68
char title[100]
Definition: imagery.h:67
int nbands
Definition: imagery.h:65
Definition: imagery.h:72
double pi
Definition: imagery.h:74
double N
Definition: imagery.h:73
int used
Definition: imagery.h:79
double ** R
Definition: imagery.h:76
double cnst
Definition: imagery.h:78
double * means
Definition: imagery.h:75
double ** Rinv
Definition: imagery.h:77
char title[75]
Definition: imagery.h:35
char desc[5][75]
Definition: imagery.h:37
int type
Definition: imagery.h:151
int n_cats
Definition: imagery.h:154
int * cats_ids
Definition: imagery.h:160
struct scScatts ** cats_arr
Definition: imagery.h:165
int n_a_cats
Definition: imagery.h:159
int * cats_idxs
Definition: imagery.h:162
int n_scatts
Definition: imagery.h:157
int n_bands
Definition: imagery.h:156
int * scatt_idxs
Definition: imagery.h:178
int n_a_scatts
Definition: imagery.h:173
struct scdScattData ** scatts_arr
Definition: imagery.h:181
int * scatts_bands
Definition: imagery.h:175
unsigned int * scatt_vals_arr
Definition: imagery.h:193
int n_vals
Definition: imagery.h:188
unsigned char * b_conds_arr
Definition: imagery.h:191