fix issue nabu 2023.1 with JP2k writer
I have two issues with the JP2K writer.
issue 1
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/nabu/pipeline/utils.py", line 17, in wrapper
return func(*args, **kwargs)
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/nabu/pipeline/fullfield/chunked.py", line 599, in _init_writer
self.writer = WriterManager(
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/nabu/pipeline/writer.py", line 153, in __init__
raise ValueError("Unsupported file format: %s" % file_format)
ValueError: Unsupported file format: jp2
this one should be fixed by the first commit.
issue 2
jp2kvolume.py", line 145, in save_frame
glymur.Jp2k(file_name, data=frame, psnr=self.psnr, cratios=self.cratios)
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/glymur/jp2k.py", line 249, in __init__
self._write(data)
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/glymur/jp2k.py", line 900, in _write
self._populate_cparams(img_array)
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/glymur/jp2k.py", line 874, in _populate_cparams
self._validate_compression_params(img_array, cparams)
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/glymur/jp2k.py", line 1004, in _validate_compression_params
self._validate_image_datatype(img_array)
File "/scisoft/tomotools/x86_64/cuda11/nabu_dev_tomwer_1.0/lib/python3.8/site-packages/glymur/jp2k.py", line 989, in _validate_image_datatype
raise InvalidJp2kError(msg)
glymur.jp2box.InvalidJp2kError: Only uint8 and uint16 datatypes are currently supported when writing.
I guess there is some cast missing which used to exist before and are no more existing. Or something else