Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Cosmx reader: CellOverlay is skipped

Abierto
#313 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
data

Línea de trabajo

Comienza en cosmx.py alrededor de la línea 208 y compara cómo se descubren y cargan las carpetas CellComposite con el caso de CellOverlay reportado. Verifica el manejo propuesto de los nombres de archivo de overlay, la correspondencia de FOV, el análisis de imágenes y las transformaciones; después, confirma que las imágenes CellOverlay aparecen en el objeto de datos espaciales sin omitir archivos válidos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
103
Forks
65
Merge medio
1 h 8 min
PR fusionados (30 d)
3

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de scverse/spatialdata-io

Todos los issues de scverse/spatialdata-io

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.