Table of Contents
wxIClass
wxIClass is a wxGUI extension. Generates spectral signatures for an image by allowing the user to outline regions of interest. The resulting signature file can be used as input for i.maxlik or as a seed signature file for i.cluster. (cited from i.class manual)
wxIClass should have similar functionality as i.class. Don't be confused with older wxGUI i.class implementation wx.class (addons, wiki). wxIClass should replace wx.class.
It will be available in GRASS 7. In the first development phase it was developed in private repository. It was developed at Czech Technical University in Prague, Faculty of Civil Engineering (FCE CTU in Prague), study program Geoinformatics within Remote Sensing course (153YZOD). When all functionality of old i.class was available, it was moved to trunk.
It's available from the menu "File -> Imagery -> Classify image -> Interactive input for supervised classification". The name in user space is "Supervised Classification Tool".
wxIClass is released under GNU GPL licence and the source is available from GRASS SVN repository.
User wiki
See also GRASS User Wiki page.
Naming conventions
- module name
- User friendly name should be found.
- In the implementation wxIClass is used (and IClass or iclass in C implementation).
- Now Supervised Classification Tool is used as window title (was Classification).
- WxIClass is used for user wiki page title but intended to use wxIClass in text (same as in WxNVIZ article)
- terms in user interface
- Map window panes are called Preview Displays and Training Areas Display.
- Term class is used.
- conventions in implementation
- C
- Function names start with
I_iclass_
. (I
for imagery). - Structure names start with
Iclass_
. - Term category is used instead of class because it is determined by CAT column (rule taken from old
i.class
).
- Function names start with
- Python
- C
Implemented features
- Main window (
MapFrame
) with two maps and area for plots (similar to i.class window) and with statusbar and toolbar similar to GCP - C functions for wxIClass in
lib/imagery
- wxIClass C functions are based on old i.class functions
- computing statistics (mean, ...)
- creating raster map
- simple API for Python
- saving signature file (writing signature file seems to be broken in old i.class, fixed now)
- works for multiple classes (categories) and multiple training areas (i.class worked only for one training area)
- Plots pane showing histograms and coincidence plots (using
PyPlot
) - class (category) manager (add, delete, edit classes)
- name settings
- color settings
- deleting areas when deleting class
- layer management --- one for each display (add, delete, set opacity, move layer to top)
- ability to change the standard deviation multiplier ("matching" raster map is redrawn)
- digitizer is integrated into training map display (works, but segfaults when deleting)
- automatic vector map and raster maps management
- they are temporary (they are deleted when closing window)
- they gets unique names (common part and unique number)
- unique part is from
g.tempfile
function - for vector dot from
g.tempfile
is removed
- unique part is from
- in user interface only common (user friendly) part of the name is shown
- importing/exporting vector map (can export attribute table)
Planned features
Higher priority
- generate signatures also for i.smap
- creating
i.class
module (name can differ) for C part and thus exposing functionality in command line and avoiding the usage of ctypes (C functions directly)
Lower priority
- something like layer manager for both mapwindows (Training and Preview)
- substituted by combo box (moves map layer to top and sets active map for opacity changing and deleting)
- better layer order management than with combo box
- additional functionality
- copying (or moving) layers from one mapwindow to the second one
- exporting raster could be useful
- importing existing signature file (see i.class manual)
- dialog to show generated signature file
- removing subgroup from user interface (maybe considered as a bug by some!)
- scatter plot (in addition to histograms and coincidence plots)
- better updating of plots and raster maps after class name and color change (and also after class combo box change)
- different color for each vector training area
Digitizer requirements
- add area
- edit area
- remove area (implemented)
- in user interface removing boundary and centroid separately is inconvenient
- wxIClass needs removing areas by category
- area which behaves like one object (would by nice to have)
- undo/redo (would be nice to have) (implemented)
- do not add database record for feature
The best solution is probably a set of common classes like IVDigit
and IVDigitWindow
which provide all but customizable digitizing functionality. Then wxIClass digitizer part can use some parameters and overriding of inherited methods to customize digitizer. Overriding need to be used e. g. in places where standard digitizer uses UserSettings
.
Roadmap
- Refactoring of
MapFrame
s aMapWindow
s (mapdisp*.py
,gcpmapdisp*.py
)- reason: creating common
MapFrame
base class and allow specializing in modules like GCP (georectifier) or wxIClass - separating statusbar functionality: r48703
- GCP: r48713, r48764
- moving code to
MapFrameBase
: r48763, r48769 - toolbar access methods: r48765, r48766
- some old invalid code removed: r49806
SingleMapFrame
(used in Map Display and GCP) andDoubleMapFrame
(used in wxIClass): r49811
- reason: creating common
- Create/edit imagery group dialog
- Digitizer
- C library functions for wxIClass
- wxIClass
- Integrated Interactive Scatter Plot Tool (GSoC 2013, Stepan Turek)
Overview of commits to trunk: gui/python/iclass, lib/imagery, include.
List of tickets
- #1516
- plots combo-box
- #2198
- g.gui.iclass doesn't work
- #2439
- g.gui.iclass crashes
- #2464
- g.gui.iclass: show output of signature creation
- #2481
- g.gui.iclass: cannot display analysis results because of "No graphics device selected"
- #2482
- g.gui.iclass: temp maps are not erased when tool is closed
- #2699
- g.gui.iclass doesn't run after selecting training areas
- #2700
- scatterplots in g.gui.iclass don't work on Windows
- #3429
- g.gui.iclass: segfault when loading vector layer
- #3886
- Importing vector training areas in g.gui.iclass (interactive)
- #4019
- g.gui.iclass: Unable to import packages needed for scatter plot