ML Reference
mlAPI.h File Reference
#include <ThirdPartyWarningsDisable.h>
#include <windows.h>
#include <ThirdPartyWarningsRestore.h>
#include "mlInitSystemML.h"
#include "mlUtilsAPI.h"
#include "mlVersion.h"

Go to the source code of this file.

Functions

ML and ML Host: Initialization, Destruction, and callbacks.
MLEXPORT MLint32 MLInit (MLint32 majorVersion, MLint32 majorCAPIVersion, MLint32 revCAPI)
MLEXPORT MLint32 MLDestroy ()
MLEXPORT void MLHostSetProgressCB (void *userData, MLHostProgressCB *callback)
 Sets a callback to provide feedback of the host calculation progress.
MLEXPORT void MLHostUpdateProgress (const char *info1, const char *info2)
MLEXPORT void MLHostSetBreakCheckCB (void *userData, MLHostBreakCheckCB *callback)
 Sets a callback to provide break checking of current calculation.
Library loading, unloading, runtime state changes.
MLEXPORT MLErrorCode MLLoadLibraryWOErrorExt (const char *name, MLLibraryHandle *libHandle)
MLEXPORT MLErrorCode MLLoadLibraryWOError (const char *name)
 Same as MLLoadLibraryWOErrorExt with libHandle=NULL.
MLEXPORT MLint32 MLLoadLibrary (const char *name)
MLEXPORT MLuint32 MLIsCurrentlyUnloadingLibrary ()
MLEXPORT MLuint32 MLSetIsCurrentlyUnloadingLibrary (MLuint32 enable)
MLEXPORT MLErrorCode MLUnLoadLibrary (const char *name, MLLibraryHandle libHandle, char **errStr)
Management of ML modules
MLEXPORT mlModuleMLCreateModuleFromName (const char *className)
MLEXPORT void MLDeleteModule (mlModule *module)
MLEXPORT MLint32 MLBaseIsDerivedFrom (mlBase *base, const char *superClassName)
MLEXPORT const char * MLBaseGetType (mlBase *base)
MLEXPORT mlTypeMLBaseGetTypeObject (mlBase *base)
MLEXPORT const char * MLBaseGetParentType (mlBase *base)
MLEXPORT mlModuleMLCreateModuleFromType (mlType *type)
MLEXPORT mlTypeMLTypeFromName (const char *name)
 Returns the type object for given name. 0 will be returned if the type described by name is unknown.
MLEXPORT MLint32 MLTypeIsAbstract (mlType *type)
MLEXPORT const char * MLTypeGetName (mlType *type)
MLEXPORT const char * MLTypeGetDllName (mlType *type)
MLEXPORT const char * MLTypeGetParentName (mlType *type)
MLEXPORT mlTypeMLTypeGetParentType (mlType *type)
MLEXPORT MLint32 MLTypeIsDerivedFrom (mlType *type, const char *parent)
Access to field interface of module
MLEXPORT mlFieldMLModuleGetField (mlModule *module, const char *name)
MLEXPORT size_t MLModuleGetNumFields (mlModule *module)
MLEXPORT mlFieldMLModuleGetIndexedField (mlModule *module, MLint32 n)
MLEXPORT void MLModuleSetFieldValue (mlModule *module, char *fieldName, char *value)
Activate/deactivate loading/saving state for modules.
MLEXPORT void MLBeginLoadFields (mlModule *module)
MLEXPORT void MLEndLoadFields (mlModule *module)
MLEXPORT void MLBeginSaveFields (mlModule *module)
MLEXPORT void MLEndSaveFields (mlModule *module)
Access to field values and properties.
MLEXPORT const char * MLFieldGetName (mlField *field)
 Returns the name of field field.
MLEXPORT const char * MLFieldGetType (mlField *field)
 Returns the runtime data type of field field as string.
MLEXPORT void MLFieldSetValue (mlField *field, const char *value)
 Sets the value of field field to value.
MLEXPORT size_t MLFieldGetValueSize (mlField *field)
 Returns the string length of field value coded as string of field field.
MLEXPORT size_t MLFieldGetValue (mlField *field, char *value, size_t bufferSize)
MLEXPORT void MLFieldSetFloatValue (mlField *field, MLfloat value)
MLEXPORT MLfloat MLFieldGetFloatValue (mlField *field)
MLEXPORT void MLFieldSetDoubleValue (mlField *field, MLdouble value)
MLEXPORT MLdouble MLFieldGetDoubleValue (mlField *field)
MLEXPORT void MLFieldSetIntValue (mlField *field, MLint32 value)
MLEXPORT void MLFieldSetIntValue64 (mlField *field, MLint64 value)
MLEXPORT MLint32 MLFieldGetIntValue (mlField *field)
MLEXPORT MLint64 MLFieldGetIntValue64 (mlField *field)
Access to enum fields
MLEXPORT int MLFieldGetEnumValue (mlField *field)
MLEXPORT void MLFieldSetEnumValue (mlField *field, int val)
MLEXPORT size_t MLFieldGetNumEnums (mlField *field)
MLEXPORT const char * MLFieldGetEnumName (mlField *field, MLint32 i, int *value)
Connecting of input and output fields
MLEXPORT MLint32 MLFieldConnectFrom (mlField *inField, mlField *outField)
MLEXPORT MLint32 MLImageFieldConnectFromNoNotify (mlField *inField, mlField *outField)
MLEXPORT void MLFieldDisconnect (mlField *inField)
MLEXPORT void MLFieldTouch (mlField *field)
Requesting and freeing of image data via output connector fields
MLEXPORT MLErrorCode MLImageGetTile6D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint t, MLint u, MLint nx, MLint ny, MLint nz, MLint nc, MLint nt, MLint nu, MLDataType datatype)
MLEXPORT MLErrorCode MLImageGetTile4D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint nx, MLint ny, MLint nz, MLint nc, MLDataType datatype)
 Like MLImageGetTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1).
MLEXPORT MLErrorCode MLImageGetTile3D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype)
 Like MLImageGetTile6D(), only for three dimensional regions (i.e., c=t=u=0 and nc=nt=nu=1).
MLEXPORT MLErrorCode MLImageGetTile (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype)
 Exactly like MLImageGetTile3D().
MLEXPORT MLErrorCode MLImageGetScaledTile6D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint t, MLint u, MLint nx, MLint ny, MLint nz, MLint nc, MLint nt, MLint nu, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax)
MLEXPORT MLErrorCode MLImageGetScaledTile4D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint nx, MLint ny, MLint nz, MLint nc, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax)
 Like MLImageGetScaledTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1).
MLEXPORT MLErrorCode MLImageGetScaledTile3D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax)
 Like MLImageGetScaledTile6D(), only for three dimensional regions (i.e., t=u=0 and nt=nt=1).
MLEXPORT MLErrorCode MLImageGetScaledTile (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax)
 Exactly like MLImageGetScaledTile3D().
MLEXPORT void MLImageFreeTile (void *data)
Cache management.
MLEXPORT MLuint64 MLCacheGetCurrentSizeKB ()
 Returns the number of kilobytes currently allocated within the ML cache.
MLEXPORT MLuint64 MLCacheGetMaxSizeKB ()
MLEXPORT void MLCacheSetMaxSizeKB (MLuint64 size)
MLEXPORT MLErrorCode MLClearPagesAndMemoryImg (mlField *outField)
MLEXPORT MLErrorCode MLClearPages (mlField *outField)
MLEXPORT MLErrorCode MLClearMemoryImg (mlField *outField)
MLEXPORT MLErrorCode MLGetPageMemorySize (mlField *outField, size_t *numBytes)
MLEXPORT MLErrorCode MLGetMemoryImgSize (mlField *outField, size_t *numBytes)
MLEXPORT void MLClearCache ()
 Removes all cached pages from all module outputs.
Access to image properties via output connector fields
MLEXPORT MLErrorCode MLGetImageState (mlField *outField)
MLEXPORT const char * MLGetImageStateString (mlField *outField)
MLEXPORT MLErrorCode MLImageGetSize6D (mlField *outField, int *x, int *y, int *z, int *c, int *t, int *u)
MLEXPORT MLErrorCode MLImageGetPageSize6D (mlField *outField, int *x, int *y, int *z, int *c, int *t, int *u)
MLEXPORT MLErrorCode MLImageGetSize (mlField *outField, int *x, int *y, int *z, int *c)
 Like MLImageGetSize6D, only for 4D. The last two extents are ignored.
MLEXPORT MLErrorCode MLImageGetType (mlField *outField, MLDataType *dtype, size_t *dsize)
MLEXPORT MLErrorCode MLImageGetVoxelSize (mlField *outField, MLfloat *x, MLfloat *y, MLfloat *z)
MLEXPORT MLErrorCode MLImageGetVoxelSizeInDoubles (mlField *outField, MLdouble *x, MLdouble *y, MLdouble *z)
MLEXPORT MLErrorCode MLImageGetFirstImagePropertyExtensionByType (mlField *outField, const char *imagePropertyTypeClassName, void **imagePropertyExtension)
MLEXPORT MLErrorCode MLImageGetMinValue (mlField *outField, MLdouble *minValue)
 Returns the minimum voxel value minValue of the image represented by output field outField.
MLEXPORT MLErrorCode MLImageGetMaxValue (mlField *outField, MLdouble *maxValue)
 Returns the maximum voxel value maxValue of the image represented by output field outField.
MLEXPORT MLErrorCode MLImageGetVoxelToWorldMatrix (mlField *outField, MLfloat[16])
 Returns the VoxelToWorldMatrix of the image represented by output field outField.
MLEXPORT MLErrorCode MLImageGetVoxelToWorldMatrixInDoubles (mlField *outField, MLdouble[16])
 Returns the VoxelToWorldMatrix of the image represented by output field outField.
MLEXPORT MLErrorCode MLImageGetWorldToVoxelMatrix (mlField *outField, MLfloat[16])
 Returns the WorldToVoxelMatrix of the image represented by output field outField.
MLEXPORT MLErrorCode MLImageGetWorldToVoxelMatrixInDoubles (mlField *outField, MLdouble[16])
 Returns the WorldToVoxelMatrix of the image represented by output field outField.
MLEXPORT MLErrorCode MLImageMapVoxelToWorld (mlField *outField, MLfloat srcX, MLfloat srcY, MLfloat srcZ, MLfloat *dstX, MLfloat *dstY, MLfloat *dstZ)
MLEXPORT MLErrorCode MLImageMapVoxelToWorldInDoubles (mlField *outField, MLdouble srcX, MLdouble srcY, MLdouble srcZ, MLdouble *dstX, MLdouble *dstY, MLdouble *dstZ)
MLEXPORT MLErrorCode MLImageMapWorldToVoxel (mlField *outField, MLfloat srcX, MLfloat srcY, MLfloat srcZ, MLfloat *dstX, MLfloat *dstY, MLfloat *dstZ)
MLEXPORT MLErrorCode MLImageMapWorldToVoxelInDoubles (mlField *outField, MLdouble srcX, MLdouble srcY, MLdouble srcZ, MLdouble *dstX, MLdouble *dstY, MLdouble *dstZ)
Base field management
MLEXPORT const char * MLBaseFieldGetPersistentState (mlField *baseField)
MLEXPORT void MLBaseFieldSetPersistentState (mlField *baseField, const char *state)
MLEXPORT void MLBaseFieldClearPersistentState (mlField *baseField, char *state)
MLEXPORT void * MLBaseFieldGetPtr (mlField *field)
MLEXPORT void MLBaseFieldSetPtr (mlField *baseField, const void *value)
SoNode and Pointer field management
MLEXPORT void * MLSoNodeFieldGetPtr (mlField *field)
MLEXPORT void MLSoNodeFieldSetPtr (mlField *field, const void *value)
MLEXPORT void * MLPointerFieldGetPtr (mlField *field)
MLEXPORT void MLPointerFieldSetPtr (mlField *field, const void *value)
Field sensor management.
MLEXPORT mlSensorMLCreateFieldSensor (void *userData, MLSensorCB *callback)
MLEXPORT void MLDeleteFieldSensor (mlSensor *sensor)
MLEXPORT mlFieldMLFieldSensorGetField (mlSensor *sensor)
MLEXPORT void MLFieldSensorAttach (mlSensor *sensor, mlField *field)
MLEXPORT void MLFieldSensorDetach (mlSensor *sensor)
Sending of messages to std::cout or std::cerr.
MLEXPORT MLint32 MLAreMessagesSentToCout ()
MLEXPORT void MLSendMessagesToCout (MLint32 on)
MLEXPORT MLint32 MLAreMessagesSentToCerr ()
MLEXPORT void MLSendMessagesToCerr (MLint32 on)
Set/Get the number of threads the ML may use.
MLEXPORT MLErrorCode MLSetMaxNumThreads (MLuint32 numThreads)
MLEXPORT MLuint32 MLGetMaxNumThreads ()

Macro definitions for void pointers to make the API readable.

Disable all C++-specific features in mlInitSystemML for this C-API.

Defines a C-Application Programming Interface (API) to the ML, see also mlUtilsAPI.h. It provides control to most parts of the ML and offers much higher binary compatibility than the C++ binary interface. It also can be used to link the ML to other programming languages. All functions of this interface are highly (however not completely) protected with exception handlers and tested to guarantee high security when using this functions. All detected errors will be handled by the ErrorOutput class if not explicitly returned by returned error codes. Include ML library initialization code and system dependencies. Undefine macro to avoid macro space pollution. Include all non ML includes that shall be available generally. Include ML version information.

#define mlField   void
 A macro name for a void pointer to a field in the ML to make the pointer more readable.
#define mlSensor   void
 A macro name for a void pointer to a sensor in the ML to make the pointer more readable.
#define mlModule   void
 A macro name for a void pointer to an ml::Module in the ML to make the pointer more readable.
#define mlBase   void
 A macro name for a void pointer to a base object in the ML to make the pointer more readable.
#define mlType   void
 A macro name for a void pointer to a runtime type in the ML to make the pointer more readable.
typedef HMODULE MLLibraryHandle

Macro Definition Documentation

◆ mlBase

#define mlBase   void

A macro name for a void pointer to a base object in the ML to make the pointer more readable.

Definition at line 63 of file mlAPI.h.

Referenced by MLBaseGetParentType(), MLBaseGetType(), MLBaseGetTypeObject(), and MLBaseIsDerivedFrom().

◆ mlField

#define mlField   void

A macro name for a void pointer to a field in the ML to make the pointer more readable.

Definition at line 54 of file mlAPI.h.

Referenced by MLBaseFieldClearPersistentState(), MLBaseFieldGetPersistentState(), MLBaseFieldGetPtr(), MLBaseFieldSetPersistentState(), MLBaseFieldSetPtr(), MLClearMemoryImg(), MLClearPages(), MLClearPagesAndMemoryImg(), MLFieldConnectFrom(), MLFieldDisconnect(), MLFieldGetDoubleValue(), MLFieldGetEnumName(), MLFieldGetEnumValue(), MLFieldGetFloatValue(), MLFieldGetIntValue(), MLFieldGetIntValue64(), MLFieldGetName(), MLFieldGetNumEnums(), MLFieldGetType(), MLFieldGetValue(), MLFieldGetValueSize(), MLFieldSensorAttach(), MLFieldSensorGetField(), MLFieldSetDoubleValue(), MLFieldSetEnumValue(), MLFieldSetFloatValue(), MLFieldSetIntValue(), MLFieldSetIntValue64(), MLFieldSetValue(), MLFieldTouch(), MLGetImageState(), MLGetImageStateString(), MLGetMemoryImgSize(), MLGetPageMemorySize(), MLImageFieldConnectFromNoNotify(), MLImageGetFirstImagePropertyExtensionByType(), MLImageGetMaxValue(), MLImageGetMinValue(), MLImageGetPageSize6D(), MLImageGetScaledTile(), MLImageGetScaledTile3D(), MLImageGetScaledTile4D(), MLImageGetScaledTile6D(), MLImageGetSize(), MLImageGetSize6D(), MLImageGetTile(), MLImageGetTile3D(), MLImageGetTile4D(), MLImageGetTile6D(), MLImageGetType(), MLImageGetVoxelSize(), MLImageGetVoxelSizeInDoubles(), MLImageGetVoxelToWorldMatrix(), MLImageGetVoxelToWorldMatrixInDoubles(), MLImageGetWorldToVoxelMatrix(), MLImageGetWorldToVoxelMatrixInDoubles(), MLImageMapVoxelToWorld(), MLImageMapVoxelToWorldInDoubles(), MLImageMapWorldToVoxel(), MLImageMapWorldToVoxelInDoubles(), MLModuleGetField(), MLModuleGetIndexedField(), MLPointerFieldGetPtr(), MLPointerFieldSetPtr(), MLSoNodeFieldGetPtr(), and MLSoNodeFieldSetPtr().

◆ mlModule

#define mlModule   void

◆ mlSensor

#define mlSensor   void

A macro name for a void pointer to a sensor in the ML to make the pointer more readable.

Definition at line 57 of file mlAPI.h.

Referenced by MLCreateFieldSensor(), MLDeleteFieldSensor(), MLFieldSensorAttach(), MLFieldSensorDetach(), and MLFieldSensorGetField().

◆ mlType

#define mlType   void

A macro name for a void pointer to a runtime type in the ML to make the pointer more readable.

Definition at line 66 of file mlAPI.h.

Referenced by MLBaseGetTypeObject(), MLCreateModuleFromType(), MLTypeFromName(), MLTypeGetDllName(), MLTypeGetName(), MLTypeGetParentName(), MLTypeGetParentType(), MLTypeIsAbstract(), and MLTypeIsDerivedFrom().

Typedef Documentation

◆ MLLibraryHandle

typedef HMODULE MLLibraryHandle

Defines the platform-specific handle for a dynamically linked library. It requires a Windows include and, therefore, cannot be placed in mlTypeDefs.h.

Definition at line 71 of file mlAPI.h.

Function Documentation

◆ MLAreMessagesSentToCerr()

MLEXPORT MLint32 MLAreMessagesSentToCerr ( )

Returns 1 (=true) if the ML messages are sent to std::cerr, otherwise 0 (=false). Default is 0.

References MLEXPORT.

◆ MLAreMessagesSentToCout()

MLEXPORT MLint32 MLAreMessagesSentToCout ( )

Returns 1 (=true) if the ML messages are sent to std::cout, otherwise 0 (=false). Default is 1.

References MLEXPORT.

◆ MLBaseFieldClearPersistentState()

MLEXPORT void MLBaseFieldClearPersistentState ( mlField * baseField,
char * state )

Frees the memory allocated for the character string state that was allocated by the function call MLBaseFieldGetPersistentState(baseField). If state is NULL, it simply will be ignored.

References MLEXPORT, and mlField.

◆ MLBaseFieldGetPersistentState()

MLEXPORT const char * MLBaseFieldGetPersistentState ( mlField * baseField)

Returns a character string that contains the object state of the base object represented by the base field baseField. The string memory is allocated in the function and must be released with MLBaseFieldClearPersistentState().

References MLEXPORT, and mlField.

◆ MLBaseFieldGetPtr()

MLEXPORT void * MLBaseFieldGetPtr ( mlField * field)

Returns the value of the base field field. If field is not of expected type, then an error is printed and 0 (NULL) is returned.

References MLEXPORT, and mlField.

◆ MLBaseFieldSetPersistentState()

MLEXPORT void MLBaseFieldSetPersistentState ( mlField * baseField,
const char * state )

Restores the state of the base object represented by the base field baseField using a state generated by the call of getPersistentState(baseField).

References MLEXPORT, and mlField.

◆ MLBaseFieldSetPtr()

MLEXPORT void MLBaseFieldSetPtr ( mlField * baseField,
const void * value )

Sets the pointer value of the base field baseField to value. If field is not of expected type, then an error is printed and nothing is done.

References MLEXPORT, and mlField.

◆ MLBaseGetParentType()

MLEXPORT const char * MLBaseGetParentType ( mlBase * base)

Returns the object type of parent class as string. base must be a valid pointer to a Base object. Otherwise, it will be handled as ML_BAD_PARAMETER error and 0 will be returned.

References mlBase, and MLEXPORT.

◆ MLBaseGetType()

MLEXPORT const char * MLBaseGetType ( mlBase * base)

Returns the object type as string. base must be a valid pointer to a Base object. Otherwise, it will be handled as ML_BAD_PARAMETER error and 0 will be returned.

References mlBase, and MLEXPORT.

◆ MLBaseGetTypeObject()

MLEXPORT mlType * MLBaseGetTypeObject ( mlBase * base)

Returns the object type as type object. base must be a valid pointer to a Base object. Otherwise, it will be handled as ML_BAD_PARAMETER error and 0 will be returned.

References mlBase, MLEXPORT, and mlType.

◆ MLBaseIsDerivedFrom()

MLEXPORT MLint32 MLBaseIsDerivedFrom ( mlBase * base,
const char * superClassName )

Returns 1 (=true) if base is derived from class with name superClassName and 0 (=false) if not. base must be a valid pointer to a Base object and superClassName a non-NULL pointer to a NULL-terminated non-empty string. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.

References mlBase, and MLEXPORT.

◆ MLBeginLoadFields()

MLEXPORT void MLBeginLoadFields ( mlModule * module)

Notifies the begin of the loading process in which the fields of the module are set/initialized. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.

References MLEXPORT, and mlModule.

◆ MLBeginSaveFields()

MLEXPORT void MLBeginSaveFields ( mlModule * module)

Notifies the begin of the saving process in which the fields of the module are read/saved. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.

References MLEXPORT, and mlModule.

◆ MLCacheGetCurrentSizeKB()

MLEXPORT MLuint64 MLCacheGetCurrentSizeKB ( )

Returns the number of kilobytes currently allocated within the ML cache.

References MLEXPORT.

◆ MLCacheGetMaxSizeKB()

MLEXPORT MLuint64 MLCacheGetMaxSizeKB ( )

Returns the maximum number of kilobytes used by the ML cache. Note that this limit can be exceeded by the ML if not possible in another way.

References MLEXPORT.

◆ MLCacheSetMaxSizeKB()

MLEXPORT void MLCacheSetMaxSizeKB ( MLuint64 size)

Sets the maximum number of kilobytes used by the ML cache. Note that this limit can be exceeded by the ML if not possible in another way.

References MLEXPORT.

◆ MLClearCache()

MLEXPORT void MLClearCache ( )

Removes all cached pages from all module outputs.

References MLEXPORT.

◆ MLClearMemoryImg()

MLEXPORT MLErrorCode MLClearMemoryImg ( mlField * outField)

Clears the memory image in OutputConnectorField outField if it is handled by the ML. A manually controlled memory image is not changed. No memory will be cleared on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.

References MLEXPORT, and mlField.

◆ MLClearPages()

MLEXPORT MLErrorCode MLClearPages ( mlField * outField)

Removes all pages of the page image from the memory at output image field outField. No pages will be cleared on invalid or wrong typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.

References MLEXPORT, and mlField.

◆ MLClearPagesAndMemoryImg()

MLEXPORT MLErrorCode MLClearPagesAndMemoryImg ( mlField * outField)

Removes all pages of the page image from the memory at OutputConnectorField outField. Also clears the memoryImg if the memoryImg mode is adequate. No pages will be cleared on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK is returned.

References MLEXPORT, and mlField.

◆ MLCreateFieldSensor()

MLEXPORT mlSensor * MLCreateFieldSensor ( void * userData,
MLSensorCB * callback )

Returns a field sensor. It will call callback with user data userData if the field is notified. callback must be a valid pointer to an MLSensorCB function. An invalid pointer will be handled as a non-fatal error and a sensor creation without callback. The created sensor must be destroyed/removed with MLDeleteFieldSensor().

References MLEXPORT, and mlSensor.

◆ MLCreateModuleFromName()

MLEXPORT mlModule * MLCreateModuleFromName ( const char * className)

Creates a new instance of a module of type given by className. className must be a non-NULL pointer to a non-empty NULL-terminated string. Otherwise, a ML_BAD_PARAMETER error will occur.

References MLEXPORT, and mlModule.

◆ MLCreateModuleFromType()

MLEXPORT mlModule * MLCreateModuleFromType ( mlType * type)

Creates a new instance of a module of type given by type. type must be a non-NULL pointer to a valid mlRuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur.

References MLEXPORT, mlModule, and mlType.

◆ MLDeleteFieldSensor()

MLEXPORT void MLDeleteFieldSensor ( mlSensor * sensor)

Destroys the sensor sensor. Eventually attached fields will be detached automatically before destruction. sensor must be a valid pointer to a sensor. Invalid pointers will be handled as non-fatal errors and the call is ignored.

References MLEXPORT, and mlSensor.

◆ MLDeleteModule()

MLEXPORT void MLDeleteModule ( mlModule * module)

Destroys/deletes a module instance module created by MLCreateModuleFromName. NULL pointers as parameters will lead to a ML_BAD_PARAMETER error.

References MLEXPORT, and mlModule.

◆ MLDestroy()

MLEXPORT MLint32 MLDestroy ( )

Destroys the ML, frees memory allocated in MLInit() and in all other ML operations. No ML operations are permitted after this call. On success, 1 is returned and 0 on any failure.

References MLEXPORT.

◆ MLEndLoadFields()

MLEXPORT void MLEndLoadFields ( mlModule * module)

Notifies the end of the loading process in which the fields of the module are set/initialized. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.

References MLEXPORT, and mlModule.

◆ MLEndSaveFields()

MLEXPORT void MLEndSaveFields ( mlModule * module)

Notifies the end of the saving process in which the fields of the module are read/saved. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.

References MLEXPORT, and mlModule.

◆ MLFieldConnectFrom()

MLEXPORT MLint32 MLFieldConnectFrom ( mlField * inField,
mlField * outField )

If inField is an input connector field and outField is an output connector field, the field inField is connected with the field outField and returns true (=1) if connecting was successful, false (=0) otherwise. inField and outField must be valid field pointers. Otherwise, a ML_BAD_FIELD error occurs and 0 is returned.

IMPORTANT: In contrast to connecting normal fields, the MLFieldConnectFrom() call from an input to an output connector field does not cause a notification for optimized network build and historical reasons. It is recommended to use MLFieldTouch() on the input connector field afterwards to assure that the module correctly gets the notification about the connection.

References MLEXPORT, and mlField.

◆ MLFieldDisconnect()

MLEXPORT void MLFieldDisconnect ( mlField * inField)

If inField is an input field: Removes connection to input field inField. Otherwise, all attached fields are removed. If inField is not a valid field pointer, then it will be handled as a ML_BAD_FIELD error and call is ignored.

References MLEXPORT, and mlField.

◆ MLFieldGetDoubleValue()

MLEXPORT MLdouble MLFieldGetDoubleValue ( mlField * field)

Returns the value of the DoubleField field field. field must be a valid DoubleField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and 0 will be returned.

References MLEXPORT, and mlField.

◆ MLFieldGetEnumName()

MLEXPORT const char * MLFieldGetEnumName ( mlField * field,
MLint32 i,
int * value )

Return the name of the i th element of enum field field and set value to i if field type is an enum type. If field is not a valid EnumField pointer, it will be handled as a ML_BAD_FIELD error, *value is set to -1 and an empty string is returned.

References MLEXPORT, and mlField.

◆ MLFieldGetEnumValue()

MLEXPORT int MLFieldGetEnumValue ( mlField * field)

Returns the index of selected element in the EnumField field. If field is not a valid EnumField pointer, it will be handled as a ML_BAD_FIELD error and 0 is returned.

References MLEXPORT, and mlField.

◆ MLFieldGetFloatValue()

MLEXPORT MLfloat MLFieldGetFloatValue ( mlField * field)

Returns the value of the FloatField field. field must be a valid FloatField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and 0 will be returned.

References MLEXPORT, and mlField.

◆ MLFieldGetIntValue()

MLEXPORT MLint32 MLFieldGetIntValue ( mlField * field)

Returns the value of the IntegerField field. field must be a valid IntegerField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and 0 will be returned.

References MLEXPORT, and mlField.

◆ MLFieldGetIntValue64()

MLEXPORT MLint64 MLFieldGetIntValue64 ( mlField * field)

Returns the value of the IntegerField field. field must be a valid IntegerField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and 0 will be returned. This version returns the field value as 64-bit integers if the ML is compiled to support 64-bit integers on 32-bit systems; the normal MLFieldGetIntValue routine remains for backward compatibility.

References MLEXPORT, and mlField.

◆ MLFieldGetName()

MLEXPORT const char * MLFieldGetName ( mlField * field)

Returns the name of field field.

References MLEXPORT, and mlField.

◆ MLFieldGetNumEnums()

MLEXPORT size_t MLFieldGetNumEnums ( mlField * field)

Returns the number of elements in the EnumField field. If field is not a valid EnumField pointer, it will be handled as a ML_BAD_FIELD error and 0 is returned.

References MLEXPORT, and mlField.

◆ MLFieldGetType()

MLEXPORT const char * MLFieldGetType ( mlField * field)

Returns the runtime data type of field field as string.

References MLEXPORT, and mlField.

◆ MLFieldGetValue()

MLEXPORT size_t MLFieldGetValue ( mlField * field,
char * value,
size_t bufferSize )

Copies the value of field field as string into the character string value. bufferSize is the number of characters in value that also limits the the number of copied characters. Return value is the real string size.

References MLEXPORT, and mlField.

◆ MLFieldGetValueSize()

MLEXPORT size_t MLFieldGetValueSize ( mlField * field)

Returns the string length of field value coded as string of field field.

References MLEXPORT, and mlField.

◆ MLFieldSensorAttach()

MLEXPORT void MLFieldSensorAttach ( mlSensor * sensor,
mlField * field )

Attach the sensor sensor to the field field; any value change will be notified by the call of the callback. sensor must be a valid pointer to a sensor, field a valid pointer to a field. Invalid pointers will be handled as non-fatal errors and the call is ignored. A previously attached field will automatically be detached before attaching the new one.

References MLEXPORT, mlField, and mlSensor.

◆ MLFieldSensorDetach()

MLEXPORT void MLFieldSensorDetach ( mlSensor * sensor)

Disconnects the connection between sensor sensor and its observed field. Invalid sensor pointers will be handled as a non-fatal error and the call is ignored. MLFieldSensorGetField(sensor) of this sensor will return NULL after this call.

References MLEXPORT, and mlSensor.

◆ MLFieldSensorGetField()

MLEXPORT mlField * MLFieldSensorGetField ( mlSensor * sensor)

Returns the field that is observed by sensor sensor. sensor must be a valid pointer to a sensor. Invalid pointers will be handled as non-fatal errors and NULL is returned. If no field is attached, NULL is returned.

References MLEXPORT, mlField, and mlSensor.

◆ MLFieldSetDoubleValue()

MLEXPORT void MLFieldSetDoubleValue ( mlField * field,
MLdouble value )

Sets the value of DoubleField field to the double value value. field must be a valid DoubleField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and the call will be ignored.

References MLEXPORT, and mlField.

◆ MLFieldSetEnumValue()

MLEXPORT void MLFieldSetEnumValue ( mlField * field,
int val )

Sets the index of selected element in the EnumField field. If field is not a valid EnumField pointer, it will be handled as a ML_BAD_FIELD error and the call is ignored.

References MLEXPORT, and mlField.

◆ MLFieldSetFloatValue()

MLEXPORT void MLFieldSetFloatValue ( mlField * field,
MLfloat value )

Sets the value of FloatField field to the float value value. field must be a valid FloatField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and the call will be ignored.

References MLEXPORT, and mlField.

◆ MLFieldSetIntValue()

MLEXPORT void MLFieldSetIntValue ( mlField * field,
MLint32 value )

Sets the value of IntegerField field to the integer value value. field must be a valid IntegerField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and the call will be ignored.

References MLEXPORT, and mlField.

◆ MLFieldSetIntValue64()

MLEXPORT void MLFieldSetIntValue64 ( mlField * field,
MLint64 value )

Sets the value of IntegerField field to the integer value value. field must be a valid IntegerField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and the call will be ignored. This version accepts the field value as 64-bit integers if the ML is compiled to support 64-bit integers on 32-bit systems; the normal MLFieldSetIntValue routine remains for backward compatibility.

References MLEXPORT, and mlField.

◆ MLFieldSetValue()

MLEXPORT void MLFieldSetValue ( mlField * field,
const char * value )

Sets the value of field field to value.

References MLEXPORT, and mlField.

◆ MLFieldTouch()

MLEXPORT void MLFieldTouch ( mlField * field)

Touches the field field to notify all connected fields. If field is not a valid field pointer, it will be handled as a ML_BAD_FIELD error and the call is ignored.

References MLEXPORT, and mlField.

◆ MLGetImageState()

MLEXPORT MLErrorCode MLGetImageState ( mlField * outField)
nodiscard

Attempts to update and then it checks an image represented by output field outField. The return value will be ML_RESULT_OK if the image is valid and accessible. Otherwise, an error code is returned.

References MLEXPORT, and mlField.

◆ MLGetImageStateString()

MLEXPORT const char * MLGetImageStateString ( mlField * outField)
nodiscard

Requests the state string from an output field outField. It attempts to update the output image and then it returns a NULL-terminated string describing the state of the output connector. This description is either the error code description of an MLErrorCode or the user-defined state string when invalidating the output of a module. Passing NULL as outField will result in MLGetErrorCodeDescription(ML_DISCONNECTED_GRAPH);

References MLEXPORT, and mlField.

◆ MLGetMaxNumThreads()

MLEXPORT MLuint32 MLGetMaxNumThreads ( )

Returns the currently set number of parallel threads that the ML might use. If 1 is set, multithreading is disabled.

References MLEXPORT.

◆ MLGetMemoryImgSize()

MLEXPORT MLErrorCode MLGetMemoryImgSize ( mlField * outField,
size_t * numBytes )

Returns the currently used size of memory image of OutputConnectorField outField in bytes. *numBytes will be 0 on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.

References MLEXPORT, and mlField.

◆ MLGetPageMemorySize()

MLEXPORT MLErrorCode MLGetPageMemorySize ( mlField * outField,
size_t * numBytes )

Returns the currently used cache size for pages of the image in OutputConnectorField outField in bytes. *numBytes will be 0 on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.

References MLEXPORT, and mlField.

◆ MLHostSetBreakCheckCB()

MLEXPORT void MLHostSetBreakCheckCB ( void * userData,
MLHostBreakCheckCB * callback )

Sets a callback to provide break checking of current calculation.

References MLEXPORT.

◆ MLHostSetProgressCB()

MLEXPORT void MLHostSetProgressCB ( void * userData,
MLHostProgressCB * callback )

Sets a callback to provide feedback of the host calculation progress.

References MLEXPORT.

◆ MLHostUpdateProgress()

MLEXPORT void MLHostUpdateProgress ( const char * info1,
const char * info2 )

Calls the callback set MLHostSetProgressCB manually. This is used by the InventorWrapper module.

References MLEXPORT.

◆ MLImageFieldConnectFromNoNotify()

MLEXPORT MLint32 MLImageFieldConnectFromNoNotify ( mlField * inField,
mlField * outField )

Connects connectors of input connector field inField with the connector of the output connector field outField and returns true (=1) if connection is successful, otherwise false (=0). Note that this connection is NOT a field connection and so notifications are not propagated through this connection. Only a data transfer connection is established. This is used for macro module connections. inField must be a non-NULL InputConnectorField pointer and outField must be a non-NULL OutputConnectorField pointer. Otherwise, ML_BAD_FIELD errors will occur and 0 will be returned.

References MLEXPORT, and mlField.

◆ MLImageFreeTile()

MLEXPORT void MLImageFreeTile ( void * data)

Frees the memory created/allocated by any of the functions MLImageGetTile*() or MLImageGetScaledTile*().

References MLEXPORT.

◆ MLImageGetFirstImagePropertyExtensionByType()

MLEXPORT MLErrorCode MLImageGetFirstImagePropertyExtensionByType ( mlField * outField,
const char * imagePropertyTypeClassName,
void ** imagePropertyExtension )
nodiscard

Returns the first image property extension imagePropertyExtension (as void-pointer) of type imagePropertyTypeClassName of the image represented by output field outField.

References MLEXPORT, and mlField.

◆ MLImageGetMaxValue()

MLEXPORT MLErrorCode MLImageGetMaxValue ( mlField * outField,
MLdouble * maxValue )

Returns the maximum voxel value maxValue of the image represented by output field outField.

References MLEXPORT, and mlField.

◆ MLImageGetMinValue()

MLEXPORT MLErrorCode MLImageGetMinValue ( mlField * outField,
MLdouble * minValue )

Returns the minimum voxel value minValue of the image represented by output field outField.

References MLEXPORT, and mlField.

◆ MLImageGetPageSize6D()

MLEXPORT MLErrorCode MLImageGetPageSize6D ( mlField * outField,
int * x,
int * y,
int * z,
int * c,
int * t,
int * u )

Determines the page size of the image represented by output field outField. The return values are: x, y, z - the spacial resolution, c - the number of color channels, t - the number of time points, and u - the extent of an additional dimension for arbitrary purposes. On any failure, the result values are x=y=z=c=t=u=0. The return value will be ML_RESULT_OK on success and the corresponding error code otherwise.

References MLEXPORT, and mlField.

◆ MLImageGetScaledTile()

MLEXPORT MLErrorCode MLImageGetScaledTile ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint nx,
MLint ny,
MLint nz,
MLDataType datatype,
MLdouble srcMin,
MLdouble srcMax,
MLdouble dstMin,
MLdouble dstMax )
nodiscard

Exactly like MLImageGetScaledTile3D().

References MLEXPORT, and mlField.

◆ MLImageGetScaledTile3D()

MLEXPORT MLErrorCode MLImageGetScaledTile3D ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint nx,
MLint ny,
MLint nz,
MLDataType datatype,
MLdouble srcMin,
MLdouble srcMax,
MLdouble dstMin,
MLdouble dstMax )
nodiscard

Like MLImageGetScaledTile6D(), only for three dimensional regions (i.e., t=u=0 and nt=nt=1).

References MLEXPORT, and mlField.

◆ MLImageGetScaledTile4D()

MLEXPORT MLErrorCode MLImageGetScaledTile4D ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint c,
MLint nx,
MLint ny,
MLint nz,
MLint nc,
MLDataType datatype,
MLdouble srcMin,
MLdouble srcMax,
MLdouble dstMin,
MLdouble dstMax )
nodiscard

Like MLImageGetScaledTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1).

References MLEXPORT, and mlField.

◆ MLImageGetScaledTile6D()

MLEXPORT MLErrorCode MLImageGetScaledTile6D ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint c,
MLint t,
MLint u,
MLint nx,
MLint ny,
MLint nz,
MLint nc,
MLint nt,
MLint nu,
MLDataType datatype,
MLdouble srcMin,
MLdouble srcMax,
MLdouble dstMin,
MLdouble dstMax )
nodiscard

Like MLImageGetTile6D(). The resulting memory can be scaled to another interval. It is assumed that the input image data range is from [ srcMin, srcMax ] and will be scaled to [ dstMin, dstMax ].

References MLEXPORT, and mlField.

◆ MLImageGetSize()

MLEXPORT MLErrorCode MLImageGetSize ( mlField * outField,
int * x,
int * y,
int * z,
int * c )

Like MLImageGetSize6D, only for 4D. The last two extents are ignored.

References MLEXPORT, and mlField.

◆ MLImageGetSize6D()

MLEXPORT MLErrorCode MLImageGetSize6D ( mlField * outField,
int * x,
int * y,
int * z,
int * c,
int * t,
int * u )

Determines the size of the image represented by output field outField. The return values are: x, y, z - the spacial resolution, c - the number of color channels, t - the number of time points, and u - the extent of an additional dimension for arbitrary purposes. On any failure, the result values are x=y=z=c=t=u=0. The return value will be ML_RESULT_OK on success and the corresponding error code otherwise.

References MLEXPORT, and mlField.

◆ MLImageGetTile()

MLEXPORT MLErrorCode MLImageGetTile ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint nx,
MLint ny,
MLint nz,
MLDataType datatype )
nodiscard

Exactly like MLImageGetTile3D().

References MLEXPORT, and mlField.

◆ MLImageGetTile3D()

MLEXPORT MLErrorCode MLImageGetTile3D ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint nx,
MLint ny,
MLint nz,
MLDataType datatype )
nodiscard

Like MLImageGetTile6D(), only for three dimensional regions (i.e., c=t=u=0 and nc=nt=nu=1).

References MLEXPORT, and mlField.

◆ MLImageGetTile4D()

MLEXPORT MLErrorCode MLImageGetTile4D ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint c,
MLint nx,
MLint ny,
MLint nz,
MLint nc,
MLDataType datatype )
nodiscard

Like MLImageGetTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1).

References MLEXPORT, and mlField.

◆ MLImageGetTile6D()

MLEXPORT MLErrorCode MLImageGetTile6D ( mlField * outField,
void ** memory,
MLint x,
MLint y,
MLint z,
MLint c,
MLint t,
MLint u,
MLint nx,
MLint ny,
MLint nz,
MLint nc,
MLint nt,
MLint nu,
MLDataType datatype )
nodiscard

Calculates a 6D rectangular region of the input image given by output field outField and returns a pointer to calculated data in *memory. outField must be a non-NULL pointer to a OutputConnectorField. Otherwise, a ML_BAD_FIELD error will occur, the call will be ignored and ML_BAD_FIELD will be returned. The origin coordinate of the region to be calculated is x, y, z, c, t, and u, the extents are nx, ny, nz, nc, nt, and nu, and the data type is specified by data type. Note that the specified region may reach outside the valid image ranges. The data calculated from those regions will be supplied normally in *memory, but the content will be undefined. If *memory is a NULL pointer, then the memory needed for the image region is allocated automatically and *memory is set to the memory area. It must be freed with the function MLImageFreeTile(). On successful operation ML_RESULT_OK is returned; otherwise, an error describing code.

References MLEXPORT, and mlField.

◆ MLImageGetType()

MLEXPORT MLErrorCode MLImageGetType ( mlField * outField,
MLDataType * dtype,
size_t * dsize )

Determines the data type dtype and its size dsize in bytes of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and dtype and dsize will be undefined.

References MLEXPORT, and mlField.

◆ MLImageGetVoxelSize()

MLEXPORT MLErrorCode MLImageGetVoxelSize ( mlField * outField,
MLfloat * x,
MLfloat * y,
MLfloat * z )

Determines the voxel size x / y / z of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and x, y, and z will be undefined.

References MLEXPORT, and mlField.

◆ MLImageGetVoxelSizeInDoubles()

MLEXPORT MLErrorCode MLImageGetVoxelSizeInDoubles ( mlField * outField,
MLdouble * x,
MLdouble * y,
MLdouble * z )

Determines the voxel size x / y / z of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and x, y, and z will be undefined.

References MLEXPORT, and mlField.

◆ MLImageGetVoxelToWorldMatrix()

MLEXPORT MLErrorCode MLImageGetVoxelToWorldMatrix ( mlField * outField,
MLfloat [16] )

Returns the VoxelToWorldMatrix of the image represented by output field outField.

References MLEXPORT, and mlField.

◆ MLImageGetVoxelToWorldMatrixInDoubles()

MLEXPORT MLErrorCode MLImageGetVoxelToWorldMatrixInDoubles ( mlField * outField,
MLdouble [16] )

Returns the VoxelToWorldMatrix of the image represented by output field outField.

References MLEXPORT, and mlField.

◆ MLImageGetWorldToVoxelMatrix()

MLEXPORT MLErrorCode MLImageGetWorldToVoxelMatrix ( mlField * outField,
MLfloat [16] )

Returns the WorldToVoxelMatrix of the image represented by output field outField.

References MLEXPORT, and mlField.

◆ MLImageGetWorldToVoxelMatrixInDoubles()

MLEXPORT MLErrorCode MLImageGetWorldToVoxelMatrixInDoubles ( mlField * outField,
MLdouble [16] )

Returns the WorldToVoxelMatrix of the image represented by output field outField.

References MLEXPORT, and mlField.

◆ MLImageMapVoxelToWorld()

MLEXPORT MLErrorCode MLImageMapVoxelToWorld ( mlField * outField,
MLfloat srcX,
MLfloat srcY,
MLfloat srcZ,
MLfloat * dstX,
MLfloat * dstY,
MLfloat * dstZ )

Transforms the given position (srcX, srcY, scrZ) from voxel to world coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.

References MLEXPORT, and mlField.

◆ MLImageMapVoxelToWorldInDoubles()

MLEXPORT MLErrorCode MLImageMapVoxelToWorldInDoubles ( mlField * outField,
MLdouble srcX,
MLdouble srcY,
MLdouble srcZ,
MLdouble * dstX,
MLdouble * dstY,
MLdouble * dstZ )

Transforms the given position (srcX, srcY, scrZ) from voxel to world coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.

References MLEXPORT, and mlField.

◆ MLImageMapWorldToVoxel()

MLEXPORT MLErrorCode MLImageMapWorldToVoxel ( mlField * outField,
MLfloat srcX,
MLfloat srcY,
MLfloat srcZ,
MLfloat * dstX,
MLfloat * dstY,
MLfloat * dstZ )

Transforms the given position (srcX, srcY, scrZ) from world to voxel coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.

References MLEXPORT, and mlField.

◆ MLImageMapWorldToVoxelInDoubles()

MLEXPORT MLErrorCode MLImageMapWorldToVoxelInDoubles ( mlField * outField,
MLdouble srcX,
MLdouble srcY,
MLdouble srcZ,
MLdouble * dstX,
MLdouble * dstY,
MLdouble * dstZ )

Transforms the given position (srcX, srcY, scrZ) from world to voxel coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.

References MLEXPORT, and mlField.

◆ MLInit()

MLEXPORT MLint32 MLInit ( MLint32 majorVersion,
MLint32 majorCAPIVersion,
MLint32 revCAPI )

Calls the C++ initialization of the ML. Must be called before any ML or mlAPI usage.

Returns
true (=1) on success, false (=0) otherwise. The return value 0 should be considered fatal, i.e., some basic system properties are not sufficient, required libraries are not found, not enough memory, invalid library versions, or something like that.
Parameters
majorVersionShould always be ML_MAJOR_VERSION.
majorCAPIVersionShould always be ML_MAJOR_CAPI_VERSION.
revCAPIShould always be ML_CAPI_REVISION.

Multiple calls are legal but will not change any previous initialization. Note that this call does not check C++-compatibility of the ML since this call is typically used by applications that only require C-API compatibility. C++-applications should also check MLIsCPPAPILinkCompatible for a non-0 return value.

References MLEXPORT.

◆ MLIsCurrentlyUnloadingLibrary()

MLEXPORT MLuint32 MLIsCurrentlyUnloadingLibrary ( )

This function returns true (=1) if an ML library is currently unloaded, otherwise false (=0).

References MLEXPORT.

◆ MLLoadLibrary()

MLEXPORT MLint32 MLLoadLibrary ( const char * name)

Loads the given shared library. name must be a non-NULL pointer to a non-empty NULL terminated string. Otherwise, a fatal error will occur. On successful library load, true (=1) is returned; on error, false (=0) is returned. Any error will be posted to the ML error handler. As a side effect, the most recently loaded library name is updated to the library name (see Runtime::setRecentlyLoadedDllName for more information) and the initialization of the loaded library is called implicitly.

References MLEXPORT.

◆ MLLoadLibraryWOError()

MLEXPORT MLErrorCode MLLoadLibraryWOError ( const char * name)
nodiscard

Same as MLLoadLibraryWOErrorExt with libHandle=NULL.

References MLEXPORT.

◆ MLLoadLibraryWOErrorExt()

MLEXPORT MLErrorCode MLLoadLibraryWOErrorExt ( const char * name,
MLLibraryHandle * libHandle )
nodiscard

Loads the given shared library. name must be a non-NULL pointer to a non-empty NULL terminated string. Otherwise, a fatal error will occur.

Note
MeVisLab uses its own library loading and will not call this function.

Returns ML_RESULT_OK in case of successful library load or an error code describing the error (e.g., ML_LIBRARY_LOAD_ERROR if the library is not found or not linked).

As a side effect, the most recently loaded library name is updated to the library name (see Runtime::setRecentlyLoadedDllName for more information), and the initialization of the loaded library is called implicitly. Errors are posted only on invalid parameters, crashes on library initialization, but not if the library is not found or not loadable. This way, this library can be used to check for a library and to handle unloadable libraries without errors. If libHandle is passed as a NULL pointer, then it is ignored; otherwise, *libHandle is set to the return value of the library load function. It will be needed to unload the library with MLUnLoadLibrary.

References MLEXPORT.

◆ MLModuleGetField()

MLEXPORT mlField * MLModuleGetField ( mlModule * module,
const char * name )

Returns the field with name name of module. Returns 0 (NULL) if it does not exist. module must be a valid pointer to an ml::Module object and name must be a non-NULL pointer to a NULL-terminated non-empty string. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.

References MLEXPORT, mlField, and mlModule.

◆ MLModuleGetIndexedField()

MLEXPORT mlField * MLModuleGetIndexedField ( mlModule * module,
MLint32 n )

Returns the field with an index n from [0..getNumFields-1] of module if field exists; otherwise, 0 (NULL) is returned. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.

References MLEXPORT, mlField, and mlModule.

◆ MLModuleGetNumFields()

MLEXPORT size_t MLModuleGetNumFields ( mlModule * module)

Returns the number of fields contained in module. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.

References MLEXPORT, and mlModule.

◆ MLModuleSetFieldValue()

MLEXPORT void MLModuleSetFieldValue ( mlModule * module,
char * fieldName,
char * value )

Sets the field with name fieldName of module to value value. module must be a valid pointer to an ml::Module object and fieldName and value must be pointers to NULL-terminated strings where fieldName also must must be non-empty. Otherwise, they will be handled as a ML_BAD_PARAMETER errors and call will be ignored.

References MLEXPORT, and mlModule.

◆ MLPointerFieldGetPtr()

MLEXPORT void * MLPointerFieldGetPtr ( mlField * field)

Returns the value of the pointer field field. A field of unexpected type or an invalid field pointer is handled as a non-fatal error and NULL is returned.

References MLEXPORT, and mlField.

◆ MLPointerFieldSetPtr()

MLEXPORT void MLPointerFieldSetPtr ( mlField * field,
const void * value )

Sets the value of the pointer field field to value. The pointer value may be NULL. A field of unexpected type or an invalid field pointer is handled as a non-fatal error and the call is ignored.

References MLEXPORT, and mlField.

◆ MLSendMessagesToCerr()

MLEXPORT void MLSendMessagesToCerr ( MLint32 on)

If 0 is passed as on, message sending to std::cerr is disabled. Otherwise, all messages are printed to std::cerr.

References MLEXPORT.

◆ MLSendMessagesToCout()

MLEXPORT void MLSendMessagesToCout ( MLint32 on)

If 0 is passed as on, message sending to std::cout is disabled. Otherwise, all messages are printed to std::cout.

References MLEXPORT.

◆ MLSetIsCurrentlyUnloadingLibrary()

MLEXPORT MLuint32 MLSetIsCurrentlyUnloadingLibrary ( MLuint32 enable)

This function allows to set the MLIsCurrentlyUnloadingLibrary state and returns the previously set unloading state. It may be used when library unloading is triggered by an external program instead of using MLUnLoadLibrary.

References MLEXPORT.

◆ MLSetMaxNumThreads()

MLEXPORT MLErrorCode MLSetMaxNumThreads ( MLuint32 numThreads)

Sets the number of parallel threads that the ML might use. Legal values for numThreads are positive numbers > 0, otherwise a ML_BAD_PARAMETER error will occur. If 1 is set, multithreading is disabled.

References MLEXPORT.

◆ MLSoNodeFieldGetPtr()

MLEXPORT void * MLSoNodeFieldGetPtr ( mlField * field)

Returns the value of the SoNode field field. A field of unexpected type or an invalid field pointer is handled as a non-fatal error and a NULL is returned.

References MLEXPORT, and mlField.

◆ MLSoNodeFieldSetPtr()

MLEXPORT void MLSoNodeFieldSetPtr ( mlField * field,
const void * value )

Sets the pointer value of the SoNode field field to value. The pointer value may be NULL. A field of unexpected type or an invalid field pointer is handled as a non-fatal error and the call is ignored.

References MLEXPORT, and mlField.

◆ MLTypeFromName()

MLEXPORT mlType * MLTypeFromName ( const char * name)

Returns the type object for given name. 0 will be returned if the type described by name is unknown.

References MLEXPORT, and mlType.

◆ MLTypeGetDllName()

MLEXPORT const char * MLTypeGetDllName ( mlType * type)

Returns a pointer to a NULL-terminated string containing the string name of the DLL probably containing the code and/or the init function of the class represented by type. type must be a non-NULL pointer to a valid mlRuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur and NULL is returned.

References MLEXPORT, and mlType.

◆ MLTypeGetName()

MLEXPORT const char * MLTypeGetName ( mlType * type)

Returns a pointer to a NULL-terminated string containing the name of the class represented by type. type must be a non-NULL pointer to a valid mlRuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur and NULL is returned.

References MLEXPORT, and mlType.

◆ MLTypeGetParentName()

MLEXPORT const char * MLTypeGetParentName ( mlType * type)

Returns a pointer to a NULL-terminated string containing the name of the parent class of that represented by type. A pointer to 'No parent' is returned if there is no such class. type must be a non-NULL pointer to a valid mlRuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur and NULL is returned.

References MLEXPORT, and mlType.

◆ MLTypeGetParentType()

MLEXPORT mlType * MLTypeGetParentType ( mlType * type)

Returns a pointer to the RuntimeType instance representing the type of the parent class of that represented by type. A NULL pointer is returned if there is no such class. type must be a non-NULL pointer to a valid RuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur and NULL is returned.

References MLEXPORT, and mlType.

◆ MLTypeIsAbstract()

MLEXPORT MLint32 MLTypeIsAbstract ( mlType * type)

Returns true (=1) if type is abstract, otherwise 0 (=false). type must be a non-NULL pointer to a valid mlRuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur. -1 is return value after such or fatal errors.

References MLEXPORT, and mlType.

◆ MLTypeIsDerivedFrom()

MLEXPORT MLint32 MLTypeIsDerivedFrom ( mlType * type,
const char * parent )

Returns true (=1) if runtime type type is derived from the parent class with the name given by parent. The return value is false (=0) if not, or on errors, or if any of type or parent is NULL (which is legal to pass to the call). The non-NULL type must be a pointer to a valid RuntimeType object and parent a pointer to a NULL-terminated string containing the name of the parent class.

References MLEXPORT, and mlType.

◆ MLUnLoadLibrary()

MLEXPORT MLErrorCode MLUnLoadLibrary ( const char * name,
MLLibraryHandle libHandle,
char ** errStr )
nodiscard

Unloads the given shared library. name must be a non-NULL pointer to a non-empty NULL terminated string. Otherwise, a fatal error will occur. Returns ML_RESULT_OK in case of successful library unload or an error code describing the error.

Note
MeVisLab uses its own library unloading and will not call this function.

The libHandle parameter must be the corresponding library handle created by MLLoadLibraryWOErrorExt for successful operation. The responsibility for safe removal of the library is completely up to the application - the ML cannot check completely whether, for example, other libraries depend on the unloaded one. If errStr is passed as a non-NULL pointer, then it is set to a string describing the error. *errStr must always be freed with MLFree(). Note that detection of references is limited to ML type; it does not cover all possible link references, etc.

Note that library unloading has a number of side effects:

  • All runtime types registered in the runtime type system are removed;
  • The library is not removed if other libraries still use it.
  • If instances of classes of the library exist, the library can be unloaded; however, those libraries will not operate safely anymore. It is possible to load new code for that library again; whether the already existing instances will operate safely again depends on the content of the reloaded library. This behavior should not be considered reliable.
  • Opened resources not closed properly by the library programmer may remain open (for example, type registrations in other type systems than the one of the ML, initialized device drivers). Thus use this function only with extreme care.

References MLEXPORT.