Sequential display of bands for fast inspection

Issue #892 resolved
Agustin Lobo created an issue

Besides the false color, I miss a sequential display of individual bands, best if moving a bar in the spectrum of a given pixel, but could also just be a bar at the top of the canvas. This is very convenient for a first inspection of the images.

Comments (31)

  1. Andreas Janz

    Not quite sure what you mean with “a sequential display of individual bands”?

    Like the RGB bars in the Spectral Plot, but for a single grey or pseudo color band?

  2. Agustin Lobo reporter

    You just move the bar and get the given band displayed in grey scale according to a previously defined stretching

  3. Agustin Lobo reporter

    Like the RGB bars in the Spectral Plot, but for a single grey or pseudo color band?

    Yes!

  4. Andreas Janz

    Alright, yes, the single band bar in the plot is still missing. Do you like the RGB version so far?

  5. Agustin Lobo reporter

    Cannot find the newer RGB selection of bands, all I find is the classic, inconvenient qgis menu

  6. Andreas Janz

    The proposed slider in the map view is a good idea, but it is not really fitting the concept of having multiple raster layer in a single map view.

    I would propose to have a new panel, where you can easily change the renderer bands of the current layer, where the current layer is the layer that was selected last in the Data Views panel:

    This new panel could also be aware of wavelength information, so that you can easily jump to red, green, blue, nir, red-edge, swir, etc bands.
    In case of RGB renderer, this panel could let you choose predefined band combinations like TrueColor, ColoredInfrared, etc.

  7. Andreas Janz

    Similar functionality can be found in the new Color Space Explorer dialog:

    The Color Space Explorer is currently limited to RGB renderer and not useful for single band exploration.

    Also, having such functionality available in a panel that is visible in the main GUI would make exploration much quicker.

  8. Agustin Lobo reporter

    But can use it. Tge RGB bands are just perfect. Perhaps what I’m saying would be solved just by having the current “Renderer Bnads” renamed to “Color Renderer Bands” and adding a “Grey Renderer Band” which would have just one single grey vertical bar.

  9. Agustin Lobo reporter

    I get an error in the Spectral Library display:

    An error has occurred while executing Python code:

    TypeError: type NoneType doesn't define __round__ method

    Traceback (most recent call last):
      File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3616, in onRendererBarChanged
        bandNo = min(max(round(bandNo), 1), self.mRendererBandsLayer.currentLayer().bandCount())
    TypeError: type NoneType doesn't define __round__ method
    

    Python version: 3.9.5 (default, Nov 18 2021, 16:00:48) [GCC 10.3.0]
    QGIS version: 3.22.2-Białowieża Białowieża, 1601ec46d0

    Python Path:

    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/apps/ensomap
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/LAStools
    • /usr/share/qgis/python
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins
    • /usr/share/qgis/python/plugins
    • /home/alobo/OTB/OTB-7.3.0-Linux64/lib/python
    • /usr/lib/python39.zip
    • /usr/lib/python3.9
    • /usr/lib/python3.9/lib-dynload
    • /home/alobo/.local/lib/python3.9/site-packages
    • /usr/local/lib/python3.9/dist-packages
    • /usr/lib/python3/dist-packages
    • /usr/lib/python3.9/dist-packages
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python
    • .
    • /home/alobo/.local/lib/python3.9/site-packages/IPython/extensions
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/site-packages
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/coreapps
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_linux
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/timeseriesviewerplugin
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/timeseriesviewerplugin/eotimeseriesviewer
    • /home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/apps

  10. Agustin Lobo reporter

    Using enmap_berlin.bsq

    Open Spectral Library

    Select Layer enmap_berl.bsq

    Immediately:

    2022-01-18T11:11:14     WARNING    warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py:3665: DeprecationWarning:

                 an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.


                 traceback: File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3583, in onRendererLayerChanged
                  mBand.setBand(bandNo)
                  File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3665, in onRendererBandChanged
                  vmin, vmax = layer.dataProvider().cumulativeCut(
                  File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
                  sw(msg.message, msg.category, msg.filename, msg.lineno,

    Move Red bar, display not updated, get:

    2022-01-18T11:12:46     WARNING    warning:/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py:3665: DeprecationWarning:

                 an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.


                 traceback: File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/widgets/GraphicsView.py", line 350, in mouseReleaseEvent
                  super().mouseReleaseEvent(ev)
                  File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/GraphicsScene/GraphicsScene.py", line 233, in mouseReleaseEvent
                  if self.sendDragEvent(ev, final=True):
                  File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/GraphicsScene/GraphicsScene.py", line 353, in sendDragEvent
                  self.dragItem.mouseDragEvent(event)
                  File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/externals/pyqtgraph/graphicsItems/InfiniteLine.py", line 403, in mouseDragEvent
                  self.sigPositionChangeFinished.emit(self)
                  File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3620, in onRendererBarChanged
                  self.mRendererRedBand.setBand(bandNo)
                  File "/home/alobo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibraryplotwidget.py", line 3665, in onRendererBandChanged
                  vmin, vmax = layer.dataProvider().cumulativeCut(
                  File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
                  sw(msg.message, msg.category, msg.filename, msg.lineno,

  11. Andreas Janz

    Why am I having a greyscale display in this case?

    Confirmed, a bug. Renderer is updating now after moving the RGB bars.

  12. Andreas Janz

    I get an error in the Spectral Library display:

    An error has occurred while executing Python code:

    TypeError: type NoneType doesn't define __round__ method

    Can this be reproduced with the testdata as well? What steps?

  13. Agustin Lobo reporter

    It happens erratically with hires_berlin2.tif

    I observe that if the Data Source is closed, it is still listed in SpectralLibrary/Layer (not sure this is related but is is weird)

  14. Agustin Lobo reporter

    Could reproduce it: the TypeError occurs if I drag and drop hires_berlin2.tif on the SpectralLibray window. This is obviously a wrong user action,

    but a more user-friendly error message should come up.

    Surprisingly, this error does not occur if I drag and drop hires_berlin.bsq or enmap_berlin-bsq

  15. Andreas Janz

    Yes, when closing a layer that is still selected in the SpectralView, I also get an error (not the same though). I fixed that, maybe it also fixes your problem.

  16. Andreas Janz

    Could reproduce it: the TypeError occurs if I drag and drop hires_berlin2.tif on the SpectralLibray window. This is obviously a wrong user action,

    Is hires_berlin2.tif a raster you created? If so, please share it for testing.

    but a more user-friendly error message should come up.

    Yes.

  17. Log in to comment