Open LucaMarconato opened 1 year ago
I would probably go for option 1.
Notices that the rasterization function could be used for allowing an easy implementation of aggergation when images and labels are not aligned (e.g. rotated) or not the same resolution. For this one we will probably need to carefully choose the appropriate kwargs
, and maybe even do some kind of normalization (the user will not have to worry about this, we can do it inside our aggregation functions that call the rasterization internally).
When applying a transformation to an image element or a labels element, or when rasterizing an image or labels,
dask_image.ndinterp.affine_transform()
is called (you can search this function to find the two occurrences in the code).At the moment we use the following or equivalent code:
to ensure that no interpolation is performed for labels, the result can be seen for instance here https://github.com/scverse/spatialdata/issues/165.
For images interpolation happens, an example of this is in the screenshot example. We may want to do one of the following:
kwargs
to the user both forrasterize()
and forBaseTransformation.transform()
When this is done we should update the test
test_rasterize_raster()
, which at the moment can't perform a pixel to pixel comparison (also because of this other issue https://github.com/scverse/spatialdata/issues/165).Screenshot example.
This
becomes this (the offset is due to https://github.com/scverse/spatialdata/issues/165)
when doing a rasterization with the parameter
target_unit_to_pixels = 2