-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
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
- 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"))
- Load sdata object with project.load_input_from_sdata()
- 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 - 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels