GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
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
10
struct
Ref_Color
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
20
struct
Ref_Files
21
{
22
char
name
[
INAME_LEN
];
/* length is not in sync with other definitions */
23
char
mapset[
INAME_LEN
];
24
};
25
26
struct
Ref
27
{
28
int
nfiles
;
29
struct
Ref_Files
*
file
;
30
struct
Ref_Color
red, grn, blu;
31
};
32
33
struct
Tape_Info
34
{
35
char
title[75];
36
char
id
[2][75];
37
char
desc[5][75];
38
};
39
40
struct
Control_Points
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
52
struct
One_Sig
53
{
54
char
desc[100];
/* name of target class */
55
int
npoints
;
/* cell count used to determine class parameters */
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 */
60
int
have_color
;
61
};
62
63
struct
Signature
64
{
65
int
nbands
;
/* band (imagery group member) count */
66
char
**
semantic_labels
;
/* list of semantic labels */
67
int
nsigs
;
/* signature count */
68
char
title[100];
/* not used? */
69
struct
One_Sig
*
sig
;
/* array of one signature per class */
70
};
71
72
struct
SubSig
73
{
74
double
N
;
75
double
pi
;
76
double
*
means
;
77
double
**
R
;
78
double
**
Rinv
;
79
double
cnst
;
80
int
used
;
81
};
82
83
struct
ClassData
84
{
85
int
npixels
;
86
int
count
;
87
double
**
x
;
/* pixel list: x[npixels][nbands] */
88
double
**
p
;
/* prob p[npixels][subclasses] */
89
};
90
91
struct
ClassSig
92
{
93
long
classnum
;
/* c_cat */
94
char
*
title
;
/* from Rast_get_c_cat */
95
int
used
;
96
int
type
;
/* always is SIGNATURE_TYPE_MIXED ? */
97
int
nsubclasses
;
/* SubSig item count */
98
struct
SubSig
*
SubSig
;
99
struct
ClassData
ClassData
;
/* used for SubSig calculation only */
100
};
101
102
struct
SigSet
103
{
104
int
nbands
;
105
char
**
semantic_labels
;
/* list of semantic labels [nbands]char* */
106
int
nclasses
;
/* ClassSig item count */
107
char
*
title
;
108
struct
ClassSig
*
ClassSig
;
109
};
110
111
/* IClass */
112
113
/*! Holds statistical values for creating histograms and raster maps for one class.
114
115
One class is represented by one category (cat).
116
*/
117
typedef
struct
118
{
119
int
cat
;
/*!< class */
120
const
char
*
name
;
/*!< signature description (class name) */
121
const
char
*
color
;
/*!< class color (RRR:GGG:BBB)*/
122
int
nbands
;
/*!< number of bands */
123
124
int
ncells
;
/*!< number of cells in training areas */
125
126
int
*
band_min
;
/*!< minimum value for each band */
127
int
*
band_max
;
/*!< maximum value for each band */
128
float
*
band_sum
;
/*!< sum of values for each band */
129
float
*
band_mean
;
/*!< mean of values for each band */
130
float
*
band_stddev
;
/*!< standard deviation for each band */
131
132
float
**
band_product
;
/*!< sum of products of cell category values of 2 bands */
133
int
**
band_histo
;
/*!< number of cells for cell category value (0-256) for each band */
134
135
int
*
band_range_min
;
/*!< min range of values to create raster map */
136
int
*
band_range_max
;
/*!< max range of values to create raster map */
137
float
nstd
;
/*!< multiplier of standard deviation */
138
139
140
}
IClass_statistics
;
141
142
/* wx.iscatt backend */
143
144
#define SC_SCATT_DATA 0
145
#define SC_SCATT_CONDITIONS 1
146
147
/*! Holds list of all categories.
148
It can contain selected areas for scatter plots (SC_SCATT_CONDITIONS type)
149
or computed scatter plots (SC_SCATT_DATA type).
150
*/
151
struct
scCats
152
{
153
int
type
;
/*!< SC_SCATT_DATA -> computed scatter plots, SC_SCATT_CONDITIONS ->
154
set conditions for scatter plots to be computed */
155
156
int
n_cats
;
/*!< number of allocated categories */
157
158
int
n_bands
;
/*!< number of analyzed bands */
159
int
n_scatts
;
/*!< number of possible scattter plots, which can be created from bands */
160
161
int
n_a_cats
;
/*!< number of used/active categories */
162
int
*
cats_ids
;
/*!< (cat_idx->cat_id) array index is internal idx (position in cats_arr)
163
and id is saved in it's position*/
164
int
*
cats_idxs
;
/*!< (cat_id->cat_idx) array index is id and internal idx is saved
165
in it's position*/
166
167
struct
scScatts
**
cats_arr
;
/*!< array of pointers to struct scScatts */
168
};
169
170
171
/*! Holds list of all scatter plots, which belongs to category.
172
*/
173
struct
scScatts
174
{
175
int
n_a_scatts
;
/*!< number of used/active scatter plots*/
176
177
int
*
scatts_bands
;
/*!< array of bands, which represents the scatter plots,
178
every scatter plot has assigned two bads
179
(size of the array is n_a_scatts * 2 -> idx*2)*/
180
int
*
scatt_idxs
;
/*!< (scatt_id->scatt_idx) internal idx of the scatter plot
181
(position in scatts_arr)*/
182
183
struct
scdScattData
**
scatts_arr
;
/*!< array of pointers to scdScattData */
184
};
185
186
/*! Holds scatter plot data.
187
*/
188
struct
scdScattData
189
{
190
int
n_vals
;
/*!< Number of values in scatter plot
191
(length of b_conds_arr or scatt_vals_arr arrays). */
192
193
unsigned
char
*
b_conds_arr
;
/*!< array of selected areas
194
(used for SC_SCATT_CONDITIONS type) otherwise NULL */
195
unsigned
int
*
scatt_vals_arr
;
/*!< array of computed areas
196
(used for SC_SCATT_DATA type) otherwise NULL */
197
};
198
199
/*! Supported signature file types.
200
* Remember to adjust I_SIGFILE_TYPE_COUNT on a change
201
*/
202
typedef
enum
203
{
204
I_SIGFILE_TYPE_SIG
,
/*! Signature files used by i.maxlik */
205
I_SIGFILE_TYPE_SIGSET
,
/*! Signature files used by i.smap */
206
207
}
I_SIGFILE_TYPE
;
208
209
#define SIGNATURE_TYPE_MIXED 1
/* Unused? */
210
#define I_SIGFILE_TYPE_COUNT 2
/*! Total count of supported signature file types */
211
212
213
#define GROUPFILE "CURGROUP"
214
#define SUBGROUPFILE "CURSUBGROUP"
215
216
#include <
grass/defs/imagery.h
>
217
218
#endif
scCats::type
int type
Definition:
imagery.h:153
IClass_statistics::ncells
int ncells
Definition:
imagery.h:124
IClass_statistics::cat
int cat
Definition:
imagery.h:119
SigSet::nclasses
int nclasses
Definition:
imagery.h:106
SubSig::Rinv
double ** Rinv
Definition:
imagery.h:78
scScatts
Definition:
imagery.h:173
INAME_LEN
#define INAME_LEN
Definition:
imagery.h:8
Ref_Color::fd
int fd
Definition:
imagery.h:15
SubSig
Definition:
imagery.h:72
IClass_statistics
Definition:
imagery.h:117
I_SIGFILE_TYPE_SIGSET
Definition:
imagery.h:205
IClass_statistics::color
const char * color
Definition:
imagery.h:121
One_Sig::var
double ** var
Definition:
imagery.h:57
IClass_statistics::band_range_min
int * band_range_min
Definition:
imagery.h:135
scdScattData::n_vals
int n_vals
Definition:
imagery.h:190
scCats::n_cats
int n_cats
Definition:
imagery.h:156
Ref
Definition:
imagery.h:26
IClass_statistics::nstd
float nstd
Definition:
imagery.h:137
One_Sig::npoints
int npoints
Definition:
imagery.h:55
SigSet::semantic_labels
char ** semantic_labels
Definition:
imagery.h:105
Control_Points::z2
double * z2
Definition:
imagery.h:48
SigSet::title
char * title
Definition:
imagery.h:107
SubSig::pi
double pi
Definition:
imagery.h:75
ClassData::x
double ** x
Definition:
imagery.h:87
scCats
Definition:
imagery.h:151
ClassSig::SubSig
struct SubSig * SubSig
Definition:
imagery.h:98
scScatts::scatts_bands
int * scatts_bands
Definition:
imagery.h:177
Control_Points::n2
double * n2
Definition:
imagery.h:47
ClassSig::type
int type
Definition:
imagery.h:96
Ref_Color::min
CELL min
Definition:
imagery.h:16
Control_Points::count
int count
Definition:
imagery.h:42
raster.h
IClass_statistics::band_product
float ** band_product
Definition:
imagery.h:132
One_Sig::have_color
int have_color
Definition:
imagery.h:60
scCats::n_scatts
int n_scatts
Definition:
imagery.h:159
Signature
Definition:
imagery.h:63
ClassData
Definition:
imagery.h:83
gis.h
IClass_statistics::name
const char * name
Definition:
imagery.h:120
IClass_statistics::band_range_max
int * band_range_max
Definition:
imagery.h:136
Control_Points::n1
double * n1
Definition:
imagery.h:44
ClassSig::title
char * title
Definition:
imagery.h:94
IClass_statistics::band_stddev
float * band_stddev
Definition:
imagery.h:130
IClass_statistics::nbands
int nbands
Definition:
imagery.h:122
SigSet::ClassSig
struct ClassSig * ClassSig
Definition:
imagery.h:108
SubSig::R
double ** R
Definition:
imagery.h:77
SigSet::nbands
int nbands
Definition:
imagery.h:104
SubSig::means
double * means
Definition:
imagery.h:76
scCats::n_a_cats
int n_a_cats
Definition:
imagery.h:161
imagery.h
b
double b
Definition:
r_raster.c:39
Ref_Files
Definition:
imagery.h:20
scScatts::n_a_scatts
int n_a_scatts
Definition:
imagery.h:175
Signature::nbands
int nbands
Definition:
imagery.h:65
scdScattData
Definition:
imagery.h:188
Signature::semantic_labels
char ** semantic_labels
Definition:
imagery.h:66
Ref_Color::index
unsigned char * index
Definition:
imagery.h:13
I_SIGFILE_TYPE_SIG
Definition:
imagery.h:204
SubSig::N
double N
Definition:
imagery.h:74
g
float g
Definition:
named_colr.c:8
Ref_Color::buf
unsigned char * buf
Definition:
imagery.h:14
Signature::nsigs
int nsigs
Definition:
imagery.h:67
Control_Points::z1
double * z1
Definition:
imagery.h:45
scScatts::scatts_arr
struct scdScattData ** scatts_arr
Definition:
imagery.h:183
scCats::n_bands
int n_bands
Definition:
imagery.h:158
Control_Points::status
int * status
Definition:
imagery.h:49
ClassSig::classnum
long classnum
Definition:
imagery.h:93
scCats::cats_ids
int * cats_ids
Definition:
imagery.h:162
One_Sig::status
int status
Definition:
imagery.h:58
Ref::nfiles
int nfiles
Definition:
imagery.h:28
One_Sig
Definition:
imagery.h:52
scCats::cats_idxs
int * cats_idxs
Definition:
imagery.h:164
scdScattData::scatt_vals_arr
unsigned int * scatt_vals_arr
Definition:
imagery.h:195
IClass_statistics::band_min
int * band_min
Definition:
imagery.h:126
IClass_statistics::band_mean
float * band_mean
Definition:
imagery.h:129
Ref::file
struct Ref_Files * file
Definition:
imagery.h:29
Ref_Color::table
unsigned char * table
Definition:
imagery.h:12
Control_Points::e2
double * e2
Definition:
imagery.h:46
IClass_statistics::band_histo
int ** band_histo
Definition:
imagery.h:133
IClass_statistics::band_max
int * band_max
Definition:
imagery.h:127
Ref_Color::max
CELL max
Definition:
imagery.h:16
CELL
int CELL
Definition:
gis.h:613
Ref_Color::n
int n
Definition:
imagery.h:17
SigSet
Definition:
imagery.h:102
scCats::cats_arr
struct scScatts ** cats_arr
Definition:
imagery.h:167
ClassData::npixels
int npixels
Definition:
imagery.h:85
SubSig::cnst
double cnst
Definition:
imagery.h:79
Control_Points
Definition:
imagery.h:40
Tape_Info
Definition:
imagery.h:33
name
const char * name
Definition:
named_colr.c:7
SubSig::used
int used
Definition:
imagery.h:80
ClassData::p
double ** p
Definition:
imagery.h:88
Signature::sig
struct One_Sig * sig
Definition:
imagery.h:69
IClass_statistics::band_sum
float * band_sum
Definition:
imagery.h:128
scScatts::scatt_idxs
int * scatt_idxs
Definition:
imagery.h:180
ClassSig::used
int used
Definition:
imagery.h:95
One_Sig::mean
double * mean
Definition:
imagery.h:56
scdScattData::b_conds_arr
unsigned char * b_conds_arr
Definition:
imagery.h:193
ClassSig
Definition:
imagery.h:91
Ref_Color
Definition:
imagery.h:10
Control_Points::e1
double * e1
Definition:
imagery.h:43
ClassSig::nsubclasses
int nsubclasses
Definition:
imagery.h:97
I_SIGFILE_TYPE
I_SIGFILE_TYPE
Definition:
imagery.h:202
ClassData::count
int count
Definition:
imagery.h:86
One_Sig::r
float r
Definition:
imagery.h:59
include
grass
imagery.h
Generated on Tue Feb 14 2023 05:56:00 for GRASS GIS 8 Programmer's Manual by
1.8.13