download_saalfeldlab_registrations: Download Saalfeld Lab registrations

View source: R/saalfeld_reg.R

download_saalfeldlab_registrationsR Documentation

Download Saalfeld Lab registrations

Description

Download Saalfeld Lab registrations

Usage

download_saalfeldlab_registrations(
  fileformat = c(".h5", ".nii"),
  activate = TRUE,
  download_urls = NULL
)

Arguments

fileformat

whether to download h5 (Saalfeld) or nii (ANTs) format registrations (defaults to h5).

activate

whether to activate any new bridging registrations immediately for use by xform_brain and friends (default TRUE).

download_urls

Named character vector specifying the URLs to download. When missing downloads a default set of registrations.

Details

Registrations will be downloaded from https://www.janelia.org/open-science/jrc-2018-brain-templates. They will be downloaded to a folder defined by the package option nat.templatebrains.regdirs (see examples).

The h5 registration format typically provides a multi-resolution forward and inverse transformations in an efficiently compressed format. See https://github.com/saalfeldlab/template-building/wiki/Hdf5-Deformation-fields for further details.

The nii (NIfTI) files are the raw output format of the ANTs registration package. Their disadvantages are that they are 1) large files and the whole >500 Mb registration file must be loaded completely into memory before any transformations are possible, 2) that they depend on a more complex set of packages that can be hard to install, 3) is not simple to downsample to make smaller files. They do have the advantage of support for transforming image data as well as 3D points.

Value

A character vector naming any new registrations downloaded, invisibly.

See Also

register_saalfeldlab_registrations

Examples

regroot=getOption('nat.templatebrains.regdirs')
dir(regroot)

## Not run: 
# example of specifying an URL for download
download_saalfeldlab_registrations(download_urls=
  c("JRC2018F_FCWB.h5"=paste0("https://ndownloader.figshare.com/files/",
    "14369093?private_link=d5965dad295e46241ae1")))

## End(Not run)

jefferis/nat.jrcbrains documentation built on June 28, 2023, 4:06 a.m.