This walks you through building the template against MITK, running the Workbench, and trying the examples.
The template has the same prerequisites as MITK itself (a C++20 compiler, a recent CMake, and Qt). See the MITK build instructions for the exact versions and platform notes. You do not need to build MITK separately: the MITK superbuild builds MITK and this template together.
Put MITK and the template side by side, for example:
dev/
MITK/ # cloned from https://github.com/MITK/MITK
MITK-ProjectTemplate/ # this project (your copy)
Check out matching release tags of both (the template tracks MITK's releases). For your own project, start from "Use this template" on GitHub instead of cloning; see Make it your own.
You point the MITK superbuild at the template with the MITK_EXTENSION_DIRS
cache variable. Everything in the template is then built as if it were part of
MITK.
Windows (Visual Studio):
cmake -S MITK -B MITK-superbuild -G "Visual Studio 17 2022" ^
-D MITK_EXTENSION_DIRS=C:/dev/MITK-ProjectTemplate
cmake --build MITK-superbuild --config ReleaseLinux / macOS (Ninja):
cmake -S MITK -B MITK-superbuild -G Ninja -D CMAKE_BUILD_TYPE=Release \
-D MITK_EXTENSION_DIRS=/path/to/MITK-ProjectTemplate
cmake --build MITK-superbuildThe first build takes a while because it downloads and builds MITK's dependencies. After that, rebuild only the inner tree (MITK plus the template):
cmake --build MITK-superbuild/MITK-build --config ReleaseMITK_EXTENSION_DIRS accepts a semicolon-separated list, so you can point it at
several extension directories at once.
The applications land in MITK-superbuild/MITK-build/bin.
- Windows: run
startMitkWorkbench_release.batfrom that folder (it sets up the requiredPATH). - Linux / macOS: run the
MitkWorkbenchbinary directly.
In the Workbench:
-
Open Window > Views > Example View (category "Examples"). Load any image, select it in the Example View, set an offset, and press "Add Offset" to run the example image filter. The result carries an interactor: Ctrl-click in the image to paint.
-
Load the custom data type: open the bundled sample file
points.exampledata(File > Open, or drag it onto a render window). It is plain text with onelabel x y zper line:# label x y z origin 0 0 0 right 50 0 0 up 0 50 0The points render as spheres in the 2D and 3D windows, drawn by the custom mappers.
ExampleCmdApp (in MITK-build/bin) adds an offset to every voxel of an image:
ExampleCmdApp -i input.nrrd -o output.nrrd -f 100Run it without arguments to print the full help.
Build the inner tree with testing enabled (BUILD_TESTING=ON in the
MITK-build CMake cache), then run the template's tests through ctest:
cd MITK-superbuild/MITK-build
ctest -C Release -R ExampleThis runs the example unit tests (the
image-filter test and the IO round-trip test). Always run tests through ctest,
never the test-driver executables directly.