Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cosmx reader: CellOverlay is skipped

Đang mở
#313 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
data

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của scverse/spatialdata-io

Tất cả issue của scverse/spatialdata-io

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.