3.2 Crop images

Sometimes we might be interested in only a small part of the tissue or we simply want to remove empty background from our H&E images. In this case, there is an option to crop the images by defining a list of “crop windows” to subset our data by. To make things easier, a helper function GetCropWindows() is provided to extract such crop windows around predefined groups of spots.

crop.windows <- GetCropWindows(object = se, group.by = "slide_id", xy_padding = 70)
se <- CropImages(se, crop.geometry.list = crop.windows)
ImagePlot(se, method = "raster", type = "raw", annotate = FALSE)
Cfopped raw H&E images

Figure 3.2: Cfopped raw H&E images