Takes in an image in SpatialExperiment format, splits the image into specified sections and returns a list of SpatialExperiment objects. Users can choose to plot the cell positions in each sub image. Note that this function does not split the assay.
image_splitter(
spe_object,
number_of_splits,
plot = FALSE,
cut_labels = TRUE,
colour_vector = NULL,
minX = NULL,
maxX = NULL,
minY = NULL,
maxY = NULL,
feature_colname = "Phenotype"
)
`SpatialExperiment` object in the form of the output of
format_image_to_spe
.
Numeric. specifying the number of segments (e.g. 2 = 2x2, 3 = 3x3).
Boolean. Specifies whether the splitted images should be printed in a pdf.
Boolean. Specifies whether to plot where the image had been segmented.
String Vector. If specified, the colours will be used for plotting. If NULL, colors will be generated automatically.
Integer used to specify the minimum x boundary to be splitted.
Integer used to specify the maximum x boundary to be splitted.
Integer used to specify the minimum y boundary to be splitted.
Integer used to specify the maximum y boundary to be splitted.
String specifying which column the colouring should be based on. Specify when `plot` is TRUE. Default is "Phenotype".
A list of spe objects is returned. Each data frame represents an image without assay data.
split_image <- image_splitter(SPIAT::simulated_image, number_of_splits=3,
plot = FALSE)