MicroBridge
MicroBridge is a tool that allows file conversion between Slide annotation software like NDP.view2 to an XML format that Leica Microdissection (LMD) microscopes support.
Purpose
Scientists annotate regions of interest in software like NDP.view2, They would then have to re-draw those same annotations in the software for the LMDs.
MicroBridge takes the annotation files from NDP.view2 and converts them into a format that the LMD can understand, This gives the scientists more time to do experiments rather than annotating files for the 2nd time.
Installation
To install the package do one of the following:
A. Grab the release from the release section (Mainly for windows)
B. Clone the Repo Make a virtual environment
python3 -m venv .venv
Then:
pip install -e .
Usage
There are 2 ways to use MicroBridge Option 1: Usage via the GUI (graphical user interface) Install it first And either run
microbridge
In your terminal and it will open up Or use the desktop icon / entry to open the program
Option 2: Usage via the terminal For typical usage you would run
microbridge filename.ndpa file2.ndpa file3.ndpa ...
There are 2 flags that you can use to help with input and output Flag 1: Batch processing To process a whole folder / directory run
microbridge -b directory-path
Flag 2: output dir To set a specific directory / folder for the files be placed into run
microbridge filename.ndpa -o 'path/to/dir'
You can use both flags with each other
microbridge -b 'path/to/.ndpa/dir' -o 'path/to/output/dir'
You can also run
microbridge --help
This shows you all the commands and a quick run down of what they do
Tests
There is information about running the tests locally in the tests directory of the REPO
You can run this
python -m venv .venv
source .venv/bin/activate
pip install -e .
python run_tests.py
to set up the venv and run the tests
ndpa -> LMD(xml) example
A raw ndpa looks like this:
<!-- Calibration Point 3 - Circle annotation -->
<ndpviewstate id="3">
<title>Calibration_3</title>
<annotation type="circle">
<x>200000000</x>
<y>300000000</y>
<radius>5000000</radius>
</annotation>
</ndpviewstate>
<!-- RULER - should be SKIPPED -->
<ndpviewstate id="4">
<title>Measurement_1</title>
<annotation type="linearmeasure" displayname="AnnotateRuler" color="#ff0000">
<x1>100000000</x1>
<y1>100000000</y1>
<x2>200000000</x2>
<y2>200000000</y2>
</annotation>
</ndpviewstate>
MicroBridge (currently) converts this to an XML for the LMD's which look like this:
<X_CalibrationPoint_3>200000</X_CalibrationPoint_3>
<Y_CalibrationPoint_3>300000</Y_CalibrationPoint_3>
<ShapeCount>2</ShapeCount>
<Shape_1>
<PointCount>3</PointCount>
<X_1>300000</X_1>
<Y_1>400000</Y_1>
<X_2>350000</X_2>
<Y_2>400000</Y_2>
<X_3>350000</X_3>
<Y_3>450000</Y_3>
</Shape_1>
This example above is cut down for length reasons
If you want to see a real world example and the full example above you can look here: ndpa --> LMD(xml) examples
Codebase Layout
src/
├── MicroBridge/
│ ├── __init__.py
│ ├── core/
│ │ ├── __init__.py
│ │ ├── conversion.py
│ │ └── utils.py
│ ├── cli/
│ │ ├── __init__.py
│ │ └── main.py
│ └── gui/
│ ├── __init__.py
│ └── main.py
tests/
├── __init__.py
├── README.md
├── test_core.py
├── test_gui.py
├── test_intergration.py
├── test_utils.py
├── test_cli.py
└── test_Data/
└── All the test data, I am not writing that out...
pyproject.toml
run_tests.py
License
This project is licensed under the GNU GPLv3.0 License This is important as it support copyleft! and Free software!
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 microbridge_lmd-0.2.0.tar.gz.
File metadata
- Download URL: microbridge_lmd-0.2.0.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
028b0f69bbeece426616d0fde49067b3780fd5a5cbc9b24ad38cfb6ad2824d96
|
|
| MD5 |
f443899b60878454eda5d86d3add5c04
|
|
| BLAKE2b-256 |
faf6784f57b4cd8109626aef76896d5b3725c8c9ce6bd2f402f87142ab8538c3
|
File details
Details for the file microbridge_lmd-0.2.0-py3-none-any.whl.
File metadata
- Download URL: microbridge_lmd-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f190fac029c63dcca3c4e0eab08df82c75e2b273412c619f4d6578c5f1763dd
|
|
| MD5 |
de9bf5b75f042e06b084e9e986670c4f
|
|
| BLAKE2b-256 |
6b37fba08eebd63df9922e398b27a6cd5a54a3c906491358f77b0ea4cf7ac40d
|