Spectral indices#

After having pre-processed the image, proceeded with spectral reduction and identified end-members, we can finally quantify spectra using indices via the SpectralIndexWidget:

Main#

In the main tab we select once again our export data folder. Clicking on load project will load both the image and the end-member spectra.

Again, one needs to select the location of the data. Images are loaded in zarr format so they can be browsed through.

Indices#

In this tab, one can define and compute various indices. In the indices section, a series of indices have been preset to use certain combinations of wavelengths. Those can be adjusted either by entering values or by dragging the sliders below the plot. Once adjustments have been made, one can keep those for the the selected index name (Update current index) or a new name can be defined (New index):

Once boundaries for index calculation are set, one can compute the index for the entire image by using Computer index.

IO#

In this tab, one can export a combination of indices as a CSV table. The indices to export are selected at the top and the import/export buttons can then be used to save and load such an index list.

ROI#

In order to create a index plot, one needs to compute an average index within a region of interest. In this tab one can set the width of such a region and then double-click in the viewer to place it.

self._add_analysis_roi(roi_xpos=80)
self.tabs.setCurrentIndex(3)
nbscreenshot(viewer)

Plots#

In this tab one can finally visualize a standard “index plot” showing the full image, the selected roi and the average index within that roi. A series of plot adjustments can be done directly in that tag:

  • L/R or B/T margin fraction: fraction of plot dedicated to left/right or bottom/top margin

  • Plot width fraction: fraction of plot occupied by line plot on the right

  • Font factor: adjust font size

  • Select plot line color and Plot line thickness: adjusting plot line aspect

  • Figure size factor: control figure size (larger figures take longer to update)

  • Scale font size: control size of scalebar font

What is displayed in the plugin is a low resolution example of the image to be exported. The real image is then exported using the Save plot button.

Additionally, one can save/load a parameters file with pre-sets for a given plot to avoid having to reset them manually all the time.

self.tabs.setCurrentIndex(4)
self.spin_figure_size_factor.setValue(10)
self.spin_font_factor.setValue(0.3)
self.spin_bottom_top_margin_fraction.setValue(0.3)
self.spin_plot_image_w_fraction.setValue(0.5)
self.viewer.layers['Myindex'].colormap = 'magma'
self.create_index_plot()
nbscreenshot(viewer)
self._on_click_save_plot_parameters(file_path=export_folder.joinpath('myplotsettings.yml'))