| isDeserialisable | R Documentation |
Rather than using R's save and load functions
directly for reference objects, TractoR uses the
SerialisableObject class and these functions to save
and load objects. The main difference is that this approach 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.
isDeserialisable(object, expectedClass = NULL)
serialiseReferenceObject(object, file = NULL)
deserialiseReferenceObject(file = NULL, object = NULL, raw = FALSE)
registerDeserialiser(className, deserialiser)
object |
For |
expectedClass |
A class name which the object is expected to inherit.
Any class is acceptable if this parameter is |
file |
A file name to deserialise from. |
raw |
If |
className |
A string naming a class to be handled by the specified deserialiser. |
deserialiser |
A function taking as its argument a list of serialised fields, and returning a suitable deserialised object. |
The serialiseReferenceObject function, or the serialise member
function of the SerialisableObject class, can be used to
create and/or save a version of an object which contains a
hierarchical representation of the data embedded in it. These serialised
objects are standard R lists, with an "originalClass" attribute
describing the class of the original object. The
deserialiseReferenceObject function can be used to deserialise them.
Custom deserialisers can be specified using registerDeserialiser,
typically for legacy classes.
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
writeImageFile.
isDeserialisable returns TRUE if the object is
deserialisable and (if specified) inherits from the required class,
otherwise FALSE. If its argument is serialisable then
serialiseReferenceObject returns the serialised version, invisibly;
otherwise it returns the unmodified object, again invisibly.
deserialiseReferenceObject returns a raw or reconstituted object
after deserialisation.
Jon Clayden
Please cite the following reference when using TractoR in your work:
J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v044.i08")}.
SerialisableObject, save,
load, loso, writeImageFile.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.