Chapter 8. Starting Development with Package Creation

Table of Contents

8.1. What are Packages
8.2. Creating a User Package for Your Project

8.1. What are Packages

Modules and projects come in a package structure, which offers an improved modularity and granularity.

A package is a self-contained directory structure that contains the following components:

  • PackageGroup

    • PackageName

      • Package.def

      • Modules

      • Sources

      • Configuration

      • Documentation

      • lib

      • bin

Figure 8.1. Example for a Package Tree

Example for a Package Tree

In this example, we have a PackageGroup "MyPackageGroup". Below it, four packages can be found (Internal, Playground, Research, YetAnotherPackage). Below each package, the typical folders can be found. (This example was generated with the Project Wizard in MeVisLab.)

A PackageGroup can contain any number of packages, and of course there can be different PackageGroups.

The PackageIndentifier is defined by "PackageGroup/PackageName", e.g., the MeVisLab Standard Package has the identifier "MeVisLab/Standard".


For more detailed information on packages, see the Package Structure documentation.

MeVisLab reads packages in the following order:

  • the Packages directory in which MeVisLab was installed

  • the directories given in the PackagePaths settings of the mevislab.prefs file

  • the UserPackagePath (as set in the MeVisLab Preferences dialog

Scanning is always two levels deep, never deeper. If a package with the same PackageIdentifier is found more than once, the last package found will overwrite the earlier packages (in the order given above). This way, your packages given by mevislab.prefs or your user packages can overwrite installed packages.

You can check your effective package structure in two ways:

  • by using the meta-tool ToolRunner. See the ToolRunner documentation for details.

  • by checking the MeVisLab Preferences, section “Packages”.

Figure 8.2. Preferences — Packages

Preferences — Packages

In this dialog, the sequence of display is as follows (from top to bottom; higher entries overwrite lower entries):

  • User Packages: packages found in the user path (packages in other paths can be added manually). These are the default packages for user-defined modules.

  • mevislab.prefs: packages resulting from the paths given in the .prefs file.

  • Installed Packages: packages resulting from an installation of e.g., MeVisLab SDK.

If a package with the same PackageIdentifier is found more than once, the last package found will overwrite the previously loaded packages. These will be grayed out and labeled “(Overwritten)”.

You can:

Create New Package: Opens the Package Wizard (see Section 8.2, “Creating a User Package for Your Project”).

Add Existing User Packages: Opens the default file browser so that you can add a user package. Folders are read recursively and all packages below them are automatically included.

Remove: Removes the selected user package from the path of MeVisLab. (Installed packages cannot be removed.) Removed user packages can always be re-added later.