mirror_fafb | R Documentation |
Mirror an object in FAFB space using FAFB-JRC2018F registration
mirror_fafb(x, sample = NULL, subset = NULL, via = NULL, ...)
x |
An object containing 3D vertices (e.g. a neuron, surface, points) |
sample |
The starting brain space in which |
subset |
Character, numeric or logical vector specifying on which subset
of |
via |
(optional, for expert use only) Intermediate template brain that
the registration sequence must pass through. See details and |
... |
Additional arguments passed to |
This function works by mapping the input data to JRC2018F, a high quality symmetric female brain template. The data are then flipped (since JRC2018F is symmetric no other action is required) and then returned to the starting space. In order to ensure that the Bogovic et al bridging registrations are preferred the via argument will be filled with the value "FAFB14um" i.e. FAFB14 calibrated in microns. This works because the Bogovic registrations were based on a mock synaptic staining using synapse locations that had been rescaled to microns before calculating a registration with ANTs to JRC2018F.
A mirrored version of the neuron/surface or other 3D object.
# transform arbitrary location (in nm)
mirror_fafb(cbind(388112, 162988, 132840))
# same but in units of microns
mirror_fafb(cbind(388.112, 162.988, 132.84), sample='FAFB14um')
# no messages
mirror_fafb(cbind(388112, 162988, 132840), Verbose=FALSE)
# transform arbitrary location (from and to raw pixel coordinates)
voxel.size=c(4,4,40)
mirror_fafb(cbind(97028, 40747, 3321)* voxel.size)/c(voxel.size)
library(nat.flybrains)
if(require('elmr', quietly = TRUE)) {
FAFB.surf.m <- mirror_fafb(FAFB14.surf)
wire3d(as.mesh3d(FAFB.surf), col='blue')
wire3d(as.mesh3d(FAFB.surf.m), col='red')
}
## Not run:
# you can also use with points in https://flywire.ai space
# converts from raw (voxel) coords used by Neuroglancer to nm and back again
voxel.size=c(4,4,40)
mirror_fafb(cbind(120508, 46292, 1667)*voxel.size, sample='FlyWire')/voxel.size
# compare with just using FAFB14
mirror_fafb(cbind(120508, 46292, 1667)*voxel.size)/voxel.size
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.