Takes in an image in SingleCellExperiment format, and splits the image into specified sections. Users can choose to plot the cell positions in each sub image.
Usage
image_splitter(
sce_object,
number_of_splits,
plot = FALSE,
cut_labels = TRUE,
colour_vector = NULL,
x_position_min = NULL,
x_position_max = NULL,
y_position_min = NULL,
y_position_max = NULL,
feature_colname = "Cell.Type"
)
Arguments
- sce_object
SingleCellExperiment object in the form of the output of
format_image_to_sce
.- number_of_splits
Numeric. specifying the number of segments (e.g. 2 = 2x2, 3 = 3x3).
- plot
Boolean. Specifies whether the splitted images should be printed in a pdf.
- cut_labels
Boolean. Specifies whether to plot where the image had been segmented.
- colour_vector
String Vector. If specified, the colours will be used for plotting. If NULL, colors will be generated automatically
- x_position_min
Integer used to specify the minimum x boundary to be splitted.
- x_position_max
Integer used to specify the maximum x boundary to be splitted.
- y_position_min
Integer used to specify the minimum y boundary to be splitted.
- y_position_max
Integer used to specify the maximum y boundary to be splitted.
- feature_colname
String specifying which column the colouring should be based on. Specify when plot is TRUE.
Examples
split_image <- image_splitter(SPIAT::simulated_image, number_of_splits=3, plot = FALSE)