ext: Get and set extent of image objects

extR Documentation

Get and set extent of image objects

Description

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 signature 'BioFormatsImage'
ext(x)

## S4 method for signature 'ExtImage'
ext(x)

## S4 method for signature 'SpatRasterImage'
ext(x)

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

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

## S4 replacement method for signature '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.

See Also

Other image methods: SFE-image, affineImg(), cropImg(), dim,BioFormatsImage-method, imgRaster(), imgSource(), mirrorImg(), rotateImg(), scaleImg(), translateImg(), transposeImg()


pachterlab/SpatialFeatureExperiment documentation built on Aug. 23, 2024, 11:38 p.m.