Learn R Programming

tractor.base (version 1.1.0)

serialisation: List object serialisation and deserialisation

Description

Rather than using R's save and load functions directly for list objects, TractoR uses these functions to save and load objects of this type. The main difference is that serialiseListObject stores only the data in the object, and not the functions which operate on them. This helps backward compatibility when new member functions are added.

Usage

serialiseListObject(object, file = NULL)

isDeserialisable(object, expectedClass = "list.object") deserialiseMriImage(file = NULL, object = NULL) deserialiseMriImageMetadata(file = NULL, object = NULL)

Arguments

object
For serialiseListObject, an object inheriting from class "list.object". For the other functions, a list object in serialised form (see Details).
file
A file name to serialise to, or deserialise from.
expectedClass
A class name which the object is expected to inherit.

Value

  • If file is NULL, serialiseListObject returns a serialised object ready to be passed to save. Otherwise it saves the object to the specified file and returns nothing. isDeserialisable returns TRUE if the object is deserialisable and inherits from the specified class.

Details

The serialiseListObject function can be used to create and/or save() a version of a list object which contains a hierarchical representation of the data embedded in it. These serialised objects are of class "list", and contain an "originalClass" attribute describing the class of the original list object. The other functions listed above can be used to deserialise them. Note that this should generally NOT be used as the primary mechanism for saving and loading MriImage objects. Saving to standard NIfTI/Analyze format is usually preferable, and can be done using writeMriImageToFile.

See Also

save, load, list.object, writeMriImageToFile.