Cosmx reader: CellOverlay is skipped
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Bắt đầu trong cosmx.py quanh dòng 208 và so sánh cách các thư mục CellComposite được phát hiện và tải với trường hợp CellOverlay đã được báo cáo. Xác minh cách xử lý được đề xuất cho tên tệp overlay, việc khớp FOV, việc phân tích ảnh và các phép biến đổi, sau đó xác nhận rằng các ảnh CellOverlay xuất hiện trong đối tượng dữ liệu không gian mà không bỏ qua các tệp hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Dear,
First, thank you for creating this package! It's been incredibly helpful in processing my CosMx data.
I wanted to share a quick observation in case it helps anyone else. When downloading raw CosMx data, there are not only CellComposite folders, but also CellOverlay folder. These overlays are part of the standard CosMx workflow, where cells are segmented and the images are included in the download. However, the current CosMx reader doesn’t load these CellOverlay images into the spatial data object.
To address this, I've added a few lines to cosmx.py to enable the reading of these images. While it’s not the cleanest solution, it works for now. Here’s the code snippet I used:
for fname in os.listdir(path / cell_overlay):
if fname.endswith(file_extensions):
fov = str(int(pat.findall(fname)[0]))
if fov in fovs_counts:
aff = affine_transforms_to_global[fov]
im = imread(path / cell_overlay / fname, **imread_kwargs).squeeze()
flipped_im = da.flip(im, axis=0)
parsed_im = Image2DModel.parse(
flipped_im,
transformations={
fov: Identity(),
"global": aff,
"global_only_image": aff,
},
dims=("y", "x", "c"),
rgb=None,
**image_models_kwargs,
)
images[f"{fov}_overlay"] = parsed_im
else:
logger.warning(f"FOV {fov} not found in counts file. Skipping image {fname}.")
To implement this, simply add the code to line 208 in CosMx.py, and it should work.
I’m happy to help further or discuss any potential improvements to this solution.
Kind regards,
Steven
- Ngôn ngữ chính
- Python
- Star
- 103
- Fork
- 65
- Merge trung bình
- 1 giờ 8 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của scverse/spatialdata-io
-
documentation
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
scverse/spatialdata-io#161 · 13 bình luận ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
scverse/spatialdata-io#422 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
scverse/spatialdata-io#419 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 48/100
scverse/spatialdata-io#409 · 1 reaction ·
-
Visium in matrix market formatĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
scverse/spatialdata-io#408 ·
Tất cả issue của scverse/spatialdata-io
Issue tương tự
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openvinotoolkit/openvino_notebooks#3665 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
benchmark-gap
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày