Masking images #729
qu4drupole
started this conversation in
General
Replies: 1 comment
-
If anyone is curious, here are some options that work: The best (and obvious) answer to use spatialdata.rasterize() on the selected shapes. Convert the raster to binary. To do things extra manually, there's spatialdata.transformations.get_transformation(). For an array of polygon coordinates: shapely.get_coordinates(POLYGON.exterior), add a third column of 1 (for the translation). Then the transformed coordinates should be [tranformation matrix] x np.transpose([coordinates]). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My objective: generate IF images cropped to an area of interest and masked by cell boundaries. Then use images to measure things, like colocalization.
I'm working with MERSCOPE data that looks like this:
Up to this point, I had been using other software to process and analyze the data. I can identify cells in my area of interest, through a merge with "table". From there, I'm not sure what the best option is to generate masked images. I can think of 2 options:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions