R/regtemplate.R
guess_templatebrain.Rd
all_templatebrains
returns a data.frame detailing all
templatebrain
objects on the search path (including those inside
packages).
all_templatebrains(cached = TRUE, remove.duplicates = FALSE)
guess_templatebrain(
x,
rval = c("templatebrain", "name"),
cached = TRUE,
mustWork = FALSE
)
When TRUE
returns precomputed (memoised) results,
otherwise rescans searching for all template brains.
Whether to remove duplicate template brains (as determined by md5 hash) from the result list
A im3d
image object, array or matrix compatible with
as.templatebrain
OR a 2 or 3-vector defining the dimensions
of an image or image stack.
Whether to return the templatebrain
object itself
or just its name.
Whether to insist that exactly one template brain is found
For all_templatebrains
, a data.frame
containing the
following columns:
object The name of the templatebrain
object
pos An integer specifying the environment
package Character vector naming the environment
md5 md5 hash of the templatebrain
object
name
W,H,D Width, height and depth of image stack (pixels)
guess_templatebrain
returns a templatebrain
object when rval='templatebrain'
or a character vector when
rval='name'
.
if (FALSE) {
all_templatebrains()
guess_templatebrain(im3d(dims=c(30,40,50)))
# or
guess_templatebrain(c(30,40,50))
guess_templatebrain('path/to/my/image.nrrd')
if(require('nat.flybrains')){
guess_templatebrain(im3d(dims=c(1024,512,218)), rval = 'name')
# get the matching template brain
tb=guess_templatebrain(im3d(dims=c(1024,512,218)))
# get its voxel dimensions
voxdims(tb)
tb=guess_templatebrain(c(1024,512))
tb
}
}