scverse / spatialdata-plot

Static plotting for spatialdata
BSD 3-Clause "New" or "Revised" License
26 stars 13 forks source link

Extract image RGB information per Visium HD bin #284

Closed sunyumail93 closed 2 weeks ago

sunyumail93 commented 1 month ago

Hello, I posted a question previously in Seurat (https://github.com/satijalab/seurat/issues/9036) but they don't have bandwidth to implement this feature. Since squidpy has a similar function (https://squidpy.readthedocs.io/en/stable/api/squidpy.im.calculate_image_features.html), would it be possible to perform a similar analysis in spatialdata? Or can we run that squidpy function on the spatialdata object? I would like to extract the image (H&E or fluorescence) features, such as the RGB color information for each Visium HD bin. Thank you!

melonora commented 2 weeks ago

Hi @sunyumail93, sorry for getting back to you a bit late! We are currently having discussions for implementing this among others, but can't really give you a timeline at the moment. @giovp I think you know better than me whether there is a way to hack around to allow this functionality to run right now. Could you provide some insights?

giovp commented 2 weeks ago

Hi @sunyumail93 , a workaround could be to take the image and label elements from spatialdata and create an imagecontainer object. Generate the features from squidpy and then save the results back to spatialdata. Indeed we understand that this is a much needed functionality and that we are having discussions within the team to start supporting this.

sunyumail93 commented 2 weeks ago

Thank you both for your response! I look forward to the implementation of this feature.

timtreis commented 2 weeks ago

@sunyumail93 thank you for the suggestions! I'll keep track of this workstream over at https://github.com/scverse/squidpy/issues/850