R client for the TemplateFlow archive of neuroimaging templates.
# Install from GitHub:
remotes::install_github("bbuchsbaum/templateflow")library(templateflow)
# List available templates
tf_templates()
# List files for a specific template
tf_ls(template = "MNI152Lin", resolution = 1, suffix = "T1w")
# Download and return path
path <- tf_get(template = "MNI152Lin", resolution = 1, suffix = "T1w")
# Read directly as NIfTI object (requires RNifti or oro.nifti)
img <- tf_get(template = "MNI152Lin", resolution = 1, suffix = "T1w", read = TRUE)
# Return results as a data frame
df <- tf_ls(template = "MNI152Lin", as_df = TRUE)
# Template metadata and citations
tf_get_metadata(template = "MNI152Lin")
tf_get_citations(template = "MNI152NLin2009cAsym", bibtex = TRUE)| Variable | Default | Description |
|---|---|---|
TEMPLATEFLOW_HOME |
Platform cache dir | Override cache location |
TEMPLATEFLOW_AUTOUPDATE |
on |
Auto-update skeleton stubs |
TEMPLATEFLOW_USE_DATALAD |
off |
Use DataLad backend |
A command-line interface is available via Rscript:
Rscript -e 'templateflow::tf_cli()' ls MNI152Lin --suffix T1w
Rscript -e 'templateflow::tf_cli()' config
Rscript -e 'templateflow::tf_cli()' get MNI152Lin --res 1 --suffix T1wApache License 2.0
This package uses the albersdown theme. Existing vignette theme hooks are replaced so albers.css and local albers.js render consistently on CRAN and GitHub Pages. The palette family is provided via params$family (default 'teal'). The pkgdown site uses template: { package: albersdown }.