Skip to contents

Crop a giottoLargeImage based on crop_extent argument or given values

Usage

cropGiottoLargeImage(
  gobject = NULL,
  largeImage_name = NULL,
  giottoLargeImage = NULL,
  crop_name = "image",
  crop_extent = NULL,
  xmax_crop = NULL,
  xmin_crop = NULL,
  ymax_crop = NULL,
  ymin_crop = NULL
)

Arguments

gobject

gobject holding the giottoLargeImage

largeImage_name

name of giottoLargeImage within gobject

giottoLargeImage

alternative input param using giottoLargeImage object instead of through gobject and largeImage_name params

crop_name

arbitrary name for cropped giottoLargeImage

crop_extent

terra extent object used to crop the giottoLargeImage

xmax_crop, xmin_crop, ymax_crop, ymin_crop

crop min/max x and y bounds

Value

a giottoLargeImage object

Examples

g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#> python already initialized in this session
#>  active environment : 'giotto_env'
#>  python version : 3.10
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#>  "/usr/share/miniconda/envs/giotto_env/bin/python"

cropGiottoLargeImage(g, largeImage_name = "image")
#> An object of class giottoLargeImage : "image"
#> Image extent            : 2000.5, 6790.5, -5730.25, -2380.75 (xmin, xmax, ymin, ymax)
#> Original image extent   : 2000.5, 6790.5, -5730.25, -2380.75 (xmin, xmax, ymin, ymax)
#> Scale factor            : 19.7119341563786, 19.4738372093023 (x, y)
#> Resolution              : 0.0507306889352818, 0.051350947902672 (x, y)
#> Layers                  : 4 
#> Estimated max intensity : 255 
#> Estimated min intensity : 29 
#> Values                  : integers
#> File path               : '/home/runner/work/_temp/Library/GiottoData/Mini_datasets/Visium/VisiumObject/Images/image_spatRaster'