MeVisLab Toolbox Reference
ML Deprecation

ML Deprecation Notes

With MeVisLab 2.1, the ML has been revised and its version number has been set to 2.0.

The most notable change of the new version of the ML is the renaming of numerous classes, methods and macros in a systematic manner.

The old API is deprecated but still available. With MeVisLab 2.1, we provide a macro module that can be used to identify or rename uses of the deprecated ML API. Have a look at the macro module MLReplaceDeprecatedAPI.

The complete list of deprecated classes, methods and macros can be found under Deprecated List in the side menu of the Toolbox Reference.

The deprecated ML API can be enabled/disabled for each project (*.pro file) individually. By default, the deprecated API is enabled.

By adding the following line to your *.pro file, all deprecated API usages will be warned by the compiler:

# This will print deprecation warnings for deprecated API usages:
DEFINES += ML_WARN_DEPRECATED

To completely turn of the deprecated API, use the following line instead:

# This will turn the deprecated API off
DEFINES += ML_DISABLE_DEPRECATED

To allow code to conditionally distinguish between the ML version 2 and the prior version, the ML_VERSION_2 define is set when projects are created for the ML version 2. This allows to use #ifdef ML_VERSION_2 preprocessor directives to be used to distinguish the version and to provide code that works with older versions of the ML.

The following table should give an overview over the changes.

General
ext extent
pos position
img image
calc calculate
props properties
Classes
BaseOp Module
PagedImg PagedImage
SubImg SubImage
SubImgBoxf SubImageBoxd
Macros
ML_TRACE_IN_TC ML_TRACE_IN_TIME_CRITICAL
ML_CHECK_RN ML_CHECK_RETURN_NULL
CALC_OUTSUBIMAGE2_CPP ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_CPP
Methods
getInputNum getNumInputImages
getInField getInputImageField
transformToWorldCoord mapVoxelToWorld
getVoidSubImgPos getImagePointer
getSize getNumVoxels
Cursor Methods
moveCursorFX moveCursorX
moveCursorBX reverseMoveCursorX
moveCursorFXLF moveCursorXWrapAround
setCursorVoxel setCursorValue
Field (Container)
addVec3f addVector3
addMat4 addMatrix4
notifyAttachments touch
deactivate/activateAttachments enableNotification(bool)
LinearAlgebra
vec2 Vector2
mat3 Matrix3
Vector ImageVector

Additional notes on changes of the fields:

  • in all fields, the setting of pointers to member variables to be used instead of the variable encapsulated by the field itself has been deprecated
  • the use of setMinValue / setMaxValue has been deprecated for the fields
  • if compiling with gcc and using ML_WARN_DEPRECATED, the compiler will output deprecation warnings even though the user did not use any of those, because some deprecated inline methods use deprecated code

Additional notes on changes of the LinearAlgebra:

  • the classes Vector2 and Vector3 now permit access to values by using x, y (and z)
  • in WEM, the Vector3 was formerly defined as an SMLVec3f. The WEM library now makes use only of classes defined in the LinearAlgebra and for compatibility reasons, methods like Cross, Set, etc., have been added to the according class in LinearAlgebra