Table of Contents
Chapter Objectives
This chapter contains all the information you need to implement
persistence to non-module classes in the ML. Many modules and classes
provide special functionality to handle objects derived from the class
Base
or TreeNode
so that
they can often handle objects they do not even know explicitly (see Section 8.1, “Base
Objects” and Section 8.3, “Creating Trees from Base
Objects Using TreeNodes”).
This chapter explains how
to derive your own objects from
Base
,
these objects can be stored and retrieved in/from trees (e.g.
as XML or RawNode
trees) with
TreeNode
(see Section 8.3, “Creating Trees from Base
Objects Using TreeNodes”).
they can be written to or read from an AbstractPersistenceStream
(see Section 8.4, “Writing/Reading Base
Objects to/from AbstractPersistenceStream”). This mechanism is intended to replace the TreeNode
persistence completely in the future.
they can be (de)composed with other
Base
objects to larger structures and
they can be stored and retrieved in files by using already existing ML modules dedicated to that.
Base
Field” for information on how
to derive your own class from Base
and how to
transfer Base
objects between modules.When you want to include a new class to the ML that is not an ML
module (e.g., to pass additional image or segmentation information from
one module to another), the Base
persistence mechanism of
the ML should be used. It permits saving and storing objects, passing
objects from one module to another BaseField
or
simply getting and setting their state via strings. This class
represents general ML objects that support import/export via strings
(setPersistentState()
/persistentState()
)
or arbitrary tree structures (using
addStateToTree()
and
readStateFromTree()
) or through a specialized input/output stream (using writeTo()
and readFrom()
). It has to be the base class
for all objects passed from one BaseField
to
another (see Section 2.1.2, “
Field
”).
Note | |
---|---|
This class is the base class for the class
|
It can be represented by using the field concept (class
BaseField
)
It provides an interface to allow for the import/export of a persistent representation of an object's internal state.
© 2024 MeVis Medical Solutions AG