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
I am working with a Xenium dataset that includes an H&E image as well as an alignmentmatrix.csv file. I understand that this alignment matrix can be used to transform the image data into the global coordinate system.
I have successfully created an sdata object from this dataset.
How can I locate a specific cell within the H&E image? More specifically, now the H&E and the cell location are aligned, but how can I explicitly know the exact cell locations on the H&E image? Thanks for your time!!
The text was updated successfully, but these errors were encountered:
you need to know the transformation between the image and the common coordinate system (global). You can use get_transformation(). For more complex cases you could use get_transformation_between_coordinate_systems(). Not needed here.
you need to know the intrinsic coordinates (=pixel coordinates) of the image region(s) you want to query. Let's call them the "boxes".
you need to transform these coordinates using the transformation found above. You can either use normal numpy operations on the matrix given by your_transformation.to_affine_matrix() or if you want you can also use the spatialdata APIs, in this second case, you need to create a shapes element with the box or list of boxes you have (using ShapesModel.parse()) and then call spatialdata.transform().
After you get the coordinates of an image region (a box), you can use the bounding_box_query() API. This PR (unreleased) vectorize bounding box query spatialdata#699 allows to perform the query of all the regions in one go.
Hi,
I am working with a Xenium dataset that includes an H&E image as well as an alignmentmatrix.csv file. I understand that this alignment matrix can be used to transform the image data into the global coordinate system.
I have successfully created an sdata object from this dataset.
How can I locate a specific cell within the H&E image? More specifically, now the H&E and the cell location are aligned, but how can I explicitly know the exact cell locations on the H&E image? Thanks for your time!!
The text was updated successfully, but these errors were encountered: