GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-602118adcc
|
Go to the source code of this file.
Functions | |
void * | I_malloc (size_t) |
void * | I_realloc (void *, size_t) |
int | I_free (void *) |
double ** | I_alloc_double2 (int, int) |
int * | I_alloc_int (int) |
int ** | I_alloc_int2 (int, int) |
int | I_free_int2 (int **) |
int | I_free_double2 (double **) |
double *** | I_alloc_double3 (int, int, int) |
int | I_free_double3 (double ***) |
int | I_get_to_eol (char *, int, FILE *) |
int | I_find_group (const char *) |
does group exist? More... | |
int | I_find_group2 (const char *, const char *) |
Does the group exists? More... | |
int | I_find_group_file (const char *, const char *) |
Searches for a group file in the current mapset. More... | |
int | I_find_group_file2 (const char *, const char *, const char *) |
Searches for a group file in the specified mapset. More... | |
int | I_find_subgroup (const char *, const char *) |
Searches for a subgroup in the current mapset. More... | |
int | I_find_subgroup2 (const char *, const char *, const char *) |
Searches for a subgroup in specified mapset or any mapset if mapset is not set. More... | |
int | I_find_subgroup_file (const char *, const char *, const char *) |
Searches for a subgroup file in the current mapset. More... | |
int | I_find_subgroup_file2 (const char *, const char *, const char *, const char *) |
Searches for a subgroup file in the specified mapset. More... | |
const char * | I_find_signature (I_SIGFILE_TYPE, char *, const char *) |
Find mapset containing signature file. More... | |
const char * | I_find_signature2 (I_SIGFILE_TYPE, const char *, const char *) |
Find mapset containing signature (look but don't touch) More... | |
FILE * | I_fopen_group_file_new (const char *, const char *) |
FILE * | I_fopen_group_file_append (const char *, const char *) |
FILE * | I_fopen_group_file_old (const char *, const char *) |
Open group file for reading. More... | |
FILE * | I_fopen_group_file_old2 (const char *, const char *, const char *) |
Open group file for reading. More... | |
FILE * | I_fopen_subgroup_file_new (const char *, const char *, const char *) |
FILE * | I_fopen_subgroup_file_append (const char *, const char *, const char *) |
FILE * | I_fopen_subgroup_file_old (const char *, const char *, const char *) |
FILE * | I_fopen_subgroup_file_old2 (const char *, const char *, const char *, const char *) |
int | I_compute_georef_equations (struct Control_Points *, double *, double *, double *, double *, int) |
int | I_georef (double, double, double *, double *, double *, double *, int) |
int | I_compute_georef_equations_tps (struct Control_Points *, double **, double **, double **, double **) |
int | I_georef_tps (double, double, double *, double *, double *, double *, struct Control_Points *, int) |
int | I_get_group (char *) |
int | I_put_group (const char *) |
int | I_get_subgroup (const char *, char *) |
int | I_put_subgroup (const char *, const char *) |
int | I_get_group_ref (const char *, struct Ref *) |
read group REF file More... | |
int | I_get_group_ref2 (const char *, const char *, struct Ref *) |
read group REF file More... | |
int | I_get_subgroup_ref (const char *, const char *, struct Ref *) |
read subgroup REF file More... | |
int | I_get_subgroup_ref2 (const char *, const char *, const char *, struct Ref *) |
read subgroup REF file More... | |
int | I_init_ref_color_nums (struct Ref *) |
int | I_put_group_ref (const char *, const struct Ref *) |
write group REF file More... | |
int | I_put_subgroup_ref (const char *, const char *, const struct Ref *) |
write subgroup REF file More... | |
int | I_add_file_to_group_ref (const char *, const char *, struct Ref *) |
add file name to Ref structure More... | |
int | I_transfer_group_ref_file (const struct Ref *, int, struct Ref *) |
copy Ref lists More... | |
int | I_init_group_ref (struct Ref *) |
initialize Ref structure More... | |
int | I_free_group_ref (struct Ref *) |
free Ref structure More... | |
int | I_iclass_analysis (IClass_statistics *, struct Ref *, struct Map_info *, const char *, const char *, const char *) |
Calculates statistical values for one class and multiple bands based on training areas. More... | |
int | I_iclass_init_group (const char *, const char *, struct Ref *) |
Read files for the specified group subgroup into the Ref structure. More... | |
void | I_iclass_create_raster (IClass_statistics *, struct Ref *, const char *) |
Create raster map based on statistics. More... | |
void | I_iclass_statistics_get_nbands (IClass_statistics *, int *) |
Get number of bands. More... | |
void | I_iclass_statistics_get_cat (IClass_statistics *, int *) |
Get category (class). More... | |
void | I_iclass_statistics_get_name (IClass_statistics *, const char **) |
Get category (class) name. More... | |
void | I_iclass_statistics_get_color (IClass_statistics *, const char **) |
Get category (class) color. More... | |
void | I_iclass_statistics_get_ncells (IClass_statistics *, int *) |
Get number of cells in training areas. More... | |
int | I_iclass_statistics_get_max (IClass_statistics *, int, int *) |
Get maximum value in band. More... | |
int | I_iclass_statistics_get_range_max (IClass_statistics *, int, int *) |
Get maximum cell value based on mean and standard deviation for band. More... | |
int | I_iclass_statistics_get_min (IClass_statistics *, int, int *) |
Get minimum value in band. More... | |
int | I_iclass_statistics_get_range_min (IClass_statistics *, int, int *) |
Get minimum cell value based on mean and standard deviation for band. More... | |
int | I_iclass_statistics_get_sum (IClass_statistics *, int, float *) |
Get sum of values in band. More... | |
int | I_iclass_statistics_get_mean (IClass_statistics *, int, float *) |
Get mean of cell category values in band. More... | |
int | I_iclass_statistics_get_stddev (IClass_statistics *, int, float *) |
Get standard deviation of cell category values in band. More... | |
void | I_iclass_statistics_get_nstd (IClass_statistics *, float *) |
Get the multiplier of standard deviation. More... | |
void | I_iclass_statistics_set_nstd (IClass_statistics *, float) |
Set the multiplier of standard deviation. More... | |
int | I_iclass_statistics_get_histo (IClass_statistics *, int, int, int *) |
Get histogram value in band. More... | |
int | I_iclass_statistics_get_product (IClass_statistics *, int, int, float *) |
Get product value. More... | |
void | I_iclass_init_statistics (IClass_statistics *, int, const char *, const char *, float) |
Initialize statistics. More... | |
void | I_iclass_free_statistics (IClass_statistics *) |
Free space allocated for statistics attributes. More... | |
int | I_iclass_init_signatures (struct Signature *, struct Ref *) |
Initialize signatures. More... | |
void | I_iclass_add_signature (struct Signature *, IClass_statistics *) |
Add one signature. More... | |
int | I_iclass_write_signatures (struct Signature *, const char *) |
Write signtures to signature file. More... | |
int | I_list_group (const char *, const struct Ref *, FILE *) |
Prints maps in a group (fancy version) More... | |
int | I_list_group_simple (const struct Ref *, FILE *) |
Prints maps in a group (simple version) More... | |
void | I__list_group_name_fit (char *, const char *, const char *) |
Formats map name to fit in a 80 column layout. More... | |
char ** | I_list_subgroups (const char *, int *) |
Get list of subgroups which a group contatins. More... | |
char ** | I_list_subgroups2 (const char *, const char *, int *) |
Get list of subgroups which a group contatins. More... | |
int | I_list_subgroup (const char *, const char *, const struct Ref *, FILE *) |
Prints maps in a subgroup (fancy version) More... | |
int | I_list_subgroup_simple (const struct Ref *, FILE *) |
Prints maps in a subgroup (simple version) More... | |
char * | I_location_info (const char *) |
int | I_new_control_point (struct Control_Points *, double, double, double, double, int) |
add new control point More... | |
int | I_get_control_points (const char *, struct Control_Points *) |
read group control points More... | |
int | I_put_control_points (const char *, const struct Control_Points *) |
write group control points More... | |
FILE * | I_fopen_group_ref_new (const char *) |
FILE * | I_fopen_group_ref_old (const char *) |
FILE * | I_fopen_group_ref_old2 (const char *, const char *) |
FILE * | I_fopen_subgroup_ref_new (const char *, const char *) |
FILE * | I_fopen_subgroup_ref_old (const char *, const char *) |
FILE * | I_fopen_subgroup_ref_old2 (const char *, const char *, const char *) |
void | I_sc_init_cats (struct scCats *, int, int) |
Initialize structure for storing scatter plots data. More... | |
void | I_sc_free_cats (struct scCats *) |
Free data of struct scCats, the structure itself remains allocated. More... | |
int | I_sc_add_cat (struct scCats *) |
Add category. More... | |
int | I_sc_insert_scatt_data (struct scCats *, struct scdScattData *, int, int) |
Insert scatter plot data . Inserted scatt_data struct must have same type as cats struct (SC_SCATT_DATA or SC_SCATT_CONDITIONS). More... | |
void | I_scd_init_scatt_data (struct scdScattData *, int, int, void *) |
Insert scatter plot data. More... | |
int | I_compute_scatts (struct Cell_head *, struct scCats *, const char **, const char **, int, struct scCats *, const char **) |
Compute scatter plots data. More... | |
int | I_create_cat_rast (struct Cell_head *, const char *) |
Create category raster conditions file. The file is used for holding selected areas from mapwindow. The reason why the standard GRASS raster is not used is that for every modification (new area is selected) we would need to create whole new raster. Instead of this scatter plot only modifies affected region in the internal pgm file. More... | |
int | I_insert_patch_to_cat_rast (const char *, struct Cell_head *, const char *) |
Insert raster map patch into pgm file. More... | |
int | I_id_scatt_to_bands (const int, const int, int *, int *) |
Compute band ids from scatter plot id. More... | |
int | I_bands_to_id_scatt (const int, const int, const int, int *) |
Compute scatter plot id from band ids. More... | |
int | I_merge_arrays (unsigned char *, unsigned char *, unsigned, unsigned, double) |
Merge arrays according to opacity. Every pixel in array must be represented by 4 values (RGBA). More... | |
int | I_apply_colormap (unsigned char *, unsigned char *, unsigned, unsigned char *, unsigned char *) |
Apply colromap to the raster. More... | |
int | I_rasterize (double *, int, unsigned char, struct Cell_head *, unsigned char *) |
Wrapper for using of iclass perimeter rasterization by scatter plot. Warning: calls Rast_set_window. More... | |
void | I_get_signatures_dir (char *, I_SIGFILE_TYPE) |
Get signature directory. More... | |
void | I_make_signatures_dir (I_SIGFILE_TYPE) |
Make signature dir. More... | |
int | I_signatures_remove (I_SIGFILE_TYPE, const char *) |
Remove a signature file. More... | |
int | I_signatures_copy (I_SIGFILE_TYPE, const char *, const char *, const char *) |
Copy a signature file. More... | |
int | I_signatures_rename (I_SIGFILE_TYPE, const char *, const char *) |
Rename a signature file. More... | |
int | I_signatures_list_by_type (I_SIGFILE_TYPE, const char *, char ***) |
Get list of existing signatures by type. More... | |
void | I_free_signatures_list (int, char ***) |
Free memory allocated by I_signatures_list_by_type. More... | |
int | I_init_signatures (struct Signature *, int) |
Initialize struct Signature before use. More... | |
int | I_new_signature (struct Signature *) |
int | I_free_signatures (struct Signature *) |
Free memory allocated for struct Signature. More... | |
int | I_read_one_signature (FILE *, struct Signature *) |
Internal function for I_read_signatures. More... | |
int | I_read_signatures (FILE *, struct Signature *) |
Read signatures from file. More... | |
int | I_write_signatures (FILE *, struct Signature *) |
Write signatures to file. More... | |
char ** | I_sort_signatures_by_semantic_label (struct Signature *, const struct Ref *) |
Reorder struct Signature to match imagery group member order. More... | |
FILE * | I_fopen_signature_file_new (const char *) |
Create signature file. More... | |
FILE * | I_fopen_signature_file_old (const char *) |
Open existing signature file. More... | |
int | I_SigSetNClasses (struct SigSet *) |
struct ClassData * | I_AllocClassData (struct SigSet *, struct ClassSig *, int) |
int | I_InitSigSet (struct SigSet *, int) |
Initialize struct SigSet before use. More... | |
struct ClassSig * | I_NewClassSig (struct SigSet *) |
struct SubSig * | I_NewSubSig (struct SigSet *, struct ClassSig *) |
int | I_ReadSigSet (FILE *, struct SigSet *) WARN_UNUSED_RESULT |
Read sigset signatures from file. More... | |
int | I_SetSigTitle (struct SigSet *, const char *) |
const char * | I_GetSigTitle (const struct SigSet *) |
int | I_SetClassTitle (struct ClassSig *, const char *) |
const char * | I_GetClassTitle (const struct ClassSig *) |
int | I_WriteSigSet (FILE *, const struct SigSet *) |
char ** | I_SortSigSetBySemanticLabel (struct SigSet *, const struct Ref *) |
Reorder struct SigSet to match imagery group member order. More... | |
FILE * | I_fopen_sigset_file_new (const char *) |
Create new sigset file. More... | |
FILE * | I_fopen_sigset_file_old (const char *) |
Open existing sigset signature file. More... | |
int | I_get_target (const char *, char *, char *) |
read target information More... | |
int | I_put_target (const char *, const char *, const char *) |
write target information More... | |
int | I_get_group_title (const char *, char *, int) |
int | I_put_group_title (const char *, const char *) |
double | I_variance (double, double, int) |
double | I_stddev (double, double, int) |
void I__list_group_name_fit | ( | char * | buf, |
const char * | name, | ||
const char * | mapset | ||
) |
Formats map name to fit in a 80 column layout.
Results in a map name in the "<map@mapset>" form. If necessary truncates relevant part(s) and denotes with ellipsis, e.g. "<verylongmapname...@mapset>".
[out] | buf | formatted map name |
name | map name | |
mapset | mapset name |
Definition at line 97 of file list_gp.c.
References name.
Referenced by I_list_group(), and I_list_subgroup().
int I_add_file_to_group_ref | ( | const char * | name, |
const char * | mapset, | ||
struct Ref * | ref | ||
) |
add file name to Ref structure
This routine adds the file name and mapset to the list contained in the ref structure, if it is not already in the list. The ref structure must have been properly initialized. This routine is used by programs, such as i.maxlik, to add to the group new raster maps created from files already in the group. Returns the index into the file array within the ref structure for the file after insertion; see Imagery_Library_Data_Structures.
name | |
mapset | |
ref |
Definition at line 386 of file group.c.
References Ref::file, G_malloc, G_realloc, Ref_Files::mapset, Ref_Files::name, name, Ref::nfiles, and strcpy.
Referenced by I_transfer_group_ref_file().
double** I_alloc_double2 | ( | int | a, |
int | b | ||
) |
Definition at line 29 of file imagery/alloc.c.
Referenced by I_cluster_exec_allocate().
double*** I_alloc_double3 | ( | int | a, |
int | b, | ||
int | c | ||
) |
Definition at line 106 of file imagery/alloc.c.
int* I_alloc_int | ( | int | a | ) |
Definition at line 49 of file imagery/alloc.c.
Referenced by I_cluster_exec_allocate().
int** I_alloc_int2 | ( | int | a, |
int | b | ||
) |
Definition at line 62 of file imagery/alloc.c.
int I_apply_colormap | ( | unsigned char * | vals, |
unsigned char * | vals_mask, | ||
unsigned | nvals, | ||
unsigned char * | colmap, | ||
unsigned char * | col_vals | ||
) |
Apply colromap to the raster.
Implemented for speeding up of scatter plots rendering.
vals | array of values for applying the colormap | |
vals_mask | mask of vals array | |
nvals | number of items of vals_mask and vals array | |
colmap | colour map to be applied | |
[out] | col_vals | output raster with applied color map (length is 4 * nvals (RGBA)) |
Definition at line 891 of file iscatt_core.c.
int I_bands_to_id_scatt | ( | const int | b_1_id, |
const int | b_2_id, | ||
const int | n_bands, | ||
int * | scatt_id | ||
) |
Compute scatter plot id from band ids.
See also I_id_scatt_to_bands
b_1_id | id of band1 | |
b_1_id | id of band2 | |
n_bands | number of bands | |
[out] | scatt_id | scatter plot id |
Definition at line 70 of file iscatt_structs.c.
int I_compute_georef_equations | ( | struct Control_Points * | , |
double * | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
int | |||
) |
int I_compute_georef_equations_tps | ( | struct Control_Points * | cp, |
double ** | E12tps, | ||
double ** | N12tps, | ||
double ** | E21tps, | ||
double ** | N21tps | ||
) |
Definition at line 108 of file georef_tps.c.
References _, Control_Points::count, Control_Points::e1, Control_Points::e2, G_message(), MAX, MIN, MNPTERR, MUNSOLVABLE, Control_Points::n1, Control_Points::n2, and Control_Points::status.
int I_compute_scatts | ( | struct Cell_head * | region, |
struct scCats * | scatt_conds, | ||
const char ** | cats_rasts_conds, | ||
const char ** | bands, | ||
int | n_bands, | ||
struct scCats * | scatts, | ||
const char ** | cats_rasts | ||
) |
Compute scatter plots data.
If category has not defined category raster condition file and no scatter plot exists with condition, default/full scatter plot is computed. Warning: calls Rast_set_window
region | analysis region, beaware that all input data must be prepared for this region (bands (their ranges), cats_rasts_conds rasters...) | |
region | function calls Rast_set_window for this region | |
scatt_conds | pointer to scScatts struct of type SC_SCATT_CONDITIONS, where are stored selected areas (conditions) in scatter plots | |
cats_rasts_conds | paths to category raster conditions files representing selected areas from mapwindow (conditions) in rasters for every category | |
cats_rasts_conds | index in array represents corresponding category id | |
cats_rasts_conds | for manipulation with category raster conditions file see also I_id_scatt_to_bands and I_insert_patch_to_cat_rast | |
bands | names of analyzed bands, order of bands is defined by their id | |
n_bands | number of bands | |
[out] | scatts | pointer to scScatts struct of type SC_SCATT_DATA, where are computed scatter plots stored |
[out] | cats_rasts | array of raster maps names for every category where will be stored all selected pixels |
Definition at line 685 of file iscatt_core.c.
int I_create_cat_rast | ( | struct Cell_head * | cat_rast_region, |
const char * | cat_rast | ||
) |
Create category raster conditions file. The file is used for holding selected areas from mapwindow. The reason why the standard GRASS raster is not used is that for every modification (new area is selected) we would need to create whole new raster. Instead of this scatter plot only modifies affected region in the internal pgm file.
cat_rast_region | region to be file generated for | |
[out] | cat_rast | path where the pgm raster file will be generated |
Definition at line 59 of file iscatt_core.c.
References G_warning().
int I_find_group | ( | const char * | group | ) |
does group exist?
Returns 1 if the specified group exists in the current mapset; 0 otherwise. Use I_find_group2 to search in all or a specific mapset.
group |
Definition at line 21 of file imagery/find.c.
References G_find_file2(), G_mapset(), and NULL.
Referenced by I_find_group_file(), I_find_subgroup(), I_find_subgroup_file(), I_get_subgroup(), and I_put_subgroup().
int I_find_group2 | ( | const char * | group, |
const char * | mapset | ||
) |
Does the group exists?
Finds a group in specified mapset or any mapset if mapset is not set. Internally uses G_find_file2().
group | |
mapset |
Definition at line 40 of file imagery/find.c.
References G_find_file2(), and NULL.
Referenced by I_find_group_file2(), I_find_subgroup2(), I_find_subgroup_file2(), and list_subgroups().
int I_find_group_file | ( | const char * | group, |
const char * | file | ||
) |
Searches for a group file in the current mapset.
group | |
file |
Definition at line 52 of file imagery/find.c.
References file, G_find_file2_misc(), G_mapset(), I_find_group(), and NULL.
int I_find_group_file2 | ( | const char * | group, |
const char * | mapset, | ||
const char * | file | ||
) |
Searches for a group file in the specified mapset.
group | |
file |
Definition at line 69 of file imagery/find.c.
References file, G_find_file2_misc(), I_find_group2(), and NULL.
Referenced by fopen_group_file_old().
const char* I_find_signature | ( | I_SIGFILE_TYPE | type, |
char * | name, | ||
const char * | mapset | ||
) |
Find mapset containing signature file.
Looks for the signature name of type type in the database. The mapset parameter can either be the empty string "", which means search all the mapsets in the users current mapset search path (see Mapset_Search_Path for more details about the search path) or it can be a specific mapset name, which means look for the signature only in this one mapset (for example, in the current mapset). If found, the mapset where the signature lives is returned. If not found, the NULL pointer is returned.
Note: If the user specifies a fully qualified signature name which exists, then I_find_signature() modifies name by removing the "@<i>mapset</i>". Use I_find_signature2 if altering passed in name is not desired.
type | I_SIGFILE_TYPE |
name | of signature |
mapset | set NULL to search in all mapsets |
Definition at line 204 of file imagery/find.c.
const char* I_find_signature2 | ( | I_SIGFILE_TYPE | type, |
const char * | name, | ||
const char * | mapset | ||
) |
Find mapset containing signature (look but don't touch)
Looks for the signature name of type type in the database. The mapset parameter can either be the empty string "", which means search all the mapsets in the users current mapset search path (see Mapset_Search_Path for more details about the search path) or it can be a specific mapset name, which means look for the signature only in this one mapset (for example, in the current mapset). If found, the mapset where the signature lives is returned. If not found, the NULL pointer is returned.
Note: The passed name argument is not altered. Use I_find_signature if stripping mapset part from the name is desired.
type | I_SIGFILE_TYPE |
name | of signature |
mapset | set NULL to search in all mapsets |
Definition at line 240 of file imagery/find.c.
int I_find_subgroup | ( | const char * | group, |
const char * | subgroup | ||
) |
Searches for a subgroup in the current mapset.
group | |
subgroup |
Definition at line 86 of file imagery/find.c.
References G_debug(), G_find_file2_misc(), G_mapset(), GNAME_MAX, HOST_DIRSEP, I_find_group(), and NULL.
int I_find_subgroup2 | ( | const char * | group, |
const char * | subgroup, | ||
const char * | mapset | ||
) |
Searches for a subgroup in specified mapset or any mapset if mapset is not set.
group | |
subgroup | |
mapset |
Definition at line 110 of file imagery/find.c.
References G_debug(), G_find_file2_misc(), GNAME_MAX, HOST_DIRSEP, I_find_group2(), and NULL.
int I_find_subgroup_file | ( | const char * | group, |
const char * | subgroup, | ||
const char * | file | ||
) |
Searches for a subgroup file in the current mapset.
group | |
subgroup | |
file |
Definition at line 134 of file imagery/find.c.
References file, G_debug(), G_find_file2_misc(), G_mapset(), GNAME_MAX, HOST_DIRSEP, I_find_group(), and NULL.
int I_find_subgroup_file2 | ( | const char * | group, |
const char * | subgroup, | ||
const char * | mapset, | ||
const char * | file | ||
) |
Searches for a subgroup file in the specified mapset.
group | |
subgroup | |
mapset | |
file |
Definition at line 162 of file imagery/find.c.
References file, G_debug(), G_find_file2_misc(), GNAME_MAX, HOST_DIRSEP, I_find_group2(), and NULL.
Referenced by fopen_subgroup_file_old().
FILE* I_fopen_group_file_append | ( | const char * | group, |
const char * | file | ||
) |
Definition at line 81 of file fopen.c.
References _, file, G_fopen_append_misc(), G_mapset(), and G_warning().
FILE* I_fopen_group_file_new | ( | const char * | group, |
const char * | file | ||
) |
Definition at line 69 of file fopen.c.
References _, file, G_fopen_new_misc(), G_mapset(), and G_warning().
Referenced by I_fopen_group_ref_new(), I_put_control_points(), I_put_group_title(), I_put_subgroup(), and I_put_target().
FILE* I_fopen_group_file_old | ( | const char * | group, |
const char * | file | ||
) |
Open group file for reading.
Internally uses G_fopen_old_misc
group | |
file |
Definition at line 102 of file fopen.c.
References file, fopen_group_file_old(), and NULL.
Referenced by I_fopen_group_ref_old(), I_get_control_points(), I_get_group_title(), I_get_subgroup(), and I_get_target().
FILE* I_fopen_group_file_old2 | ( | const char * | group, |
const char * | mapset, | ||
const char * | file | ||
) |
Open group file for reading.
Internally uses G_fopen_old_misc
group | |
mapset | |
file |
Definition at line 117 of file fopen.c.
References file, and fopen_group_file_old().
Referenced by I_fopen_group_ref_old2().
FILE* I_fopen_group_ref_new | ( | const char * | group | ) |
Definition at line 25 of file ref.c.
References I_fopen_group_file_new().
FILE* I_fopen_group_ref_old | ( | const char * | group | ) |
Definition at line 30 of file ref.c.
References I_fopen_group_file_old().
FILE* I_fopen_group_ref_old2 | ( | const char * | group, |
const char * | mapset | ||
) |
Definition at line 35 of file ref.c.
References I_fopen_group_file_old2().
FILE* I_fopen_signature_file_new | ( | const char * | name | ) |
Create signature file.
Returns a pointer to FILE for writing signature file. Use fclose on the pointer to close after use.
name | signature filename |
Definition at line 28 of file sigfile.c.
References G_fopen_new_misc(), GNAME_MAX, I_get_signatures_dir(), I_make_signatures_dir(), I_SIGFILE_TYPE_SIG, and name.
FILE* I_fopen_signature_file_old | ( | const char * | name | ) |
Open existing signature file.
Use fully qualified names for signatures from other mapsets.
Returns a pointer to FILE with signature. Use fclose on the pointer after use.
name | signature filename |
Definition at line 54 of file sigfile.c.
References G_fopen_old_misc(), G_mapset(), G_unqualified_name(), GMAPSET_MAX, GNAME_MAX, I_get_signatures_dir(), I_SIGFILE_TYPE_SIG, name, NULL, and strcpy.
FILE* I_fopen_sigset_file_new | ( | const char * | name | ) |
Create new sigset file.
name | name of sigset file |
Definition at line 28 of file sigsetfile.c.
References G_fopen_new_misc(), GNAME_MAX, I_get_signatures_dir(), I_make_signatures_dir(), I_SIGFILE_TYPE_SIGSET, and name.
FILE* I_fopen_sigset_file_old | ( | const char * | name | ) |
Open existing sigset signature file.
name | name of signature file (may be fully qualified) |
Definition at line 50 of file sigsetfile.c.
References G_fopen_old_misc(), G_mapset(), G_unqualified_name(), GMAPSET_MAX, GNAME_MAX, I_get_signatures_dir(), I_SIGFILE_TYPE_SIGSET, name, NULL, and strcpy.
FILE* I_fopen_subgroup_file_append | ( | const char * | group, |
const char * | subgroup, | ||
const char * | file | ||
) |
Definition at line 145 of file fopen.c.
References _, file, G__make_mapset_element_misc(), G_fopen_append_misc(), G_mapset(), G_warning(), and GNAME_MAX.
FILE* I_fopen_subgroup_file_new | ( | const char * | group, |
const char * | subgroup, | ||
const char * | file | ||
) |
Definition at line 123 of file fopen.c.
References _, file, G__make_mapset_element_misc(), G_fopen_new_misc(), G_mapset(), G_warning(), and GNAME_MAX.
Referenced by I_fopen_subgroup_ref_new().
FILE* I_fopen_subgroup_file_old | ( | const char * | group, |
const char * | subgroup, | ||
const char * | file | ||
) |
Definition at line 167 of file fopen.c.
References file, fopen_subgroup_file_old(), and NULL.
Referenced by I_fopen_subgroup_ref_old().
FILE* I_fopen_subgroup_file_old2 | ( | const char * | group, |
const char * | subgroup, | ||
const char * | mapset, | ||
const char * | file | ||
) |
Definition at line 173 of file fopen.c.
References file, and fopen_subgroup_file_old().
Referenced by I_fopen_subgroup_ref_old2().
FILE* I_fopen_subgroup_ref_new | ( | const char * | group, |
const char * | subgroup | ||
) |
Definition at line 49 of file ref.c.
References I_fopen_subgroup_file_new().
FILE* I_fopen_subgroup_ref_old | ( | const char * | group, |
const char * | subgroup | ||
) |
Definition at line 54 of file ref.c.
References I_fopen_subgroup_file_old().
FILE* I_fopen_subgroup_ref_old2 | ( | const char * | group, |
const char * | subgroup, | ||
const char * | mapset | ||
) |
Definition at line 62 of file ref.c.
References I_fopen_subgroup_file_old2().
int I_free | ( | void * | b | ) |
Definition at line 21 of file imagery/alloc.c.
References b, G_free(), and NULL.
Referenced by I_cluster_exec_free().
int I_free_double2 | ( | double ** | x | ) |
Definition at line 93 of file imagery/alloc.c.
References G_free(), NULL, and x.
Referenced by I_cluster_exec_free(), and I_free_double3().
int I_free_double3 | ( | double *** | x | ) |
Definition at line 128 of file imagery/alloc.c.
References G_free(), I_free_double2(), NULL, and x.
int I_free_group_ref | ( | struct Ref * | ref | ) |
free Ref structure
This routine frees memory allocated to the ref structure.
ref |
Definition at line 484 of file group.c.
References Ref::file, free(), and Ref::nfiles.
Referenced by I_iclass_init_group().
int I_free_int2 | ( | int ** | x | ) |
Definition at line 80 of file imagery/alloc.c.
int I_free_signatures | ( | struct Signature * | S | ) |
Free memory allocated for struct Signature.
One must call I_init_signatures() to re-use struct after it has been passed to this function.
*Signature | to free |
Definition at line 60 of file sig.c.
References free(), One_Sig::mean, Signature::nbands, Signature::nsigs, NULL, Signature::semantic_labels, Signature::sig, Signature::title, and One_Sig::var.
Referenced by I_cluster_begin().
void I_free_signatures_list | ( | int | count, |
char *** | list | ||
) |
Free memory allocated by I_signatures_list_by_type.
Calls G_free for all list items returned by I_signatures_list_by_type() Sets pointer to NULL to prevent accidental use after free.
int | Return value of I_signatures_list_by_type() |
pointer | to array filled by I_signatures_list_by_type() |
Definition at line 264 of file manage_signatures.c.
int I_georef | ( | double | , |
double | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
int | |||
) |
int I_georef_tps | ( | double | e1, |
double | n1, | ||
double * | e, | ||
double * | n, | ||
double * | E, | ||
double * | N, | ||
struct Control_Points * | cp, | ||
int | fwd | ||
) |
Definition at line 63 of file georef_tps.c.
References Control_Points::count, Control_Points::e1, Control_Points::e2, N, Control_Points::n1, Control_Points::n2, and Control_Points::status.
int I_get_control_points | ( | const char * | group, |
struct Control_Points * | cp | ||
) |
read group control points
Reads the control points from the POINTS file for the group into the cp structure. Returns 1 if successful; 0 otherwise (and prints a diagnostic error). Note. An error message is printed if the POINTS file is invalid, or does not exist.
group | |
cp |
Definition at line 113 of file points.c.
References _, G_mapset(), G_warning(), I_fopen_group_file_old(), NULL, and POINT_FILE.
int I_get_group | ( | char * | group | ) |
Definition at line 37 of file group.c.
References G_fopen_old(), G_mapset(), G_suppress_warnings(), GROUPFILE, and NULL.
int I_get_group_ref | ( | const char * | group, |
struct Ref * | ref | ||
) |
read group REF file
Reads the contents of the REF file for the specified group into the ref structure. Returns 1 if successful; 0 otherwise (but no error messages are printed).
group | |
ref |
Definition at line 112 of file group.c.
Referenced by I_iclass_init_group().
int I_get_group_ref2 | ( | const char * | group, |
const char * | mapset, | ||
struct Ref * | ref | ||
) |
int I_get_group_title | ( | const char * | group, |
char * | title, | ||
int | n | ||
) |
Definition at line 4 of file title.c.
References G_getl2(), G_suppress_warnings(), I_fopen_group_file_old(), and NULL.
void I_get_signatures_dir | ( | char * | dir, |
I_SIGFILE_TYPE | type | ||
) |
Get signature directory.
The directory will be in a form "signatures/<type>".
dir | [GNAME_MAX] allocated string buffer |
type | I_SIGFILE_TYPE |
Definition at line 29 of file manage_signatures.c.
Referenced by I_fopen_signature_file_new(), I_fopen_signature_file_old(), I_fopen_sigset_file_new(), and I_fopen_sigset_file_old().
int I_get_subgroup | ( | const char * | group, |
char * | subgroup | ||
) |
Definition at line 67 of file group.c.
References G_suppress_warnings(), I_find_group(), I_fopen_group_file_old(), NULL, and SUBGROUPFILE.
int I_get_subgroup_ref | ( | const char * | group, |
const char * | subgroup, | ||
struct Ref * | ref | ||
) |
read subgroup REF file
Reads the contents of the REF file for the specified subgroup of the specified group into the ref structure. Returns 1 if successful; 0 otherwise (but no error messages are printed).
group | |
subgroup | |
ref |
Definition at line 149 of file group.c.
Referenced by I_iclass_init_group().
int I_get_subgroup_ref2 | ( | const char * | group, |
const char * | subgroup, | ||
const char * | mapset, | ||
struct Ref * | ref | ||
) |
int I_get_target | ( | const char * | group, |
char * | location, | ||
char * | mapset | ||
) |
read target information
Reads the target location and mapset from the TARGET file for the specified group. Returns 1 if successful; 0 otherwise (and prints a diagnostic error). This routine is used by g.gui.gcp and i.rectify and probably should not be used by other programs. Note. This routine does not validate the target information.
group | |
location | |
mapset |
Definition at line 22 of file target.c.
References _, G_suppress_warnings(), G_warning(), I_fopen_group_file_old(), and NULL.
const char* I_GetClassTitle | ( | const struct ClassSig * | C | ) |
const char* I_GetSigTitle | ( | const struct SigSet * | S | ) |
void I_iclass_add_signature | ( | struct Signature * | sigs, |
IClass_statistics * | statistics | ||
) |
Add one signature.
[out] | sigs | pointer to signatures |
statistics | pointer to statistics structure |
Definition at line 64 of file iclass_signatures.c.
References One_Sig::b, b, IClass_statistics::band_mean, IClass_statistics::color, One_Sig::desc, One_Sig::g, g, G_debug(), G_str_to_color(), One_Sig::have_color, I_new_signature(), One_Sig::mean, IClass_statistics::name, Signature::nbands, IClass_statistics::ncells, One_Sig::npoints, Signature::nsigs, One_Sig::r, r, Signature::sig, One_Sig::status, strcpy, One_Sig::var, and var_signature().
int I_iclass_analysis | ( | IClass_statistics * | statistics, |
struct Ref * | refer, | ||
struct Map_info * | map_info, | ||
const char * | layer_name, | ||
const char * | group, | ||
const char * | raster_name | ||
) |
Calculates statistical values for one class and multiple bands based on training areas.
Calculates values statistical based on the cells that are within training areas. Creates raster map to display the cells of the image bands which fall within standard deviations from the means.
statistics | pointer to bands statistics |
refer | pointer to band files structure |
map_info | vector map with training areas |
layer_name | vector layer |
group | name of imagery group |
raster_name | name of temporary raster map (to be created) |
Definition at line 50 of file iclass.c.
References _, alloc_statistics(), IClass_statistics::cat, close_band_files(), create_raster(), free_perimeters(), G_debug(), G_get_set_window(), G_warning(), make_all_statistics(), Ref::nfiles, open_band_files(), and vector2perimeters().
void I_iclass_create_raster | ( | IClass_statistics * | statistics, |
struct Ref * | refer, | ||
const char * | raster_name | ||
) |
Create raster map based on statistics.
statistics | pointer to bands statistics |
refer | pointer to band files structure |
raster_name | name of temporary raster map (to be created) |
Definition at line 160 of file iclass.c.
References b, band_range(), close_band_files(), create_raster(), IClass_statistics::nbands, and open_band_files().
void I_iclass_free_statistics | ( | IClass_statistics * | statistics | ) |
Free space allocated for statistics attributes.
Frees all allocated arrays in statistics structure.
statistics | pointer to statistics structure |
Definition at line 107 of file iclass_statistics.c.
References IClass_statistics::band_histo, IClass_statistics::band_max, IClass_statistics::band_mean, IClass_statistics::band_min, IClass_statistics::band_product, IClass_statistics::band_range_max, IClass_statistics::band_range_min, IClass_statistics::band_stddev, IClass_statistics::band_sum, IClass_statistics::color, G_debug(), G_free(), IClass_statistics::name, and IClass_statistics::nbands.
int I_iclass_init_group | ( | const char * | group_name, |
const char * | subgroup_name, | ||
struct Ref * | refer | ||
) |
Read files for the specified group subgroup into the Ref structure.
group_name | name of imagery group | |
subgroup_name | name of imagery subgroup | |
subgroup_name | if it is NULL, bands from group will be used | |
[out] | refer | pointer to band files structure |
Definition at line 105 of file iclass.c.
References _, Ref::file, G_debug(), G_find_raster(), G_warning(), I_free_group_ref(), I_get_group_ref(), I_get_subgroup_ref(), I_init_group_ref(), Ref_Files::mapset, Ref_Files::name, Ref::nfiles, and NULL.
Initialize signatures.
[out] | sigs | pointer to signatures |
refer | pointer to band files structure |
Definition at line 45 of file iclass_signatures.c.
References Ref::file, G_debug(), I_init_signatures(), Ref_Files::mapset, Ref_Files::name, Ref::nfiles, Rast_get_semantic_label_or_name(), and Signature::semantic_labels.
void I_iclass_init_statistics | ( | IClass_statistics * | statistics, |
int | category, | ||
const char * | name, | ||
const char * | color, | ||
float | nstd | ||
) |
Initialize statistics.
[out] | statistics | pointer to statistics structure |
category | category (class) | |
name | class name | |
color | class color | |
nstd | standard deviation |
Definition at line 45 of file iclass_statistics.c.
References IClass_statistics::band_histo, IClass_statistics::band_max, IClass_statistics::band_mean, IClass_statistics::band_min, IClass_statistics::band_product, IClass_statistics::band_range_max, IClass_statistics::band_range_min, IClass_statistics::band_stddev, IClass_statistics::band_sum, IClass_statistics::cat, IClass_statistics::color, G_debug(), G_store(), IClass_statistics::name, name, IClass_statistics::nbands, IClass_statistics::ncells, IClass_statistics::nstd, and NULL.
void I_iclass_statistics_get_cat | ( | IClass_statistics * | statistics, |
int * | cat | ||
) |
Get category (class).
statistics | pointer to statistics structure | |
[out] | cat | category |
Definition at line 471 of file iclass_statistics.c.
References IClass_statistics::cat.
void I_iclass_statistics_get_color | ( | IClass_statistics * | statistics, |
const char ** | color | ||
) |
Get category (class) color.
statistics | pointer to statistics structure | |
[out] | color | category color |
Definition at line 502 of file iclass_statistics.c.
References IClass_statistics::color.
int I_iclass_statistics_get_histo | ( | IClass_statistics * | statistics, |
int | band, | ||
int | cat, | ||
int * | value | ||
) |
Get histogram value in band.
Each band has one value for each raster cell category. Value is number of cells in category.
statistics | pointer to statistics structure | |
band | band index | |
cat | raster cell category | |
[out] | value | number of cells in category |
Definition at line 670 of file iclass_statistics.c.
References _, IClass_statistics::band_histo, G_warning(), and IClass_statistics::nbands.
int I_iclass_statistics_get_max | ( | IClass_statistics * | statistics, |
int | band, | ||
int * | max | ||
) |
Get maximum value in band.
statistics | pointer to statistics structure | |
band | band index | |
[out] | max | maximum value |
Definition at line 574 of file iclass_statistics.c.
References _, IClass_statistics::band_max, G_warning(), max, and IClass_statistics::nbands.
int I_iclass_statistics_get_mean | ( | IClass_statistics * | statistics, |
int | band, | ||
float * | mean | ||
) |
Get mean of cell category values in band.
statistics | pointer to statistics structure | |
band | band index | |
[out] | mean | mean |
Definition at line 620 of file iclass_statistics.c.
References _, IClass_statistics::band_mean, G_warning(), mean(), and IClass_statistics::nbands.
int I_iclass_statistics_get_min | ( | IClass_statistics * | statistics, |
int | band, | ||
int * | min | ||
) |
Get minimum value in band.
statistics | pointer to statistics structure | |
band | band index | |
[out] | min | minimum value |
Definition at line 551 of file iclass_statistics.c.
References _, IClass_statistics::band_min, G_warning(), min, and IClass_statistics::nbands.
void I_iclass_statistics_get_name | ( | IClass_statistics * | statistics, |
const char ** | name | ||
) |
Get category (class) name.
statistics | pointer to statistics structure | |
[out] | name | category name |
Definition at line 486 of file iclass_statistics.c.
References IClass_statistics::name, and name.
void I_iclass_statistics_get_nbands | ( | IClass_statistics * | statistics, |
int * | nbands | ||
) |
Get number of bands.
statistics | pointer to statistics structure | |
[out] | nbands | number of bands |
Definition at line 460 of file iclass_statistics.c.
References IClass_statistics::nbands.
void I_iclass_statistics_get_ncells | ( | IClass_statistics * | statistics, |
int * | ncells | ||
) |
Get number of cells in training areas.
statistics | pointer to statistics structure | |
[out] | ncells | number of cells |
Definition at line 514 of file iclass_statistics.c.
References IClass_statistics::ncells.
void I_iclass_statistics_get_nstd | ( | IClass_statistics * | statistics, |
float * | nstd | ||
) |
Get the multiplier of standard deviation.
statistics | pointer to statistics structure | |
[out] | nstd | multiplier of standard deviation |
Definition at line 525 of file iclass_statistics.c.
References IClass_statistics::nstd.
int I_iclass_statistics_get_product | ( | IClass_statistics * | statistics, |
int | band1, | ||
int | band2, | ||
float * | value | ||
) |
Get product value.
Product value of two bands is sum of products of cell category values of two bands. Only cells from training areas are taken into account.
statistics | statistics object | |
band1 | index of first band | |
band2 | index of second band | |
[out] | value | product value |
Definition at line 702 of file iclass_statistics.c.
References _, IClass_statistics::band_product, G_warning(), and IClass_statistics::nbands.
int I_iclass_statistics_get_range_max | ( | IClass_statistics * | statistics, |
int | band, | ||
int * | max | ||
) |
Get maximum cell value based on mean and standard deviation for band.
statistics | pointer to statistics structure | |
band | band index | |
[out] | max | maximum value |
Definition at line 748 of file iclass_statistics.c.
References _, IClass_statistics::band_range_max, G_warning(), max, and IClass_statistics::nbands.
int I_iclass_statistics_get_range_min | ( | IClass_statistics * | statistics, |
int | band, | ||
int * | min | ||
) |
Get minimum cell value based on mean and standard deviation for band.
statistics | pointer to statistics structure | |
band | band index | |
[out] | min | minimum value |
Definition at line 725 of file iclass_statistics.c.
References _, IClass_statistics::band_range_min, G_warning(), min, and IClass_statistics::nbands.
int I_iclass_statistics_get_stddev | ( | IClass_statistics * | statistics, |
int | band, | ||
float * | stddev | ||
) |
Get standard deviation of cell category values in band.
statistics | pointer to statistics structure | |
band | band index | |
[out] | stddev | standard deviation |
Definition at line 643 of file iclass_statistics.c.
References _, IClass_statistics::band_stddev, G_warning(), IClass_statistics::nbands, and stddev().
int I_iclass_statistics_get_sum | ( | IClass_statistics * | statistics, |
int | band, | ||
float * | sum | ||
) |
Get sum of values in band.
statistics | pointer to statistics structure | |
band | band index | |
[out] | sum | sum |
Definition at line 597 of file iclass_statistics.c.
References _, IClass_statistics::band_sum, G_warning(), and IClass_statistics::nbands.
void I_iclass_statistics_set_nstd | ( | IClass_statistics * | statistics, |
float | nstd | ||
) |
Set the multiplier of standard deviation.
statistics | pointer to statistics structure |
nstd | multiplier of standard deviation |
Definition at line 536 of file iclass_statistics.c.
References IClass_statistics::nstd.
int I_iclass_write_signatures | ( | struct Signature * | sigs, |
const char * | file_name | ||
) |
Write signtures to signature file.
sigs | pointer to signatures |
file_name | name of signature file |
Definition at line 108 of file iclass_signatures.c.
int I_id_scatt_to_bands | ( | const int | scatt_id, |
const int | n_bands, | ||
int * | b_1_id, | ||
int * | b_2_id | ||
) |
Compute band ids from scatter plot id.
Scatter plot id describes which bands defines the scatter plot.
Let say we have 3 bands, their ids are 0, 1 and 2. Scatter plot with id 0 consists of band 1 (b_1_id) 0 and band 2 (b_2_id) 1. All scatter plots: scatt_id b_1_id b_2_id 0 0 1 1 0 2 2 1 2
scatt_id | scatter plot id | |
n_bands | number of bands | |
[out] | b_1_id | id of band1 |
[out] | b_2_id | id of band2 |
Definition at line 41 of file iscatt_structs.c.
Referenced by I_sc_insert_scatt_data().
int I_init_group_ref | ( | struct Ref * | ref | ) |
initialize Ref structure
This routine initializes the ref structure for other library calls which require a Ref structure. This routine must be called before any use of the structure can be made. Note. The routines I_get_group_ref and I_get_subgroup_ref call this routine automatically.
ref |
Definition at line 466 of file group.c.
References Ref::blu, Ref_Color::n, Ref::nfiles, NULL, and Ref_Color::table.
Referenced by I_iclass_init_group().
int I_init_ref_color_nums | ( | struct Ref * | ref | ) |
Definition at line 253 of file group.c.
References Ref::blu, Ref_Color::index, Ref_Color::n, Ref::nfiles, NULL, and Ref_Color::table.
int I_init_signatures | ( | struct Signature * | S, |
int | nbands | ||
) |
Initialize struct Signature before use.
No need to call before calling I_read_signatures.
*Signature | to initialize |
nbands | band (imagery group member) count |
Definition at line 14 of file sig.c.
References G_malloc, Signature::have_oclass, Signature::nbands, Signature::nsigs, NULL, Signature::semantic_labels, Signature::sig, and Signature::title.
Referenced by I_cluster_begin(), I_cluster_clear(), and I_iclass_init_signatures().
int I_InitSigSet | ( | struct SigSet * | S, |
int | nbands | ||
) |
Initialize struct SigSet before use.
No need to call before calling I_ReadSigSet.
*Signature | to initialize |
nbands | band (imagery group member) count |
Definition at line 64 of file sigset.c.
References SigSet::ClassSig, G_malloc, SigSet::nbands, SigSet::nclasses, NULL, SigSet::semantic_labels, and SigSet::title.
Referenced by I_ReadSigSet().
int I_insert_patch_to_cat_rast | ( | const char * | patch_rast, |
struct Cell_head * | cat_rast_region, | ||
const char * | cat_rast | ||
) |
Insert raster map patch into pgm file.
Warning: calls Rast_set_window
patch_rast | name of raster map |
cat_rast_region | region of category raster file |
cat_rast | path to category raster file |
Definition at line 231 of file iscatt_core.c.
int I_list_group | ( | const char * | group, |
const struct Ref * | ref, | ||
FILE * | fd | ||
) |
Prints maps in a group (fancy version)
group | group name |
ref | group reference (set with I_get_group_ref()) |
fd | where to print (typically stdout) |
Definition at line 26 of file list_gp.c.
References _, Ref::file, I__list_group_name_fit(), Ref_Files::mapset, max, Ref_Files::name, and Ref::nfiles.
int I_list_group_simple | ( | const struct Ref * | ref, |
FILE * | fd | ||
) |
Prints maps in a group (simple version)
Same as I_list_group(), but without all the fancy stuff. Prints one map per line in map@mapset form.
ref | group reference (set with I_get_group_ref()) |
fd | where to print (typically stdout) |
Definition at line 73 of file list_gp.c.
References Ref::file, Ref_Files::mapset, Ref_Files::name, and Ref::nfiles.
Referenced by I_list_subgroup_simple().
int I_list_subgroup | ( | const char * | group, |
const char * | subgroup, | ||
const struct Ref * | ref, | ||
FILE * | fd | ||
) |
Prints maps in a subgroup (fancy version)
group | group name |
subgroup | subgroup name |
ref | group reference (set with I_get_subgroup_ref()) |
fd | where to print (typically stdout) |
Definition at line 81 of file list_subgp.c.
References _, Ref::file, I__list_group_name_fit(), Ref_Files::mapset, max, Ref_Files::name, and Ref::nfiles.
int I_list_subgroup_simple | ( | const struct Ref * | ref, |
FILE * | fd | ||
) |
Prints maps in a subgroup (simple version)
Same as I_list_subgroup(), but without all the fancy stuff. Prints one map per line in map@mapset form.
ref | group reference (set with I_get_subgroup_ref()) |
fd | where to print (typically stdout) |
Definition at line 134 of file list_subgp.c.
References I_list_group_simple().
char** I_list_subgroups | ( | const char * | group, |
int * | subgs_num | ||
) |
Get list of subgroups which a group contatins.
group | group name | |
[out] | subgs_num | number of subgroups which the group contains |
Definition at line 52 of file list_subgp.c.
References G_mapset(), and list_subgroups().
char** I_list_subgroups2 | ( | const char * | group, |
const char * | mapset, | ||
int * | subgs_num | ||
) |
Get list of subgroups which a group contatins.
group | group name | |
mapset | mapset name | |
[out] | subgs_num | number of subgroups which the group contains |
Definition at line 67 of file list_subgp.c.
References list_subgroups().
char* I_location_info | ( | const char * | middle | ) |
Definition at line 7 of file loc_info.c.
References G_calloc, G_location(), and G_mapset().
void I_make_signatures_dir | ( | I_SIGFILE_TYPE | type | ) |
Make signature dir.
Creates directories for storage of signature files of specified type. E.g. "<location>/<mapset>/signatures/<type>/"
type | I_SIGFILE_TYPE |
Definition at line 53 of file manage_signatures.c.
Referenced by I_fopen_signature_file_new(), and I_fopen_sigset_file_new().
void* I_malloc | ( | size_t | n | ) |
Definition at line 5 of file imagery/alloc.c.
int I_merge_arrays | ( | unsigned char * | merged_arr, |
unsigned char * | overlay_arr, | ||
unsigned | rows, | ||
unsigned | cols, | ||
double | alpha | ||
) |
Merge arrays according to opacity. Every pixel in array must be represented by 4 values (RGBA).
Implemented for speeding up of scatter plots rendering.
merged_arr | array which will be overlayd with overlay_arr |
overlay_arr | array to be merged_arr overlaid with |
rows | number of rows for the both arrays |
cols | number of columns for the both arrays |
alpha | transparency (0-1) of the overlay array for merging |
Definition at line 848 of file iscatt_core.c.
int I_new_control_point | ( | struct Control_Points * | cp, |
double | e1, | ||
double | n1, | ||
double | e2, | ||
double | n2, | ||
int | status | ||
) |
add new control point
Once the control points have been read into the cp structure, this routine adds new points to it. The new control point is given by e1 (column) and n1 (row) on the image, and the e2 (east) and n2 (north) for the target database. The value of status should be 1 if the point is a valid point; 0 otherwise.
cp | |
e1 | |
n1 | |
e2 | |
n2 | |
status |
Definition at line 56 of file points.c.
References Control_Points::count, Control_Points::e1, Control_Points::e2, G_realloc, Control_Points::n1, Control_Points::n2, and Control_Points::status.
int I_new_signature | ( | struct Signature * | S | ) |
Definition at line 30 of file sig.c.
References One_Sig::desc, G_calloc, G_realloc, One_Sig::have_color, One_Sig::mean, Signature::nbands, Signature::nsigs, Signature::sig, SIG, One_Sig::status, and One_Sig::var.
Referenced by I_iclass_add_signature().
Definition at line 77 of file sigset.c.
References ClassSig::classnum, SigSet::ClassSig, G_malloc, G_realloc, SigSet::nclasses, ClassSig::nsubclasses, NULL, SIGNATURE_TYPE_MIXED, ClassSig::title, ClassSig::type, and ClassSig::used.
Definition at line 96 of file sigset.c.
References SubSig::cnst, G_calloc, G_malloc, G_realloc, SubSig::means, SubSig::N, SigSet::nbands, ClassSig::nsubclasses, SubSig::pi, SubSig::R, SubSig::Rinv, ClassSig::SubSig, and SubSig::used.
int I_put_control_points | ( | const char * | group, |
const struct Control_Points * | cp | ||
) |
write group control points
Writes the control points from the cp structure to the POINTS file for the specified group. Note. Points in cp with a negative status are not written to the POINTS file.
group | |
cp |
Definition at line 148 of file points.c.
References _, G_mapset(), G_warning(), I_fopen_group_file_new(), NULL, and POINT_FILE.
int I_put_group | ( | const char * | group | ) |
Definition at line 54 of file group.c.
References G_fopen_new(), GROUPFILE, and NULL.
int I_put_group_ref | ( | const char * | group, |
const struct Ref * | ref | ||
) |
write group REF file
Writes the contents of the ref structure to the REF file for the specified group. Returns 1 if successful; 0 otherwise (and prints a diagnostic error). Note. This routine will create the group, if it does not already exist.
group | |
ref |
int I_put_group_title | ( | const char * | group, |
const char * | title | ||
) |
Definition at line 20 of file title.c.
References I_fopen_group_file_new(), and NULL.
int I_put_subgroup | ( | const char * | group, |
const char * | subgroup | ||
) |
Definition at line 86 of file group.c.
References I_find_group(), I_fopen_group_file_new(), NULL, and SUBGROUPFILE.
int I_put_subgroup_ref | ( | const char * | group, |
const char * | subgroup, | ||
const struct Ref * | ref | ||
) |
write subgroup REF file
Writes the contents of the ref structure into the REF file for the specified subgroup of the specified group. Returns 1 if successful; 0 otherwise (and prints a diagnostic error). Note. This routine will create the subgroup, if it does not already exist.
group | |
subgroup | |
ref |
int I_put_target | ( | const char * | group, |
const char * | location, | ||
const char * | mapset | ||
) |
write target information
Writes the target location and mapset to the TARGET file for the specified group. Returns 1 if successful; 0 otherwise (but no error messages are printed). This routine is used by i.target and probably should not be used by other programs. Note. This routine does not validate the target information.
group | |
location | |
mapset |
Definition at line 61 of file target.c.
References I_fopen_group_file_new(), and NULL.
int I_rasterize | ( | double * | polygon, |
int | pol_n_pts, | ||
unsigned char | val, | ||
struct Cell_head * | rast_region, | ||
unsigned char * | rast | ||
) |
Wrapper for using of iclass perimeter rasterization by scatter plot. Warning: calls Rast_set_window.
polygon | array of polygon coordinates [x, y, x, y...] | |
pol_n_pts | number of points in the polygon array | |
val | value to be assigned to cells, which belong to plygon | |
rast_region | region of raster | |
[out] | rast | raster to be pologyn rasterized in |
Definition at line 934 of file iscatt_core.c.
int I_read_one_signature | ( | FILE * | fd, |
struct Signature * | S | ||
) |
int I_read_signatures | ( | FILE * | fd, |
struct Signature * | S | ||
) |
Read signatures from file.
File stream should be opened in advance by call to I_fopen_signature_file_old() It is up to caller to fclose the file stream afterwards.
There is no need to initialize struct Signature in advance, as this function internally calls I_init_signatures.
pointer | to FILE* |
pointer | to struct Signature *S |
int I_ReadSigSet | ( | FILE * | fd, |
struct SigSet * | S | ||
) |
Read sigset signatures from file.
File stream should be opened in advance by call to I_fopen_sigset_file_old() It is up to caller to fclose the file stream afterwards.
There is no need to initialise struct SigSet in advance, as this function internally calls I_InitSigSet.
pointer | to FILE* |
pointer | to struct SigSet *S |
Definition at line 141 of file sigset.c.
References _, G_warning(), and I_InitSigSet().
void* I_realloc | ( | void * | b, |
size_t | n | ||
) |
Definition at line 14 of file imagery/alloc.c.
int I_sc_add_cat | ( | struct scCats * | cats | ) |
Add category.
Category represents group of scatter plots.
cats | pointer to scCats struct |
Definition at line 155 of file iscatt_structs.c.
References scCats::cats_arr, scCats::cats_ids, scCats::cats_idxs, G_malloc, G_zero(), scCats::n_a_cats, scScatts::n_a_scatts, scCats::n_cats, scCats::n_scatts, scScatts::scatt_idxs, scScatts::scatts_arr, and scScatts::scatts_bands.
void I_sc_free_cats | ( | struct scCats * | cats | ) |
Free data of struct scCats, the structure itself remains allocated.
cats | pointer to existing scCats struct |
Definition at line 119 of file iscatt_structs.c.
References scCats::cats_arr, scCats::cats_ids, scCats::cats_idxs, G_free(), scCats::n_a_cats, scCats::n_bands, scCats::n_cats, scCats::n_scatts, scScatts::scatt_idxs, scScatts::scatts_arr, scScatts::scatts_bands, and scCats::type.
void I_sc_init_cats | ( | struct scCats * | cats, |
int | n_bands, | ||
int | type | ||
) |
Initialize structure for storing scatter plots data.
cats | pointer to scCats struct |
n_bands | number of bands |
type | SC_SCATT_DATA - stores scatter plots |
type | SC_SCATT_CONDITIONS - stores selected areas in scatter plots |
Definition at line 89 of file iscatt_structs.c.
int I_sc_insert_scatt_data | ( | struct scCats * | cats, |
struct scdScattData * | scatt_data, | ||
int | cat_id, | ||
int | scatt_id | ||
) |
Insert scatter plot data . Inserted scatt_data struct must have same type as cats struct (SC_SCATT_DATA or SC_SCATT_CONDITIONS).
cats | pointer to scCats struct |
scarr_data | pointer to scdScattData struct |
cat_id | id number of category |
scatt_id | id number of scatter plot |
Definition at line 208 of file iscatt_structs.c.
References scdScattData::b_conds_arr, scCats::cats_arr, scCats::cats_idxs, I_id_scatt_to_bands(), scScatts::n_a_scatts, scCats::n_bands, scCats::n_cats, scCats::n_scatts, SC_SCATT_CONDITIONS, SC_SCATT_DATA, scScatts::scatt_idxs, scdScattData::scatt_vals_arr, scScatts::scatts_arr, scScatts::scatts_bands, and scCats::type.
void I_scd_init_scatt_data | ( | struct scdScattData * | scatt_data, |
int | type, | ||
int | n_vals, | ||
void * | data | ||
) |
Insert scatter plot data.
scatt_data | pointer to existing struct scdScattData |
type | SC_SCATT_DATA for scatter plots or SC_SCATT_CONDITIONS for selected areas in scatter plot |
n_vals | number of data values |
data | array of values (unsigned char for SC_SCATT_CONDITIONS, unsigned int for SC_SCATT_DATA) |
Definition at line 259 of file iscatt_structs.c.
int I_SetClassTitle | ( | struct ClassSig * | C, |
const char * | title | ||
) |
int I_SetSigTitle | ( | struct SigSet * | S, |
const char * | title | ||
) |
int I_signatures_copy | ( | I_SIGFILE_TYPE | type, |
const char * | old_name, | ||
const char * | old_mapset, | ||
const char * | new_name | ||
) |
Copy a signature file.
If copy fails, prints warning messages and returns 1. It is safe to pass fully qualified names.
type | I_SIGFILE_TYPE signature type |
name | of old signature |
mapset | of old signature |
name | of new signature |
Definition at line 114 of file manage_signatures.c.
int I_signatures_list_by_type | ( | I_SIGFILE_TYPE | type, |
const char * | mapset, | ||
char *** | out_list | ||
) |
Get list of existing signatures by type.
Fills passed list with fully qualified names of existing signatures.
If no mapset is passed, all mapsets in the search path are used. If no signatures are found, returns 0 and list is set to NULL.
The function will assign memory for the list. It is up to callee to free the memory of each list item and the list itself.
type | I_SIGFILE_TYPE signature type |
mapset | optional mapset to search in or NULL |
pointer | to array of found signature strings or NULL if none found |
Definition at line 237 of file manage_signatures.c.
int I_signatures_remove | ( | I_SIGFILE_TYPE | type, |
const char * | name | ||
) |
Remove a signature file.
If removal fails, prints a warning and returns 1. It is safe to pass fully qualified names.
type | I_SIGFILE_TYPE signature type |
name | of signature to remove |
Definition at line 75 of file manage_signatures.c.
int I_signatures_rename | ( | I_SIGFILE_TYPE | type, |
const char * | old_name, | ||
const char * | new_name | ||
) |
Rename a signature file.
If rename fails, prints warning messages and returns 1. It is safe to pass fully qualified names.
type | I_SIGFILE_TYPE signature type |
name | of old signature |
name | of new signature |
Definition at line 172 of file manage_signatures.c.
int I_SigSetNClasses | ( | struct SigSet * | S | ) |
Definition at line 32 of file sigset.c.
References SigSet::ClassSig, count, SigSet::nclasses, and ClassSig::used.
Reorder struct Signature to match imagery group member order.
The function will check for semantic label match between signature struct and imagery group.
In the case of a complete semantic label match, values of passed in struct Signature are reordered to match the order of imagery group items.
If all semantic labels are not identical (in arbitrary order), function will return two dimensional array with comma separated list of:
If no mismatch of simantic labels for signatures or imagery group are detected (== all are present in the other list), a NULL value will be returned in the particular list of mismatches (not an empty string). For example:
*Signature | existing signatures to check & sort |
*Ref | group reference |
Definition at line 323 of file sig.c.
References Ref::file, G_calloc, G_fatal_error(), G_malloc, Ref_Files::mapset, Ref_Files::name, Signature::nbands, Ref::nfiles, Signature::nsigs, and Rast_get_semantic_label_or_name().
Reorder struct SigSet to match imagery group member order.
The function will check for semantic label match between sigset struct and imagery group.
In the case of a complete semantic label match, values of passed in struct SigSet are reordered to match the order of imagery group items. This reordering is done only for items present in the sigset file. Thus reordering should be done only after calling I_ReadSigSet.
If all semantic labels are not identical (in arbitrary order), function will return two dimensional array with comma separated list of:
If no mismatch of semantic labels for signatures or imagery group are detected (== all are present in the other list), a NULL value will be returned in the particular list of mismatches (not an empty string). For example:
*SigSet | existing signatures to check & sort |
*Ref | group reference |
Definition at line 474 of file sigset.c.
References G_calloc, G_fatal_error(), G_malloc, SigSet::nbands, SigSet::nclasses, SubSig::R, and Rast_get_semantic_label_or_name().
double I_stddev | ( | double | sum, |
double | sum2, | ||
int | n | ||
) |
Definition at line 16 of file var.c.
References I_variance().
copy Ref lists
This routine is used to copy file names from one Ref structure to another. The name and mapset for file n from the src structure are copied into the dst structure (which must be properly initialized). For example, the following code copies one Ref structure to another:
This routine is used by g.gui.gcp to create the REF file for a subgroup.
src | |
n | |
dst |
Definition at line 434 of file group.c.
References Ref::blu, Ref::file, I_add_file_to_group_ref(), Ref_Files::mapset, Ref_Color::n, and Ref_Files::name.
double I_variance | ( | double | sum, |
double | sum2, | ||
int | n | ||
) |
Definition at line 8 of file var.c.
Referenced by I_stddev().
int I_write_signatures | ( | FILE * | fd, |
struct Signature * | S | ||
) |
Write signatures to file.
File stream should be opened in advance by call to I_fopen_signature_file_new() It is up to caller to fclose the file stream afterwards.
pointer | to FILE* |
pointer | to struct Signature *S |
int I_WriteSigSet | ( | FILE * | fd, |
const struct SigSet * | S | ||
) |
Definition at line 394 of file sigset.c.
References ClassSig::classnum, SigSet::ClassSig, I_GetClassTitle(), I_GetSigTitle(), SubSig::means, SigSet::nbands, SigSet::nclasses, ClassSig::nsubclasses, SubSig::pi, SubSig::R, SigSet::semantic_labels, ClassSig::SubSig, ClassSig::type, and ClassSig::used.