Skip to contents

Unlike in SpatialExperiment, images in SFE have extents which are used to align them to the geometries and in geometric operations on SFE objects. These functions get or set the extent for S4 image classes inheriting from VirtualSpatialImage implemented in the SFE package.

Usage

# S4 method for BioFormatsImage
ext(x)

# S4 method for ExtImage
ext(x)

# S4 method for SpatRasterImage
ext(x)

# S4 method for BioFormatsImage,numeric
ext(x) <- value

# S4 method for ExtImage,numeric
ext(x) <- value

# S4 method for SpatRasterImage,numeric
ext(x) <- value

Arguments

x

A *Image object.

value

A numeric vector with names "xmin", "xmax", "ymin", "ymax" specifying the extent to use.

Value

Getters return a numeric vector specifying the extent. Setters return a *Image object of the same class as the input.

Note

For SpatRasterImage, the image may be may not be loaded into memory. You can check if the image is loaded into memory with terra::inMemory(imgRaster(x)), and check the original file path with imgSource. If the image is not loaded into memory, then the original file must be present at the path indicated by imgSource in order for any code using the image to work, which includes this function ext.

For BioFormatsImage, internally only the pre-transform extent is stored. The ext getter will apply the transformation on the fly. The setter sets the pre-transformation extent.