Remote control for MITK Workbench from Python
Project description
mitk-workbench-remote
Remote control for MITK Workbench from Python
mitk-workbench-remote is a Python library for controlling running MITK Workbench instances programmatically via their REST API. It is designed for researchers and developers who want to drive the Workbench from Python scripts, Jupyter notebooks, and ML pipelines — loading images, editing segmentations, and managing data nodes without touching the GUI.
Quick start
import mitk_workbench_remote as mw
# Connect to a running Workbench
wb = mw.connect("http://localhost:8080")
# Show a file, an Image object or any data format directly supported
# (e.g. numpy array, sitk, mlarray)
wb.show("scan.nrrd", opacity=0.8)
wb.show(my_array, name="Prediction", color=(1.0, 0.5, 0.0))
Connections to a loopback host (localhost, 127.0.0.1, ::1) ignore the
environment proxy settings by default, since a forward/corporate proxy cannot
route to your own machine. Pass trust_env=True (or False) to connect() to
override this.
Features
wb.show()one-liner for files, numpy arrays, SimpleITK images, and mlarray objects- DataStorage CRUD - list, filter, create, and remove data nodes
- Image transfer with automatic transfer mode negotiation (direct HTTP or file-reference)
- MultiLabel segmentation editing - groups, labels, pixel data, and full round-trip
- Rendering control - crosshair position, reinit, and screenshots
- Discovery and launch - find running instances or start new ones
- Converter registry for custom image types
- Structured logging via Python's
loggingmodule
Requirements
A running MITK Workbench instance with REST API enabled.
Installation
pip install mitk-workbench-remote
With optional image format support (SimpleITK and MLArray):
pip install mitk-workbench-remote[all]
[all] covers the image-format converters and installs on every supported Python
(3.11+). The MITK interop and the typed MxN layout DSL need the mitk / layout
extra, which depends on mitk-python; that package currently ships CPython 3.12
wheels only, so those extras require Python 3.12. To install everything on 3.12:
pip install "mitk-workbench-remote[all,layout]"
Development
git clone https://github.com/MITK/mitk-workbench-remote.git
cd mitk-workbench-remote
pip install -e ".[dev]"
pytest
Logging
import logging
logging.basicConfig(level=logging.DEBUG)
Examples
See docs/examples/ for Jupyter notebooks covering common workflows.
Documentation
Full documentation at mitk-workbench-remote.readthedocs.io.
Versioning
This project follows Semantic Versioning 2.0.0 for stable
releases. In short: MAJOR bumps mean breaking API changes, MINOR bumps add functionality in a
backwards-compatible way, and PATCH bumps are backwards-compatible bug fixes.
Pre-release and development builds use PEP 440 notation
(e.g. 1.0.0a1, 0.1.0.dev0) as required by the Python packaging ecosystem. The semantics are
equivalent to SemVer pre-release identifiers, only the syntax differs.
License
Please ensure your usage complies with the code license. Apache-2.0 — see LICENSE.
🆘 Support & Contributing
- 📖 Documentation: Full API documentation available
- 🐛 Issues: Report bugs and feature requests
- 💬 Discussion: Join our community for questions and tips
- 🔧 Contributing: We welcome contributions. More details can be found in the dedicated Contribution Guide.
Copyright & License
Copyright © German Cancer Research Center (DKFZ), Division of Medical Image Computing (MIC).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mitk_workbench_remote-0.1.0rc2.tar.gz.
File metadata
- Download URL: mitk_workbench_remote-0.1.0rc2.tar.gz
- Upload date:
- Size: 840.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c5b88ae4cd58a63f3165b3a74176016b186318935ee44c7957dceacaa3edaab
|
|
| MD5 |
fdbf171a8a6c14566656fc5bf992103e
|
|
| BLAKE2b-256 |
a848f75c6fc839887505d994d787421370826fc3c08465f319919ca257d4d665
|
Provenance
The following attestation bundles were made for mitk_workbench_remote-0.1.0rc2.tar.gz:
Publisher:
publish.yml on MITK/mitk-workbench-remote
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mitk_workbench_remote-0.1.0rc2.tar.gz -
Subject digest:
8c5b88ae4cd58a63f3165b3a74176016b186318935ee44c7957dceacaa3edaab - Sigstore transparency entry: 1954603304
- Sigstore integration time:
-
Permalink:
MITK/mitk-workbench-remote@9c6b494e65ad0378a0271bf2031a6fa7a88cb987 -
Branch / Tag:
refs/tags/v0.1.0rc2 - Owner: https://github.com/MITK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9c6b494e65ad0378a0271bf2031a6fa7a88cb987 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mitk_workbench_remote-0.1.0rc2-py3-none-any.whl.
File metadata
- Download URL: mitk_workbench_remote-0.1.0rc2-py3-none-any.whl
- Upload date:
- Size: 102.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
207e6420283929168758bd75948a55833e36f2b89a4c8c41fbd50db4f24e267c
|
|
| MD5 |
cda3752efadb9d2332dce7dad7eb7bdc
|
|
| BLAKE2b-256 |
b9888c3f26684b352370ba000fbd0509097787716fc66efc7b26aef2de9cd0b2
|
Provenance
The following attestation bundles were made for mitk_workbench_remote-0.1.0rc2-py3-none-any.whl:
Publisher:
publish.yml on MITK/mitk-workbench-remote
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mitk_workbench_remote-0.1.0rc2-py3-none-any.whl -
Subject digest:
207e6420283929168758bd75948a55833e36f2b89a4c8c41fbd50db4f24e267c - Sigstore transparency entry: 1954603459
- Sigstore integration time:
-
Permalink:
MITK/mitk-workbench-remote@9c6b494e65ad0378a0271bf2031a6fa7a88cb987 -
Branch / Tag:
refs/tags/v0.1.0rc2 - Owner: https://github.com/MITK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9c6b494e65ad0378a0271bf2031a6fa7a88cb987 -
Trigger Event:
release
-
Statement type: