shortest_bridging_seq: Make or query connected graph of bridging registrations

View source: R/transformation.R

bridging_graphR Documentation

Make or query connected graph of bridging registrations

Description

These functions are designed for expert use. In general it is recommended to use xform_brain.

bridging_graph creates an igraph::graph representing all known template brains (vertices) and the bridging registrations connecting them (edges).

shortest_bridging_seq finds the shortest bridging sequence on a graph of all available bridging registrations, subject to constraints defined by graph connectivity and the reciprocal parameter.

Usage

bridging_graph(
  regdirs = getOption("nat.templatebrains.regdirs"),
  reciprocal = NA
)

shortest_bridging_seq(
  sample,
  reference,
  via = NULL,
  checkboth = TRUE,
  imagedata = FALSE,
  reciprocal = NA,
  ...
)

Arguments

regdirs

Character vector of directories to search for registrations (see details)

reciprocal

Sets the weight of reciprocal edges in the graph (and thereby whether inverse registrations will be considered).

sample

Source template brain (e.g. IS2) that data is currently in. Specified either as character vector or a templatebrain object.

reference

Target template brain (e.g. IS2) that data should be transformed into.

via

(optional) intermediate template brain that the registration sequence must pass through.

checkboth

When TRUE will look for registrations in both directions. See details.

imagedata

Whether x should be treated as image data (presently only supported as a file on disk) or 3D object vertices - see details.

...

additional arguments passed on to bridging_graph

Details

When reciprocal != NA we create a graph where each forward transformation is matched by a corresponding inverse transformation with the specified edge weight. The edge weight for forward transforms will always be 1.0.

By default regdirs is set to getOption('nat.templatebrains.regdirs')

See Also

allreg_dataframe, xform_brain

Examples

## Not run: 
plot(bridging_graph(), vertex.size=25, edge.arrow.size=0.5)
# with reciprocal edges
plot(bridging_graph(reciprocal=3), vertex.size=25)

## End(Not run)
## Not run: 
shortest_bridging_seq(FCWB, IS2)
# or
shortest_bridging_seq('FCWB', 'IS2')

shortest_bridging_seq(sample='FCWB', reference='IS2', via="JFRC2")

## End(Not run)

nat.templatebrains documentation built on July 9, 2023, 6:18 p.m.