Skip to contents

aedes_mirror() mirrors objects supported by nat::xform(), including neurons, neuronlists, dotprops and coordinate matrices.

Usage

aedes_mirror(
  x,
  method = c("tps", "landmarks", "symmetric"),
  units = c("nm", "microns"),
  subset = NULL,
  landmarks = NULL,
  raw = TRUE,
  url = .aedes_mirror_landmarks_url,
  vd = NULL,
  ...
)

Arguments

x

An object to mirror.

method

Mirror method. "tps" uses the bundled aedes_aedesSym_1000_tps.rds registration to map into Aedes symmetric space, flip across the X axis, then map back to original Aedes space. "landmarks" uses paired landmarks in the original Aedes space.

units

Coordinate units for x and the returned object. The symmetric registration is defined in microns; nm inputs are scaled before and after transformation.

subset

Optional subset passed to nat::xform(), for example when transforming selected elements of a neuronlist.

landmarks

Optional landmark data with pointA and pointB entries. When NULL, landmarks are read from url using fafbseg::ngl_annotations().

raw

Whether landmark coordinates are in raw voxel space. When FALSE, landmark coordinates are assumed to be in units.

url

Neuroglancer URL containing paired mirror landmarks.

vd

Optional voxel dimensions in nm. Advanced use; when NULL and raw = TRUE, these are detected automatically.

...

Additional arguments passed to nat::xform().

Value

A transformed object of the same kind as x.

Details

Mirroring requires the suggested Morpho package at runtime.

Examples

if (FALSE) { # \dontrun{
sk <- with_aedes(fafbseg::read_l2skel(aedes_ids("class:DNa")[1]))
sk.mirror <- aedes_mirror(sk, units = "nm")

plot3d(sk, col = "grey")
plot3d(sk.mirror, col = "red", add = TRUE)

dps <- with_aedes(fafbseg::read_l2dp(aedes_ids("class:DNa")))
dps.mirror <- aedes_mirror(dps, units = "microns")
} # }