save.ANTsR: Save R sessions including ANTsR objects

Description Usage Arguments Author(s) Examples

View source: R/save.ANTsR.R

Description

Use this function to save an object or a full R session for later use. Any object can be saved (list, antsImage, data frame, etc.). The function will save all antsImage objects as nifti files with random filenames (to avoid using (sub)variable names, which can be identical). These files is what load.ANTsR uses later to fill back the original antsImage variables. For variables that contain filenames, you can choose to copy those files in your saved folder so you can completely recreate the environment even if you change computer or the temporary folder is deleted.

Usage

1
2
3
4
5
6
7
8
save.ANTsR(
  filename = file.path(".", ".ANTsRsession"),
  objects = NA,
  env = as.environment(1),
  overwrite = FALSE,
  clonediskfiles = TRUE,
  ...
)

Arguments

filename

Prefix for folder to store data.

objects

Vector of character names of objects to store. Can be antsImages.

env

Environment to save from or load to.

overwrite

logical to select whether overwriting existing data is allowed.

clonediskfiles

logical enables the copying of disk files that are not loaded in workspace but where character variables point. Set to TRUE if moving sessions from one computer to another or if you save antsRegistration() outputs. Set to FALSE if you save temporary sessions to continue later on the same computer.

...

Additional arguments to pass to save.

Author(s)

Dorian Pustina

Examples

1
2
3
4
5
6
7
## Not run:  # causes problems with devtools::run_examples()
# a <- 1
# b <- c( 2, 3, 4)
# save.ANTsR(objects=c('b', 'a'))
# load.ANTsR("./.ANTsRsession")

## End(Not run)

neuroconductor-devel/ANTsR documentation built on April 1, 2021, 1:02 p.m.