Open HaleySchuhl opened 2 months ago
I think it makes more sense in read_data
because then all Spectral_data
objects have the same array data type. Is there anything against that?
I guess the only argument against needless conversion is the floating-point error, but I guess it's negligible for these applications, right?
Here is a sample image from the RVS Camera sample_set.zip
Thank you @rayn-alex this is super helpful. And my apologies for my slower response. I would agree that handling various datatypes as soon as possible makes the most sense, and we can evaluate if the decimal accuracy has an impact practically on results.
How do you currently convert your images into a "plantcv friendly datatype" ?
No worries.
Just like this:
spectral_data = readimage(filename=img_file, mode='envi')
spectral_data.array_data = spectral_data.array_data.astype("float32") # required for further calculations
if spectral_data.d_type == np.uint8: # only convert if data seems to be uint8
spectral_data.array_data = spectral_data.array_data / 255 # convert 0-255 (orig.) to 0-1 range
Start a discussion about anything you would like So far plantcv has added support for a handful of different hyper/multispectral image formats (#972, #956, #781) and @rayn-alex brought up a formatting incompatibility that could make sense to handle automatically.
This sounds like a good argument to cast
Spectral_data
duringread_data
, or even inside_find_closest
/ other ideas ??