R/grid_metrics.R
grid_metrics.Rd
Calculates a specified metric for each grid tile in the image and plots the metrics for the grid tiles.
grid_metrics(spe_object, FUN, n_split, ...)
SpatialExperiment object in the form of the output of
format_image_to_spe
.
Variable name specifying the metric to be calculated.
Integer specifying the number of splits for the calculation of metrics. This number is the splits on each side (e.g. `n_split` = 3 means the image will be split into 9 tiles.)
Arguments of FUN
A list of the metrics of all grid tiles
grid <- grid_metrics(SPIAT::defined_image, FUN = calculate_entropy, n_split = 5,
cell_types_of_interest=c("Tumour","Immune3"), feature_colname = "Cell.Type")