pachterlab / SpatialFeatureExperiment

Extension of SpatialExperiment with sf
https://pachterlab.github.io/SpatialFeatureExperiment
Artistic License 2.0
43 stars 7 forks source link

Add vignette on raster vector interaction #9

Open lambdamoses opened 1 year ago

lambdamoses commented 1 year ago

Should go on Voyager website but I put this issue here as it has more to do with SFE than Voyager. The vignette should include:

  1. Convert raster segmentation masks to sf polygons. Also simplify polygons and deal with common causes on invalid polygons. I think the polygon simplification is kind of like significant figures, since I doubt if cell segmentation methods are so accurate or precise at the pixel level. The significant figure aspect should be further investigated. I can mention this in the vignette to inspire others to investigate.
  2. The raster to vector conversion is pretty easy with terra, but can be streamlined with a new function in the SFE package.
  3. Extract data from raster images with vector geometries. Again, easy with terra, just to show new users that it can be done.