An easy way to use the ML is just to link the C-API (Section 7.3, “mlAPI.h”) of the ML. Functions are available to create and delete modules, to set and get their parameters (fields), to connect them and to request images from their outputs.
Example:
Requesting image data from a module causes the following (as shown in Fig. 2.4):
The Host starts to determine the
image areas needed by Viewer and breaks the
area down into pages.
For each page, the Host determines
the input data the Filter needs for output
calculation.
The Loader requests the data (as a
set of pages) and composes the correct input data for the
Filter.
The Filter is called to calculate the
output page.
When Filter has calculated the
correct output pages, they are composed to the correct image data
to be used by the Viewer.
All pages of all modules are stored in the cache of the
MLMemoryManager if there is enough
space.
The C-API (C-Application Programming Interface) is an interface to most C++ functionality of the ML which can be linked in standard C mode. Thus programs and applications not written in C or C++ can link and use the ML if they support standard C linkage. Also, the C-API is more stable, because it is less frequently modified than the C++ interface.
The ML supports a set of standard data types for image voxels (8,16,32,64 bit integer types and float, double, long double) (see Section 7.5, “mlTypeDefs.h”) as well as some so-called Carrier Types (see Chapter 8, Registered Voxel Data Types and Section 8.5.6, “Implementing a New Voxel Data Type by Deriving from MLTypeInfos”) which permit the usage of self-defined or augmented data types. It is not necessary to recompile the ML or modules for these data types. A structure describing the data type, its properties, and operations can be registered in the ML to activate a new type. When used by any module, the operations of the data type are directly called by a carrier type using function pointers. This way, vectors, complex numbers, matrices, tagged voxels, or high precision voxels can be added and used.
© 2011 MeVis Medical Solutions AG