You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_robust_transform() after cropping gives problems with images and labels #167
I have noticed that if I do a bounding box query on the blobs dataset, and I try to plot the shapes, I get an error related to the images and labels (btw strange, since I was not trying to plot raster data).
This can be reproduced as follows:
importspatialdataassdfromspatialdata.modelsimportTableModelfromspatialdata.datasetsimportblobsimportspatialdata_plotfromnapari_spatialdataimportInteractiveimportnumpyasnpsdata=blobs()
sdata_cropped=sdata.query.bounding_box(axes=('x', 'y'), min_coordinate=[200, 150], max_coordinate=[300, 250], target_coordinate_system='global')
sdata_cropped# del sdata_cropped.images['blobs_image']# del sdata_cropped.images['blobs_multiscale_image']# del sdata_cropped.labels['blobs_labels']# del sdata_cropped.labels['blobs_multiscale_labels']sdata_cropped.pl.render_shapes('blobs_circles').pl.show()
The last line will fail, but if we uncomment the 4 lines with del, which remove raster data from the sdata_cropped object, then plotting will work.
@LucaMarconato I also noticed that there are bugs in this function, the problem is when it gets multi-scale images as input or labels with only [y, x] and not [c, y, x]. Leaving in sdata_cropped.images['blobs_image'] should be fine. I made some adjustments to the function so I hope the problem is gone when multiscale-image handling is finished (#164)
Yeah, I'd prefer not to fix robust_transform as it'll soon disappear. I'm just waiting for the fix of scverse/spatialdata#353 to finalise the scverse/spatialdata#318. Afterwards we plan to also do a release of spatialdata-plot 👍
Activity
Sonja-Stockhaus commentedon Sep 29, 2023
@LucaMarconato I also noticed that there are bugs in this function, the problem is when it gets multi-scale images as input or labels with only [y, x] and not [c, y, x]. Leaving in
sdata_cropped.images['blobs_image']should be fine. I made some adjustments to the function so I hope the problem is gone when multiscale-image handling is finished (#164)timtreis commentedon Oct 2, 2023
Yeah, I'd prefer not to fix
robust_transformas it'll soon disappear. I'm just waiting for the fix of scverse/spatialdata#353 to finalise the scverse/spatialdata#318. Afterwards we plan to also do a release ofspatialdata-plot👍timtreis commentedon Nov 3, 2023
_robust_transformis no longer part of the codebase since #162