Skip to contents

spatial queries

Usage

# S4 method for class 'SpatialData'
query(x, ...)

# S4 method for class 'ImageArray'
query(x, cs, ...)

# S4 method for class 'LabelArray'
query(x, ...)

# S4 method for class 'ShapeFrame'
query(x, ...)

# S4 method for class 'PointFrame'
query(x, ...)

Arguments

x

SpatialData element

Value

...

Examples

x <- file.path("extdata", "blobs.zarr")
x <- system.file(x, package="SpatialData")
x <- readSpatialData(x, tables=FALSE)

image(x, "i") <- query(image(x), xmin=0, xmax=60, ymin=0, ymax=40)
label(x, "l") <- query(label(x), xmin=0, xmax=60, ymin=0, ymax=40)
shape(x, "s") <- query(shape(x), xmin=0, xmax=60, ymin=0, ymax=40)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'query': unable to find an inherited method for function ‘shape’ for signature ‘object = "SpatialData"’
point(x, "p") <- query(point(x), xmin=0, xmax=60, ymin=0, ymax=40)

plotSpatialData() + 
  plotImage(x, "i") +
  plotLabel(x, "l") +
  plotPoint(x, "p") +
  plotShape(x, "s")
#> Scale for y is already present.
#> Adding another scale for y, which will replace the existing scale.
#> Error in (function (cond) .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "i %in% fun(x) is not TRUE",     call = .check_i(x, i, "shapes")), class = c("simpleError", "error", "condition"))): error in evaluating the argument 'x' in selecting a method for function 'data': i %in% fun(x) is not TRUE