Open joaomamede opened 1 year ago
Same later when appending the mosaic:
Traceback (most recent call last):
File "/home/jmamede/anaconda3/envs/tensorflow/bin/ashlar", line 8, in <module>
sys.exit(main())
File "/home/jmamede/anaconda3/envs/tensorflow/lib/python3.9/site-packages/ashlar/scripts/ashlar.py", line 212, in main
return process_single(
File "/home/jmamede/anaconda3/envs/tensorflow/lib/python3.9/site-packages/ashlar/scripts/ashlar.py", line 250, in process_single
mosaics.append(reg.Mosaic(edge_aligner, mshape, **mosaic_args_final))
File "/home/jmamede/anaconda3/envs/tensorflow/lib/python3.9/site-packages/ashlar/reg.py", line 996, in __init__
self.dtype = aligner.metadata.pixel_dtype
File "/home/jmamede/anaconda3/envs/tensorflow/lib/python3.9/site-packages/ashlar/reg.py", line 304, in pixel_dtype
return self._pixel_dtypes[self._metadata.getPixelsType(0).value]
KeyError: 'float'
By modifying line 200-203 to:
class BioformatsMetadata(PlateMetadata):
_pixel_dtypes = {
'uint8': np.dtype(np.uint8),
'uint16': np.dtype(np.uint16),
'float' : np.dtype(np.float32),
}
made it go through.
However, the output is between 0 and 1 and very saturated. I believe it to be the light correction. I also tried pushing the 'float' be assume to be a uint32 or uint16 dtype and the same happens.
In the ome.tiff metadata the pixel type is "float" while numpy conversion is np.float32.
I tried to comment line 405 in reg.py
# dtype = self.metadata.pixel_dtype
todtype = np.float32
and the error goes away. if I try to do something like
It still fails as the error happens at the moment of the self.metadata_pixel_dtype call.