danforthcenter / plantcv

Plant phenotyping with image analysis
Mozilla Public License 2.0
646 stars 263 forks source link

data exploration function: which spectral indices can be calculated from my HSI? #1596

Open HaleySchuhl opened 1 week ago

HaleySchuhl commented 1 week ago

Is your feature request related to a problem? Please describe. The deluxe problem is that PlantCV has so many indices that it supports in the plantcv.spectral_index sub-package. It would be nice to be able to subset the spectral indices that are valid to calculate given a multi/hyperspectral array with metadata about it's wavelengths, and possibly also the width of the wavelengths represented.

Describe the solution you'd like Given a dictionary of wavelengths (Spectral_data.wavelength_dict) and a user defined distance/maximum bandwidth, output a list of indices supported in the current version of PlantCV.

Describe alternatives you've considered Some type of camera configuration file with additional metadata that is not stored in the .hdr or embedded in the image some other way.

Additional context E.g. we have a MicaSense camera collecting geotifs and we are interested in automatically determining which spectral_index could be calculated with something more Pythonic and user-friendly than a try block of all.

The MicaSense Altum-PT's wavelengths are: Blue: 475 nanometers (nm) center, 32 nm bandwidth Green: 560 nm center, 27 nm bandwidth Red: 668 nm center, 14 nm bandwidth Red edge: 717 nm center, 12 nm bandwidth Near-IR: 842 nm center, 57 nm bandwidth Thermal: FLIR LWIR thermal infrared 7.5-13.5um radiometrically calibrated

rayn-alex commented 1 day ago

I have something like this on my list for RVS Analytics v.1.3. I wouldn't mind implementing it directly in plantCV.

Currently, I'm using a curated list of all indices which can be used with the RVS Camera, but I always wanted to make it dynamic based on the input.

nfahlgren commented 1 day ago

That would be great, thanks Alex!