Xenium cell segmentation mask export requires coordinate flipping among y-axis
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 28/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python
调研方向
使用 Xenium breast dataset、来自 sd.read_zarr 的 spatialdata 对象、rasterio.transform.from_bounds、rasterize 和 tiff.imwrite 重现报告的导出结果。比较坐标约定并确定 y 轴反转发生的位置;当导出的掩码与表达结果对齐,且不存在无法解释的手动翻转时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
I have a script that pulls the cell segmentation mask from a spatialdata io object from Xenium and exports it as a tiff for our visualization software. The data are taken from this publicly available breast dataset:
sdata = sd.read_zarr(zarr_path)
cells = sdata.shapes['cell_boundaries']
x_min, y_min = np.min((adata.obsm['spatial']), axis=0)
x_max, y_max = np.max((adata.obsm['spatial']), axis=0)
transform = rasterio.transform.from_bounds(x_min, y_min, x_max,
y_max, int(x_max - x_min), int(y_max - y_min))
shapes = [(geom, idx) for idx, geom in enumerate(cells.geometry)]
mask = rasterize(shapes=shapes, out_shape=(int(y_max - y_min), int(x_max - x_min)),
transform=transform, dtype='int32')
tiff.imwrite(f"mask.tiff", mask)
However, upon exporting the mask to tiff format, the coordinates in the y-axis are flipped:
If I flip the mask array among the y-axis prior to export, the mask now aligns with the expression results:
tiff.imwrite(f"mask.tiff", np.flip(mask, axis=0))
- 主要语言
- Python
- 星标
- 107
- 派生
- 65
- 平均合并
- 10 天 10 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
scverse/spatialdata-io 的其他 Issue
-
documentation
难度 2/5 半天 新手友好度 65/100
scverse/spatialdata-io#161 · 13 条评论 ·
-
bug
难度 3/5 1-2 天 新手友好度 58/100
scverse/spatialdata-io#422 ·
-
难度 4/5 3-5 天 新手友好度 45/100
scverse/spatialdata-io#419 · 1 条评论 ·
-
MCMICRO reader does not support new nf-core/mcmicro output formats可能已有人在做 @adamjtaylor 于 97 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 48/100
scverse/spatialdata-io#409 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 52/100
scverse/spatialdata-io#408 ·
查看 scverse/spatialdata-io 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
letsencrypt/cp-cps#361 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declares可能已有人在做 @maykonmichel 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
linuxmint/mintupdate#1107 ·