Skip to contents

These methods convert NeuroSlice and NeuroVol objects into raster images that can be displayed with grid::grid.raster or base plot.

Usage

# S4 method for class 'NeuroSlice'
as.raster(
  x,
  cmap = gray(seq(0, 1, length.out = 255)),
  irange = range(x, na.rm = TRUE),
  ...
)

# S4 method for class 'NeuroVol'
as.raster(
  x,
  zlevel = ceiling(dim(x)[3]/2),
  cmap = gray(seq(0, 1, length.out = 255)),
  irange = range(x, na.rm = TRUE),
  ...
)

Arguments

x

object to convert.

cmap

palette name or hex-color vector for the background (default "grays"). See resolve_cmap.

irange

numeric length-2 intensity range for the color scale.

...

additional arguments passed to methods

zlevel

slice index for NeuroVol objects. Defaults to the middle slice.

Value

A raster object