![]() |
open_iA
2020.01
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
|
A scatter plot matrix (SPLOM) widget. More...
#include <iAQSplom.h>
Classes | |
| struct | Settings |
| All settings of the plot in one struct. More... | |
Public Types | |
| enum | ColorMode { cmAllPointsSame, cmByParameter, cmCustom } |
| < in what way the the dots should be colored. Order must match labels in m_settingsDlg->cbColorMode! More... | |
| enum | ColorParameterMode { pmContinuous, pmQualitative } |
| < How parameter colors should be applied. More... | |
| enum | ColorRangeMode { rmAutomatic, rmManual } |
| < How parameter range is determined if points are colored by parameter. Order must match labels in m_settingsDlg->cbColorRangeMode! More... | |
| enum | SPMMode { smUpperHalf, smAllPlots } |
| < two possible states of SPLOM: upper triangle with maximized plot or all possible combinations of scatter plots More... | |
Public Types inherited from iAScatterPlotSelectionHandler | |
| typedef std::vector< size_t > | SelectionType |
Public Slots | |
| void | rangeFromParameter () |
| Call when color range should be determined from parameter. More... | |
| void | setColorTheme (QString const &themeName) |
| Call to adapt color theme used for coloring by a continuous parameter. More... | |
| void | setColorThemeQual (QString const &themeName) |
| Call to adapt color theme used for coloring by a qualitative parameter. More... | |
| void | setFlipAxes (bool flip) |
| set whether to flip parameters in large scatterplot More... | |
| void | setHistogramBins (int bins) |
| set the number of histogram bins More... | |
| void | setHistogramVisible (bool visible) |
| set visibility of histograms More... | |
| void | setSelectionMode (int mode) |
| set selection mode to either rectangle or polygon mode More... | |
| void | showSettings () |
| Show the settings dialog. More... | |
Signals | |
| void | currentPointModified (size_t index) |
| Emitted when hovered over a new point. More... | |
| void | lookupTableChanged () |
| Emitted when the lookup table has changed. More... | |
| void | parameterVisibilityChanged (size_t paramIndex, bool visible) |
| Emitted when the visibility of a parameter has changed (from within SPLOM, not triggered if it was set from the outside via setParameterVisibility). More... | |
| void | selectionModified (SelectionType const &selInds) |
| Emitted when new data points are selected. Contains a list of selected data points. More... | |
Public Member Functions | |
| void | addContextMenuAction (QAction *action) |
| add an additional option to the context menu More... | |
| void | addFilter (size_t paramIndex, double value) |
| set filter on data to be shown; only data points where given parameter contains given value will be shown More... | |
| void | clearSelection () |
| deletes current selection More... | |
| size_t | colorLookupParam () const |
| parameter currently used for color lookup More... | |
| ColorMode | colorMode () const |
| get current coloring mode More... | |
| QSharedPointer< iASPLOMData > | data () |
| set SPLOM data directly. More... | |
| void | enableSelection (bool enable) |
| set whether selections are allowed or not More... | |
| void | getActivePlotIndices (int *inds_out) |
| Get X and Y parameter indices of currently active scatter plot. More... | |
| double | getAnimIn () const override |
| Getter for animation in property. More... | |
| double | getAnimOut () const override |
| Getter for animation in property. More... | |
| const iAColorTheme * | getBackgroundColorTheme () |
| retrieve the theme for background colors for the separated regions More... | |
| const SelectionType & | getFilteredSelection () const override |
| Get currently selected data points, as indices in the list of filtered data points. These indices are always sorted. More... | |
| const SelectionType & | getHighlightedPoints () const override |
| get the list of highlighted points More... | |
| const SelectionType & | getSelection () const override |
| Get vector of indices of currently selected data points. More... | |
| SelectionType & | getSelection () override |
| Get const vector of indices of currently selected data points. More... | |
| int | getVisibleParametersCount () const override |
| Get the number of parameters currently displayed. More... | |
| iAQSplom (QWidget *parent=0, Qt::WindowFlags f=0) | |
| void | loadSettings (iASettings const &iniFile) |
| load settings from given object More... | |
| QSharedPointer< iALookupTable > | lookupTable () const |
| get lookup table More... | |
| void | removeFilter (size_t paramIndex, double value) |
| remove a specific filter More... | |
| void | resetFilter () |
| reset filter on data; after calling this method, all data points will be shown again More... | |
| void | saveSettings (QSettings &iniFile) const |
| store current settings into given object More... | |
| void | setAnimIn (double anim) |
| Setter for animation in property. More... | |
| void | setAnimOut (double anim) |
| Setter for animation in property. More... | |
| void | setBackgroundColorTheme (iAColorTheme const *theme) |
| define the color theme to use for coloring the different separated regions More... | |
| void | setColorParam (const QString ¶mName) |
| Set the parameter to color code, lookup table will be auto-determined (By Parameter) More... | |
| void | setColorParam (size_t colorLookupParam) |
| Set the parameter to color code, lookup table will be auto-determined (By Parameter) More... | |
| virtual void | setData (const QTableWidget *data) |
| void | setData (QSharedPointer< iASPLOMData > data, std::vector< char > const &visibility) |
| import data from QTableWidget, first row should contain parameter names, each column corresponds to one parameter. More... | |
| void | setFilteredSelection (SelectionType const &filteredSelInds) |
| Set selected data points from indices within the filtered data points. More... | |
| void | setLookupTable (iALookupTable &lut, size_t paramIndex) |
| Set lookup table given the index of a parameter to color-code. More... | |
| void | setLookupTable (vtkLookupTable *lut, const QString ¶mName) |
| retrieve SPLOM data More... | |
| void | setParameterInverted (size_t paramIndex, bool isInverted) |
| whether to invert the axis for a given parameter's index. More... | |
| void | setParameterVisibility (const QString ¶mName, bool isVisible) |
| Show/hide scatter plots of a parameter given parameter's name. More... | |
| void | setParameterVisibility (size_t paramIndex, bool isVisible) |
| Show/hide scatter plots of a parameter given parameter's index. More... | |
| void | setParameterVisibility (std::vector< char > const &visibility) |
| Adapt visibility of all parameters at once. More... | |
| void | setPointColor (QColor const &color) |
| set the color for all data points More... | |
| void | setPointOpacity (double opacity) |
| set the opacity for all data points More... | |
| void | setPointRadius (double radius) |
| set the radius for scatter plot points More... | |
| void | setSelection (SelectionType const &selInds) |
| Set selected data points from a vector of indices. More... | |
| void | setSelectionColor (QColor color) |
| set the color for selected points More... | |
| void | setSeparation (int idx) |
| define an index at which a separation margin is inserted More... | |
| void | showAllPlots (const bool enableAllPlotsVisible) |
| switch between showing all plots or only upper half More... | |
| void | showDefaultMaxizimedPlot () |
| maximize plot in upper left corner More... | |
| ~iAQSplom () | |
Public Member Functions inherited from iAScatterPlotSelectionHandler | |
| virtual | ~iAScatterPlotSelectionHandler () |
Public Attributes | |
| Settings | settings |
Protected Slots | |
| virtual void | currentPointUpdated (size_t index) |
| When hovered over a new point. More... | |
Protected Member Functions | |
| virtual void | addHighlightedPoint (size_t index) |
| Keep a point with index always highlighted. More... | |
| void | changeActivePlot (iAScatterPlot *s) |
| void | clear () |
| Clear all scatter plots in the SPLOM. More... | |
| void | drawPlotLabels (QPainter &painter, bool switchXY) |
| virtual bool | drawPopup (QPainter &painter) |
| Draws popup on the splom. More... | |
| void | drawTicks (QPainter &painter, QList< double > const &ticksX, QList< double > const &ticksY, QList< QString > const &textX, QList< QString > const &textY) |
| Draw ticks for X and Y axes of all plots in the SPLOM. More... | |
| void | drawVisibleParameters (QPainter &painter) |
| draws label for the whole scatter plot matrix More... | |
| QRect | getMaxRect () |
| int | getMaxTickLabelWidth (QList< QString > const &textX, QFontMetrics &fm) const |
| Get the width of the longest tick label width. More... | |
| QRect | getPlotRectByIndex (int x, int y) |
| Get a rectangle of a plot by its indices. More... | |
| iAScatterPlot * | getScatterplotAt (QPoint pos) |
| Get a scatter plot at mouse position. More... | |
| void | initializeGL () override |
| overrides function inherited from base class. More... | |
| int | invert (int val) const |
| Inverts parameter index. Used for inverting SPLOM Y indexing order. More... | |
| void | maximizeSelectedPlot (iAScatterPlot *selectedPlot) |
| shows a maximized preview of the selected plot More... | |
| void | paintEvent (QPaintEvent *event) override |
| Draws all scatter plots, tick labels and axes. More... | |
| virtual void | removeHighlightedPoint (size_t index) |
| Remove a point from the highlighted list. More... | |
| void | removeMaximizedPlot () |
| Removes maximized plot. More... | |
| void | removeMaxPlotIfHidden () |
| Removes maximized plot if any of his parameters is hidden. More... | |
| void | resetTransform () |
| Resets transform in all plots of the matrix. More... | |
| void | updateMaxPlotRect () |
| Updates the rectangle of the maximized scatter plot. More... | |
| void | updatePlotGridParams () |
| Updates some parameters used for the matrix grid layout calculations. More... | |
| void | updateSPLOMLayout () |
| Updates SPLOM layout: every plot in the matrix + maximized plot (if exists). More... | |
| void | updateVisiblePlots () |
| Updates matrix using only plots that are currently visible. More... | |
| void | wheelEvent (QWheelEvent *event) override |
| Overrides of Qt event handlers. More... | |
| void | resizeEvent (QResizeEvent *event) override |
| void | mousePressEvent (QMouseEvent *event) override |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | keyPressEvent (QKeyEvent *event) override |
| void | mouseDoubleClickEvent (QMouseEvent *event) override |
| void | contextMenuEvent (QContextMenuEvent *event) override |
Protected Attributes | |
| iAScatterPlot * | m_activePlot |
| scatter plot that user currently interacts with More... | |
| QPropertyAnimation * | m_animationIn |
| QPropertyAnimation * | m_animationOut |
| const iAColorTheme * | m_bgColorTheme |
| background colors for regions in the scatterplot More... | |
| size_t | m_colorLookupParam |
| index of the column to use for color lookup (TODO: Move to settings?) More... | |
| QMenu * | m_columnPickMenu |
| sub-menu of the context menu for picking which columns are visible More... | |
| QMenu * | m_contextMenu |
| the context menu (can be extended via addContextMenuAction) More... | |
| SelectionType | m_filteredSelInds |
| contains indices of selected points in filtered list (TODO: update only when selection changes and when filters change, remove mutable) More... | |
| SelectionType | m_highlightedPoints |
| contains indices of always highlighted points More... | |
| QSharedPointer< iALookupTable > | m_lut |
| lookup table, shared with individual scatter plots More... | |
| std::vector< std::vector< iAScatterPlot * > > | m_matrix |
| cache for all scatter plots More... | |
| iAScatterPlot * | m_maximizedPlot |
| pointer to the maximized plot More... | |
| SPMMode | m_mode |
| SPLOM current state: all plots or upper triangle with maximized plot (TODO: Move to settings?) More... | |
| std::vector< char > | m_paramVisibility |
| array of individual parameter visibility More... | |
| double | m_popupHeight |
| height of the last drawn popup More... | |
| iAScatterPlot * | m_previewPlot |
| plot currently being previewed (shown in maximized plot) More... | |
| QPoint | m_scatPlotSize |
| size of one scatter plot in the layout More... | |
| SelectionType | m_selInds |
| contains indices of currently selected data points More... | |
| int | m_separationIdx |
| index at which to separate scatterplots spatially (e.g. into in- and output parameters) More... | |
| QSharedPointer< iASPLOMData > | m_splomData |
| contains raw data points used in SPLOM More... | |
| std::vector< size_t > | m_visibleIndices |
| stores mapping from visible plot index to parameter index More... | |
| std::vector< std::vector< iAScatterPlot * > > | m_visiblePlots |
| matrix of visible scatter plots More... | |
Properties | |
| double | m_animIn |
| In animation parameter. More... | |
| double | m_animOut |
| Out animation parameter. More... | |
A scatter plot matrix (SPLOM) widget.
Multidimensional data points are shown using a grid of 2D scatter plots for each pair of dimensions.
Each plot is interactive and user-transformations such as scaling and translating
are possible using mouse wheel and right-button dragging correspondingly.
When 'R' key is pressed all the transformations are reset to default.
The user can also hover over points of any plot, to see a popup with detailed information about the point.
When hovering over a point, it will be highlighted in all plots to allow interactive exploration.
Any parameter of the data can be color-coded using a lookup table.
Any scatter plot from an upper matrix triangle can be maximized by clicking a button in the upper-right corner.
The maximized plot can be minimized by using a button in upper-right corner.
Inherits Q[Open]GLWidget,manages scatter plots internally.
Some customization options are available via the public settings member.
Usage:
- Create iAQSPLOM
- add to a window/widget, make visible
- set some data (using one of the setData methods)
- set a lookup table for dot colors (setLookupTable)
- (optional:) set the parameter visibility (by default, all parameters are visible
- (optional:)
Example (visibleWidget is some widget, currently shown, with a layout):
iAQSplom* splom = new iAQSplom();
visibleWidget->layout()->addWidget(splom);
... you might want enable Qt to process a paint event here, to make sure the OpenGL context is created QSharedPoiner<iASPLOMData> splomData = createSPLOMDataSomehow(); splom->setData(splomData); iALookupTable lut; we assume here you want all points colored in a middle gray; we set up a color lookoup table over all values of column 0, and set the same color for the whole range if you want to color the dots by an actual column value, adapt this to your own needs! lut.setRange( splomData->paramRange(0) ); lut.allocate(2); QColor CustomDotColor(128, 128, 128) lut.setColor( 0, CustomDotColor ); lut.setColor( 1, CustomDotColor ); splom->setLookupTable( lut, 0 );
| enum iAQSplom::ColorMode |
| enum iAQSplom::SPMMode |
| iAQSplom::iAQSplom | ( | QWidget * | parent = 0, |
| Qt::WindowFlags | f = 0 |
||
| ) |
| iAQSplom::~iAQSplom | ( | ) |
| void iAQSplom::addContextMenuAction | ( | QAction * | action | ) |
add an additional option to the context menu
| void iAQSplom::addFilter | ( | size_t | paramIndex, |
| double | value | ||
| ) |
set filter on data to be shown; only data points where given parameter contains given value will be shown
|
protectedvirtual |
Keep a point with index always highlighted.
|
protected |
|
protected |
Clear all scatter plots in the SPLOM.
| void iAQSplom::clearSelection | ( | ) |
deletes current selection
| size_t iAQSplom::colorLookupParam | ( | ) | const |
parameter currently used for color lookup
| iAQSplom::ColorMode iAQSplom::colorMode | ( | ) | const |
get current coloring mode
|
overrideprotected |
|
signal |
Emitted when hovered over a new point.
|
protectedvirtualslot |
When hovered over a new point.
| QSharedPointer< iASPLOMData > iAQSplom::data | ( | ) |
set SPLOM data directly.
|
protected |
|
protectedvirtual |
Draws popup on the splom.
|
protected |
Draw ticks for X and Y axes of all plots in the SPLOM.
|
protected |
draws label for the whole scatter plot matrix
| void iAQSplom::enableSelection | ( | bool | enable | ) |
set whether selections are allowed or not
| void iAQSplom::getActivePlotIndices | ( | int * | inds_out | ) |
Get X and Y parameter indices of currently active scatter plot.
|
inlineoverridevirtual |
Getter for animation in property.
Implements iAScatterPlotSelectionHandler.
|
inlineoverridevirtual |
Getter for animation in property.
Implements iAScatterPlotSelectionHandler.
| const iAColorTheme * iAQSplom::getBackgroundColorTheme | ( | ) |
retrieve the theme for background colors for the separated regions
|
overridevirtual |
Get currently selected data points, as indices in the list of filtered data points. These indices are always sorted.
Implements iAScatterPlotSelectionHandler.
|
overridevirtual |
get the list of highlighted points
Implements iAScatterPlotSelectionHandler.
|
protected |
|
protected |
Get the width of the longest tick label width.
|
protected |
Get a rectangle of a plot by its indices.
|
protected |
Get a scatter plot at mouse position.
|
overridevirtual |
Get vector of indices of currently selected data points.
Implements iAScatterPlotSelectionHandler.
|
overridevirtual |
Get const vector of indices of currently selected data points.
Implements iAScatterPlotSelectionHandler.
|
overridevirtual |
Get the number of parameters currently displayed.
Implements iAScatterPlotSelectionHandler.
|
overrideprotected |
overrides function inherited from base class.
|
protected |
Inverts parameter index. Used for inverting SPLOM Y indexing order.
|
overrideprotected |
| void iAQSplom::loadSettings | ( | iASettings const & | iniFile | ) |
load settings from given object
| QSharedPointer< iALookupTable > iAQSplom::lookupTable | ( | ) | const |
get lookup table
|
signal |
Emitted when the lookup table has changed.
|
protected |
shows a maximized preview of the selected plot
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
Draws all scatter plots, tick labels and axes.
|
signal |
Emitted when the visibility of a parameter has changed (from within SPLOM, not triggered if it was set from the outside via setParameterVisibility).
|
slot |
Call when color range should be determined from parameter.
| void iAQSplom::removeFilter | ( | size_t | paramIndex, |
| double | value | ||
| ) |
remove a specific filter
|
protectedvirtual |
Remove a point from the highlighted list.
|
protected |
Removes maximized plot.
|
protected |
Removes maximized plot if any of his parameters is hidden.
| void iAQSplom::resetFilter | ( | ) |
reset filter on data; after calling this method, all data points will be shown again
|
protected |
Resets transform in all plots of the matrix.
|
overrideprotected |
| void iAQSplom::saveSettings | ( | QSettings & | iniFile | ) | const |
store current settings into given object
|
signal |
Emitted when new data points are selected. Contains a list of selected data points.
| void iAQSplom::setAnimIn | ( | double | anim | ) |
Setter for animation in property.
| void iAQSplom::setAnimOut | ( | double | anim | ) |
Setter for animation in property.
| void iAQSplom::setBackgroundColorTheme | ( | iAColorTheme const * | theme | ) |
define the color theme to use for coloring the different separated regions
| void iAQSplom::setColorParam | ( | const QString & | paramName | ) |
Set the parameter to color code, lookup table will be auto-determined (By Parameter)
| void iAQSplom::setColorParam | ( | size_t | colorLookupParam | ) |
Set the parameter to color code, lookup table will be auto-determined (By Parameter)
|
slot |
Call to adapt color theme used for coloring by a continuous parameter.
|
slot |
Call to adapt color theme used for coloring by a qualitative parameter.
|
virtual |
| void iAQSplom::setData | ( | QSharedPointer< iASPLOMData > | data, |
| std::vector< char > const & | visibility | ||
| ) |
import data from QTableWidget, first row should contain parameter names, each column corresponds to one parameter.
| void iAQSplom::setFilteredSelection | ( | iAQSplom::SelectionType const & | filteredSelInds | ) |
Set selected data points from indices within the filtered data points.
|
slot |
set whether to flip parameters in large scatterplot
|
slot |
set the number of histogram bins
|
slot |
set visibility of histograms
| void iAQSplom::setLookupTable | ( | iALookupTable & | lut, |
| size_t | paramIndex | ||
| ) |
Set lookup table given the index of a parameter to color-code.
| void iAQSplom::setLookupTable | ( | vtkLookupTable * | lut, |
| const QString & | paramName | ||
| ) |
retrieve SPLOM data
Set lookup table from VTK (vtkLookupTable) given the name of a parameter to color-code.
| void iAQSplom::setParameterInverted | ( | size_t | paramIndex, |
| bool | isInverted | ||
| ) |
whether to invert the axis for a given parameter's index.
| void iAQSplom::setParameterVisibility | ( | const QString & | paramName, |
| bool | isVisible | ||
| ) |
Show/hide scatter plots of a parameter given parameter's name.
| void iAQSplom::setParameterVisibility | ( | size_t | paramIndex, |
| bool | isVisible | ||
| ) |
Show/hide scatter plots of a parameter given parameter's index.
| void iAQSplom::setParameterVisibility | ( | std::vector< char > const & | visibility | ) |
Adapt visibility of all parameters at once.
| void iAQSplom::setPointColor | ( | QColor const & | color | ) |
set the color for all data points
| void iAQSplom::setPointOpacity | ( | double | opacity | ) |
set the opacity for all data points
| void iAQSplom::setPointRadius | ( | double | radius | ) |
set the radius for scatter plot points
| void iAQSplom::setSelection | ( | iAQSplom::SelectionType const & | selInds | ) |
Set selected data points from a vector of indices.
| void iAQSplom::setSelectionColor | ( | QColor | color | ) |
set the color for selected points
|
slot |
set selection mode to either rectangle or polygon mode
| void iAQSplom::setSeparation | ( | int | idx | ) |
define an index at which a separation margin is inserted
| void iAQSplom::showAllPlots | ( | const bool | enableAllPlotsVisible | ) |
switch between showing all plots or only upper half
| void iAQSplom::showDefaultMaxizimedPlot | ( | ) |
maximize plot in upper left corner
|
slot |
Show the settings dialog.
|
protected |
Updates the rectangle of the maximized scatter plot.
|
protected |
Updates some parameters used for the matrix grid layout calculations.
|
protected |
Updates SPLOM layout: every plot in the matrix + maximized plot (if exists).
|
protected |
Updates matrix using only plots that are currently visible.
|
overrideprotected |
Overrides of Qt event handlers.
|
protected |
scatter plot that user currently interacts with
|
protected |
|
protected |
|
protected |
background colors for regions in the scatterplot
|
protected |
index of the column to use for color lookup (TODO: Move to settings?)
|
protected |
sub-menu of the context menu for picking which columns are visible
|
protected |
the context menu (can be extended via addContextMenuAction)
|
mutableprotected |
contains indices of selected points in filtered list (TODO: update only when selection changes and when filters change, remove mutable)
|
protected |
contains indices of always highlighted points
|
protected |
lookup table, shared with individual scatter plots
|
protected |
cache for all scatter plots
|
protected |
pointer to the maximized plot
|
protected |
SPLOM current state: all plots or upper triangle with maximized plot (TODO: Move to settings?)
|
protected |
array of individual parameter visibility
|
protected |
height of the last drawn popup
|
protected |
plot currently being previewed (shown in maximized plot)
|
protected |
size of one scatter plot in the layout
|
protected |
contains indices of currently selected data points
|
protected |
index at which to separate scatterplots spatially (e.g. into in- and output parameters)
|
protected |
contains raw data points used in SPLOM
|
protected |
stores mapping from visible plot index to parameter index
|
protected |
matrix of visible scatter plots
| Settings iAQSplom::settings |
|
readwrite |
In animation parameter.
|
readwrite |
Out animation parameter.
1.8.16