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 |
A mirrored version of the neuron/surface or other 3D object.
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.
#> [,1] [,2] [,3] #> [1,] 667366.9 174034.2 102780.7#> [,1] [,2] [,3] #> [1,] 667.3669 174.0342 102.7807#> [,1] [,2] [,3] #> [1,] 667366.9 174034.2 102780.7# 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)#> [,1] [,2] [,3] #> [1,] 166841.7 43508.56 2569.518library(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') } if (FALSE) { # 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 } # }