Skip to main content
 ___  ____               ______      _     _
 |  \/  (_)              | ___ \    (_)   | |
 | .  . |_  ___ _ __ ___ | |_/ /_ __ _  __| | __ _  ___
 | |\/| | |/ __| '__/ _ \| ___ \ '__| |/ _` |/ _` |/ _ \
 | |  | | | (__| | | (_) | |_/ / |  | | (_| | (_| |  __/
 \_|  |_/_|\___|_|  \___/\____/|_|  |_|\__,_|\__, |\___|
                                              __/ |
                                              |___/

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

Packaging status

To install select your Operating system and follow one of the sets of instructions:

Linux

There is a universal way of installing MicroBridge on Linux

pipx

Make sure you have python installed, If you do not install python3.12 or above using your systems package manager.

Then install pipx. Then run:

pipx install microbridge-lmd

If that does not work you can always overide it and run:

pip install microbridge --break-system-packages

This will install it with normal pip but can cause issues with your system python.

AUR

You can find the package on the AUR

Use an aur helper like paru by running:

paru -S microbridge-lmd

Or Yay:

yay -S microbridge-lmd

Or manually by cloning the package then running:

paru -Ui

There are more ways of doing this but these are the main ways I know

I will hopefully get it onto more systems soon like debian (apt), fedora (dnf) and more (hopefully)


MacOS

There are 2 Main ways to Install MicroBridge on macOS

Homebrew(Brew)

Install HomeBrew if not installed.

Run this in terminal:

brew tap Snowman-scott/microbridge https://github.com/Snowman-scott/MicroBridge
brew trust Snowman-scott/microbridge
brew install microbridge-lmd
Binary Download

You can go to the Releases page and download the MB_MacOS_zip. (M Series processors Only!)

Note: This won't allow you to type microbridge anywhere on your machine and run it CLI, The binary is only recommended if you plan on only using the GUI (User interface) I recommend using the brew install above, pypi, or installing from source if you plan on using the CLI.


Windows

As of Current there is only one main way of installing MicroBridge on Windows

Binary Download

You can go to the Releases page and download the MB_Windows_zip. (x86_64)

Note: This won't allow you to type microbridge anywhere on your machine and run it CLI, The binary is only recommended if you plan on only using the GUI (User interface) I recommend using pypi, or installing from source if you plan on using the CLI.

Choco or Scoop

I may add these packages onto choco or scoop later on


pip & pipx

Using pip is not recommended on Linux unless you want to use a virtual environment, I recommend linux and MacOS users to look in the Linux and macOS areas of this README for more appropriate installation.

pip

To install with pip make sure you have python installed
Then run:

pip install microbridge --break-system-packages

Note: I do not recommend Doing this on MacOS or Linux as it can break your system python

pipx

To install with pipx make sure you have python installed, If you do not have python installed then install python3.12 or above. Then install pipx.

Then run:

pipx install microbridge-lmd

Install from source

Make sure python 3.12 or above is installed.

You will also want git.

First Clone the Repo:

git clone https://github.com/Snowman-scott/MicroBridge.git

Then move into the cloned dir:

cd MicroBridge

Then Setup a venv:

python3 -m .venv venv

Activate the vnev:

source .venv/bin/activate

Then just install microbridge:

pip install -e .

Note: This sets up MicroBridge in a virtual environment(venv), this means the code will only be able to be ran when you have that specific venv active. I recommend Installing via pip or pipx if you plan to use this day to day, From source is preferred for development


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 .[dev]
pytest

to set up the venv and run the tests (or use python run_tests.py for the summary table output)


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

microbridge_lmd-0.2.2.tar.gz (291.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microbridge_lmd-0.2.2-py3-none-any.whl (282.8 kB view details)

Uploaded Python 3

File details

Details for the file microbridge_lmd-0.2.2.tar.gz.

File metadata

  • Download URL: microbridge_lmd-0.2.2.tar.gz
  • Upload date:
  • Size: 291.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for microbridge_lmd-0.2.2.tar.gz
Algorithm Hash digest
SHA256 455bfee331cc11e8f4dadcad7cd9ab349e48d5854e3ad4294307ad41fef2acb8
MD5 4deb9113bf59ed91b9ebeceb9eca7795
BLAKE2b-256 794ab10abe90eb0cb3f0818b75cf0391ba0b64bcebab40be5999683839d95c87

See more details on using hashes here.

File details

Details for the file microbridge_lmd-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for microbridge_lmd-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 122f52530f410f62425a3cac8e8469a2bf851ac1d28ff79ec2b914402e2e0f29
MD5 d2323f50d97e3734288dff7620739544
BLAKE2b-256 c37b5e4838934b99a735d37a097d358929037695315bb02a4f216853d2cba8a8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.3

2 files

This release

0.2.2 This release

2 files

0.2.1

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page