semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
136 stars 50 forks source link

Export bandset wavelengths to text file for use with Temporal/Spectral Profile Tool? #270

Closed jgrn307 closed 1 year ago

jgrn307 commented 1 year ago

Being able to view spectral signatures dynamically by simply clicking a pixel is a useful tool for understanding multi-/hyperspectral data. AFAIK SCP doesn't have this functionality (you have to go through the multi-step process of making an ROI, rather than just clicking a pixel and seeing the plot in real-time). With this said, there IS a tool designed for this, the Temporal/Spectral Profile Tool (https://github.com/DHI-GRAS/qgis-temporal-profile). The problem with this tool is that it doesn't "play nice" with SCP -- it doesn't read the wavelengths from the bandset, so when it is used, the x-axis on the plots just show the band numbers. I've put in a request with that developer to try to read SCP-prepped file x-axes (wavelengths) directly, but in the meantime I'm asking if you could add some functionality to the bandset window where the center wavelengths can be exported as a file that can be imported into the Temporal/Spectral Profile Tool -- from their documentation:

"The string for setting the x-axis steps must contain only numbers (including "nan") delimited by ";". The number of steps will be truncated to the minimum of the number of steps in the string and the number of bands in the raster. It is possible to skip a raster band during plotting by setting the corresponding step to "nan"."

Their plugin can either take the strings as a file OR as a text string that can be simply copied/pasted into the window. Supporting both would be great!

jgrn307 commented 1 year ago

Quick update, it looks like the basic functionality is already in SCP, but is there a way to generate a SINGLE PIXEL roi for the temporary roi visualization? Basically: is there a way to quickly click a pixel not have the region growing trigger automatically? Related: in the plot window, is there a way to force the y-axis to be a pre-determined range so it doesn't change with new temporary ROIs? e.g. for reflectance data, locking the y- to be 0 to 1.

semiautomaticgit commented 1 year ago

Hello @jgrn307 , thank you for the suggestion, I'll consider it. About the pixel spectral signature you can activate the pointer to create a temporary ROI using the region growing algorithm and then right click on the map https://semiautomaticclassificationmanual.readthedocs.io/en/latest/working_toolbar.html#temporary-roi-1

Unfortunately, the plot can't be fixed to values.