Extracts a data.frame in which each row corresponds to a pixel in the current image with x- and y-coordinates.

getPixelDf(object, ...)

# S4 method for class 'SPATA2'
getPixelDf(
  object,
  img_name = activeImage(object),
  colors = FALSE,
  hex_code = FALSE,
  content = FALSE,
  transform = TRUE,
  xrange = NULL,
  yrange = NULL,
  scale_fct = 1
)

# S4 method for class 'SpatialData'
getPixelDf(
  object,
  img_name = activeImage(object),
  colors = FALSE,
  hex_code = FALSE,
  content = FALSE,
  xrange = NULL,
  yrange = NULL,
  transform = TRUE,
  scale_fct = 1,
  ...
)

# S4 method for class 'HistoImage'
getPixelDf(
  object,
  colors = FALSE,
  hex_code = FALSE,
  content = FALSE,
  xrange = NULL,
  yrange = NULL,
  transform = TRUE,
  scale_fct = 1,
  ...
)

# S4 method for class 'Image'
getPixelDf(
  object,
  colors = FALSE,
  hex_code = FALSE,
  use_greyscale = FALSE,
  frgmt_threshold = c(5e-04, 0.01),
  eps = 1,
  minPts = 3,
  ...
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

...

Used to absorb deprecated arguments or functions.

img_name

Character value. The name of the image of interest. If NULL, the active image is chosen by default. Either way, must be one of getImageNames().

colors

Logical value. If TRUE, adds all colors from the image as variables named col1-col.n where n is the number of colors.

transform

Logical value. Ignored if no images exist in the object. If TRUE, spatial transformation instructions saved during image alignment of the image img_name are applied. Only relevant if there are any images registered in the SPATA2 object.

xrange, yrange

Distance vector of length two or NULL. If not NULL, specifies the x- and y-range to which the spatial output is cropped. E.g. xrange = c(200, 500) results in the two dimensional space being cropped from x-coordinate 200px up to x-coordinate 500px. If NULL, the original range is used.

eps

Distance measure. Given to eps of dbscan::dbscan(). Determines the size (radius) of the epsilon neighborhood.

minPts

Numeric value. Given to dbscan::dbscan(). Determines the number of minimum points required in the eps neighborhood for core points (including the point itself)

tissue

Logical value. If TRUE, adds a variable called pxl_group that indicates whether the pixel is placed on a contiguous tissue section, on artefact tissue fragments or on background.

Value

Data.frame.