guess_templatebrain: Find all template brains or those matching a given image...

View source: R/regtemplate.R

all_templatebrainsR Documentation

Find all template brains or those matching a given image volume

Description

all_templatebrains returns a data.frame detailing all templatebrain objects on the search path (including those inside packages).

Usage

all_templatebrains(cached = TRUE, remove.duplicates = FALSE)

guess_templatebrain(
  x,
  rval = c("templatebrain", "name"),
  cached = TRUE,
  mustWork = FALSE
)

Arguments

cached

When TRUE returns precomputed (memoised) results, otherwise rescans searching for all template brains.

remove.duplicates

Whether to remove duplicate template brains (as determined by md5 hash) from the result list

x

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.

rval

Whether to return the templatebrain object itself or just its name.

mustWork

Whether to insist that exactly one template brain is found

Value

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'.

See Also

templatebrain

Examples

## Not run: 
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
}

## End(Not run)

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