gerbilvis / gerbil

Gerbil Hyperspectral Visualization and Analysis Framework
http://gerbilvis.org
GNU General Public License v3.0
43 stars 15 forks source link

Synchronize DistView coloring feature with FalseColorDock/Model #6

Open ypnos opened 9 years ago

ypnos commented 9 years ago

Currently, the distribution view has a coloring feature that can color spectral vectors based on true coloring. It can be enabled via a button in the controls to the left of the plot. It only works for the view of raw spectra as the colors are computed based on the vector itself.

In this enhancement, we would like to achieve that:

For that, the coloring needs to be done based on pixel coordinates and not the spectra itself, which lies in a different feature space in the other views. However, due to the histogramming of spectra, the pixel coordinates are not available at the stage where the color is computed right now (1).

  1. In the viewport context (2) introduce a flag whether the coloring is up-to-date
  2. Whenever the coloring in the falsecolordock is switched (at the point the new coloring is shown), all distviews need to be notified. Then, if a distview is currently showing a coloring, the bin colors need to be recomputed (re-binning). If it is not (coloring mode disabled), it needs to set the flag in context, so that if the user decides to enable the coloring, the re-binning is taking place. If for any other reason re-binning is performed, the flag can also be unset. NOTE: we always compute the color values with the binning "just in case" the user wants to enable coloring mode)
  3. In a rebinning ([7]), the color value needs to be computed based on the falsecolordock display. Ideally, the color data would be made accessible by the falsecolormodel, not the dock. then the color can be passed to the Bin constructor/methods, see next point.
  4. In a Bin, the mean vector of all pixels represented by the bin is stored and dynamically altered when adding/removing pixels from the bin. See 3, 4, 5. Accordingly, the mean color should be stored and dynamically altered. It then needs to be normalized where also the mean is normalized (6).

[7]: https://github.com/gerbilvis/gerbil/blob/6e3b6e370003ef3e3e4dac3ea566e30720e18119/gui/dist_view/distviewbinstbb.cpp#L146