Skip to content

Transformations in sdata image objects not properly applied throughout scPortrait workflow #280

@machth

Description

@machth

Transformations not properly applied in segmentation and downstream processes

Problem Description

Transformations in sdata image objects can be applied and loaded into scPortrait. However, these transformations are not being properly carried through to segmentation and downstream processes of scPortrait. Specifically, the segmentation is being generated based on the untransformed sdata image, creating a mismatch between the displayed/transformed image and the segmentation results.

Steps to Reproduce

  1. Apply a transformation to the sdata image (e.g. Affine([[0, -1, 0], [-1, 0, 0], [0, 0, 1]], input_axes=("y", "x"), output_axes=("y", "x"))
  2. Load sdata object with project.load_input_from_sdata()
  3. plot image with project.sdata.pl.render_images("input_image", channel=idx, norm=mpl.colors.Normalize(vmin=0, vmax=np.iinfo(np.uint16).max)).pl.show(ax=axs[idx], colorbar=False, coordinate_systems="global")
    4, Run the segmentation process
  4. Observe that segmentation results do not align with the transformed image with project.sdata.pl.render_images("input_image", channel=1, norm=mpl.colors.Normalize(vmin=0, vmax=np.iinfo(np.uint16).max)).pl.render_labels("seg_all_cytosol").pl.show(coordinate_systems="global", colorbar=False)

Expected Behavior

Segmentation and all downstream processes should respect and properly utilize the transformation applied to the sdata image object.

Potential Impact

This issue causes misalignment between visual representation and computational results.

Current workaround:

modifying image data by writing transformation (modifying raw sdata image values)

I can provide example data or screenshots if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions