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.serialiseListObject(object, file = NULL)isDeserialisable(object, expectedClass = "list.object")
deserialiseMriImage(file = NULL, object = NULL)
deserialiseMriImageMetadata(file = NULL, object = NULL)
serialiseListObject
, an object inheriting from class "list.object". For the other functions, a list object in serialised form (see Details).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.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
.save
, load
, list.object
, writeMriImageToFile
.