SFE-transform: Transpose or mirror SFE object in histological space

SFE-transformR Documentation

Transpose or mirror SFE object in histological space

Description

When images are present, transpose means switching rows and columns of the image (flipping about the axis from top left to bottom right) and geometries are transformed to match. When images are absent, transpose means switching x and y coordinates of the geometries. Mirroring means flipping either x or y coordinates, in histological space. When images are present, the geometries are flipped about the middle of the image. Whem images are absent, the geometries are flipped about the x or y axis. The transformation is applied to the geometries and the images, and can be applied to each sample independently.

Usage

transpose(sfe, sample_id = "all")

mirror(sfe, sample_id = "all", direction = c("vertical", "horizontal"))

Arguments

sfe

An SFE object.

sample_id

Sample(s) to transform.

direction

character. Should (partially) match "vertical" to flip by rows, or "horizontal" to flip by columns

Value

An SFE object with the sample(s) transformed.

Examples

library(SFEData)
sfe <- McKellarMuscleData("small")
sfe2 <- transpose(sfe)
sfe3 <- mirror(sfe)


pachterlab/SpatialFeatureExperiment documentation built on March 11, 2024, 11:11 p.m.