CompareNetworks

MacroModule
author MeVis Medical Solutions AG
package MeVisLab/Standard
definition CompareNetworks.def
keywords mlab, file, comparison

Purpose

The module CompareNetworks compares two *.mlab files.

It ignores everything that is GUI related and just compares the modules and their field values and connections. If visual comparison is enabled, it will load the *.mlab files into MeVisLab and show them side-by-side.

Details

The module can use floating point comparison to compare field values, this will eliminate false positive changes that are detected due to precision changes. It can be disabled to just compare the raw string values.

Tips

If your developer license allows you to run MeVisLab from the command line, you can run this module standalone as follows:

PATH_TO_MEVISLAB_INSTALLATION/Packages/MeVisLab/IDE/bin/MeVisLab -quick -noide -runapp CompareNetworks file1 file2

This is especially useful to use it as a diff tool for your version control system, e.g., for the Tortoise SVN client.

To use it with Tortoise SVN, go to Tortoise SVN->Settings->External Programs->Diff Viewer->Advanced and add the following entry for *.mlab:

PATH_TO_MEVISLAB_INSTALLATION/Packages/MeVisLab/IDE/bin/MeVisLab -quick -noide -runapp CompareNetworks %base %mine

This will cause Tortoise to launch the network comparison whenever two *.mlab files are compared.

Known Problems

The comparison tries to detect if a module was renamed, but since there is no unique id to detect this, it looks for a module of same type that is close. This can lead to false positive rename detections, where a module of the same type was added near the removed module or it can fail to detect a rename, if the module was renamed and moved at the same time.

If visual comparison is enabled, the module may crash MeVisLab while loading the *.mlab files, if they contain broken modules. It can also happen that the loaded networks produce errors because the modules do not exist anymore (because you are comparing an older version and a module has been removed from the module database). The comparison itself is not affected by the loading of *.mlab files into MeVisLab, so you should turn visual comparison off for networks that cause problems.

Windows

Default Panel

../../../Modules/Macros/Helpers/mhelp/Images/Screenshots/CompareNetworks._default.png

Parameter Fields

Field Index

Epsilon: Float
Mode: Enum
New Network: String
Old Network: String
Use Float Compare: Bool
Visual Comparison: Bool

Visible Fields

Old Network

name: networkFileName1, type: String

Sets the path to the old network file.

New Network

name: networkFileName2, type: String

Sets the path to the new network file.

Use Float Compare

name: useFloatCompare, type: Bool, default: TRUE

If checked, the comparison of float field values uses an Epsilon value.

Epsilon

name: floatEpsilon, type: Float, default: 0.0099999998

Sets the epsilon value for float comparison.

Visual Comparison

name: visualComparison, type: Bool, default: TRUE

If checked, previews of the old and the new networks are rendered side by side.

Mode

name: resultMode, type: Enum, default: Flat

Defines how the resulting differences should be displayed.

Values:

Title Name
Flat Flat
Grouped Grouped