i.maxlik(1)
β¨ i.maxlik β¨
okay bestie, welcome to the GRASS GIS User's Manual page for i.maxlik β yes that's the module name, yes it's literally the moment your imagery data finally gets classified π
πΈ NAME πΈ
i.maxlik β it classifies the cell spectral reflectances in imagery data, no biggie. and the classification is based on the spectral signature information generated by either i.cluster, g.gui.iclass, or i.gensig. periodt. π
π KEYWORDS π
imagery, classification, Maximum Likelihood Classification, MLC β yeah she's got main character energy in the imagery world π
β SYNOPSIS β
i.maxlik
i.maxlik --help
i.maxlik group=name subgroup=name signaturefile=name output=name
[reject=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui]
π¦ Flags: π¦
--overwriteβ allow output files to overwrite existing files (yes she will absolutely replace what's already there, so be aware π)--helpβ print usage summary (your lil cheat sheet π«Ά)--verboseβ verbose module output (she talks more, we love that)--quietβ quiet module output (she shuts up, also valid)--uiβ force launching GUI dialog (for the visual girlies β¨)
π Parameters: π
group=name[required] β name of input imagery groupsubgroup=name[required] β name of input imagery subgroupsignaturefile=name[required] β name of input file containing signatures. Generated by eitheri.cluster,g.gui.iclass, ori.gensigoutput=name[required] β name for output raster map holding classification resultsreject=nameβ name for output raster map holding reject threshold results
π DESCRIPTION π
okay so. i.maxlik is a maximum-likelihood discriminant analysis classifier. it can be used to perform the second step in either an unsupervised or a supervised image classification. second step!! she's the glow-up phase, the finale, the reveal π¬
Either image classification methods are performed in two steps, fr fr. the first step in an unsupervised image classification is performed by i.cluster. the first step in a supervised classification is executed by the GRASS program g.gui.iclass (or by providing any other raster map with already existing training areas). and in both cases, the second step in the image classification procedure is performed by i.maxlik. she does not miss. π
In an unsupervised classification, the maximum-likelihood classifier uses the cluster means and covariance matrices from the i.cluster signature file to determine to which category (spectral class) each cell in the image has the highest probability of belonging. in a supervised image classification, the maximum-likelihood classifier uses the region means and covariance matrices from the spectral signature file generated by g.gui.iclass, based on regions (groups of image pixels) chosen by the user, to determine to which category each cell in the image has the highest probability of belonging. same girl, different source of lore π§
In either case, the raster map output by i.maxlik is a classified image in which each cell has been assigned to a spectral class (i.e., a category). and the spectral classes (categories) can be related to specific land cover types on the ground. like, that pixel is a forest, that pixel is water β she said "let me label your entire landscape" π
π₯ NOTES π₯
The maximum-likelihood classifier assumes that the spectral signatures for each class (category) in each band file are normally distributed (i.e., Gaussian in nature). algorithms, such as i.cluster, g.gui.iclass, or i.gensig, however, can create signatures that are not valid distributed (more likely with g.gui.iclass). and if this occurs, i.maxlik will reject them and display a warning message. not her being picky β she's just standards-forward π
The signature file (signaturefile) contains the cluster and covariance matrices that were calculated by the GRASS program i.cluster (or the region means and covariance matrices generated by g.gui.iclass, if the user runs a supervised classification). These spectral signatures are what determine the categories (classes) to which image pixels will be assigned during the classification process. so basically the signature file is the blueprint and she's just following it, iykyk π
The optional name of a reject raster map holds the reject threshold results. This is the result of a chi square test on each discriminant result at various threshold levels of confidence to determine at what confidence level each cell classified (categorized). It is the reject threshold map layer, and contains the index to one calculated confidence level for each classified cell in the classified image. 16 confidence intervals are predefined, and the reject map is to be interpreted as 1 = keep and 16 = reject. One of the possible uses for this map layer is as a mask, to identify cells in the classified image that have a low probability (high reject index) of being assigned to the correct class. so 1 is "she ate" and 16 is "no ma'am" π
π EXAMPLE π
Second part of the unsupervised classification of a LANDSAT subscene (VIZ, NIR, MIR channels) in North Carolina (see i.cluster manual page for the first part of the example):
# using here the signaturefile created by i.cluster
i.maxlik group=lsat7_2002 subgroup=res_30m \
signaturefile=cluster_lsat2002 \
output=lsat7_2002_cluster_classes reject=lsat7_2002_cluster_reject
# visually check result
d.mon wx0
d.rast.leg lsat7_2002_cluster_classes
d.rast.leg lsat7_2002_cluster_reject
# see how many pixels were rejected at given levels
r.report lsat7_2002_cluster_reject units=k,p
# optionally, filter out pixels with high level of rejection
# here we remove pixels of at least 90% of rejection probability, i.e. categories 12-16
r.mapcalc "lsat7_2002_cluster_classes_filtered = \
if(lsat7_2002_cluster_reject <= 12, lsat7_2002_cluster_classes, null())"
RGB composite of input data
Output raster map with pixels classified (10 classes)
Output raster map with rejection probability values (pixel classification confidence levels)
π«Ά SEE ALSO π«Ά
Image processing and Image classification wiki pages and for historical reference also the GRASS GIS 4 Image Processing manual
g.gui.iclass, i.cluster, i.gensig, i.group, i.segment, i.smap, r.kappa
π AUTHORS π
- Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
- Tao Wen, University of Illinois at Urbana-Champaign, Illinois
- Semantic label support: Maris Nartiss, University of Latvia
π» SOURCE CODE π»
Available at: i.maxlik source code (history)
Accessed: Saturday Jan 17 05:41:41 2026
Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie!! this was i.maxlik(1) from GRASS 8.4.2 β go classify something gorgeous, you've got this πΈβ¨π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms