Skip to main content

A laboratory for exploring quantitative bioimage analysis in Python

Project description

QuBaLab

Coverage Tests Actions

⚠️ Important

  • 🆕 This is a new Python package for interacting with QuPath!
  • 💻 For a stable, established solution, check out paquo (although we aim to meet different needs, see below)
  • 🐛 Please report any bugs through the issues page

This is a Python package for exploring quantitative bioimage analysis... especially (but not exclusively) in combination with QuPath.

The name comes from Quantitative Bioimage Analysis Laboratory. This is chosen to be reminiscent of QuPath (Quantitative Pathology), but recognizes that neither is really restricted to pathology.

Why use QuBaLab?

QuBaLab isn't QuPath - they're just good friends.

  • QuPath is a user-friendly Java application for bioimage analysis, which has some especially nice features for handling whole slide and highly-multiplexed images. But lots of bioimage analysis research is done in Python, and is hard to integrate with QuPath.
  • QuBaLab's main aim is to help with this, by providing tools to help exchange data between QuPath and Python without any direct dependency on QuPath and Java. It therefore doesn't require QuPath to be installed, and can be used entirely from Python.

QuBaLab doesn't share code with QuPath, but is uses many of the same conventions for accessing images and representing objects in a GeoJSON compatible way. By using the same custom fields for things like measurements and classifications, exchanging data is much easier.

How does QuBaLab compare to paquo?

paquo is an existing library linking Python and QuPath that provides a pythonic interface to QuPath.

We think paquo is great - we don't want to replace it!

Here are the 3 main differences as we see them:

  1. Target audience
    • paquo is written mostly for Python programmers who need to work with QuPath data
    • QuBaLab is written mostly for QuPath users who want to dip into Python
  2. Convenience vs. Efficiency
    • paquo is based on JPype to provide full & efficient access to Java from Python
    • QuBaLab is based on Py4J to exchange data between Java & Python - preferring convenience to efficiency
  3. Pixel access
    • paquo is for working with QuPath projects and objects - accessing pixels is beyond its scope (at least for now)
    • QuBaLab enables requesting pixels as numpy or dask arrays, and provides functions to convert between thresholded images & QuPath objects

So if you're a Python programmer who needs an intuitive and efficient way to work with QuPath data, use paquo.

But if you're a QuPath user who wants to switch to Python for some tasks, including image processing, you might want to give QuBaLab a try.

Getting started

You can find the documentation on github pages.

This project contains the QuBaLab package in the qubalab folder. Take a look at the Installation section to install it.

Some notebooks in the notebooks folder demonstrate how to use QuBaLab. If you want to run them, you can take a look at the Development section. If you just want to browse the content in them, look at the documentation.

Installation

QuBaLab is on PyPI, so you can install it with pip:

pip install --upgrade qubalab

Development

This part is useful if you want to run the notebooks or contribute to this project.

First, run:

git clone https://github.com/qupath/qubalab.git         # clone this repository
cd qubalab                                              # go to the project directory
python -m venv ./.venv                                  # create a local virual environment
source ./.venv/bin/activate                             # activate the venv
pip install -e ".[dev,test]"                  # install qubalab (-e means changes are loaded dynamically)
jupyter lab .                                           # to start the Jupyter notebooks
pytest                                                  # to run unit tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qubalab-0.1.0.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

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

qubalab-0.1.0-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file qubalab-0.1.0.tar.gz.

File metadata

  • Download URL: qubalab-0.1.0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for qubalab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a7c82f2e3ee381ba25d312235b6dd8003088e4be16c71b612a825251e3db5482
MD5 dd5d373dda6b3e74a2922611fc0cd02f
BLAKE2b-256 686501c092a62ab7fea26de3f69d2869823bf54d15690d333d9a3aea721b7fbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for qubalab-0.1.0.tar.gz:

Publisher: publish-release.yml on qupath/qubalab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qubalab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qubalab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for qubalab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cef2327da6f28d6018d145285d3988588af1c4cabb1f3c3be2b73f652adef16e
MD5 96c50880fb99252cac2027773b50160c
BLAKE2b-256 d1c2825ca3940b9cbca080c2a29e43bdac1c292ec51ef87d193cdb6ecfe42c93

See more details on using hashes here.

Provenance

The following attestation bundles were made for qubalab-0.1.0-py3-none-any.whl:

Publisher: publish-release.yml on qupath/qubalab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page