MLAlgorithmModule
|
Implementing update behavior and status feedback as a field interface for ML modules is not easy for a developer. That's why so many ML modules differ in these points. Those differences in field interface and behavior makes it hard for MeVisLab users and application developers to handle modules.
The ML module base class AlgorithmModule helps to solve this problem and simplifies implementation of an algorithm with defined input and output values.
The class provides:
Developer's ToDos when deriving from AlgorithmModule:
The base class design brings some conventions for the field interface of a deriving module class. Developers have to pay attention to these conventions when implementing a module. Some of them are neccessary to make the C++ class design work and some affect the handling of the module inside MeVisLab that a user can rely on.
Naming convention
Interpretation convention
Value changes convention
Beside the above mentioned conventions of naming and handling of input and output fields the base class already provides a standardized field interface. These fields are completely handled by the base class and do not count to the responsibility of a deriving module class. This is an important part of the concept of the AlgorithmModule. At first it massively reduces implementation efforts and the probability of bugs on the developer's side. At second it creates a standardized field interface and behavior of such modules that a MeVisLab user can rely on.
There is no need to implement the method virtual Module::handleNotification(). Because of the naming convention for input fields (prefix "in") the base class is able to handle input field changes automatically in its own implementation of method handleNotification(). According to set behavior an update or clear operation is initiated.
Interface methods:
MDL code file for include in Window section of module's .script file is provided.