Metadata service for digital pathology WSI scans
Project description
Ballatrix Metadata
A microservice managing metadata of whole slide image (WSI) scans for digital pathology applications.
It operates on a storage sqlite database created by the bellastore package.
This database is particularly helpful when querying metadata of specific slides for downstream tasks
via our custom digital pathology API bellapi.
Installation
The source code is currently hosted under https://github.com/spang-lab/bellameta.
Binary installers are available at PyPi.
pip install bellameta
Usage
Under docs/.env you find a simple template for an .env file that needs to be located in your current environment and hold
the path to a yaml config file. A minimal config file is provided under docs/bellameta.yaml.
This config defines the valid Cohort and Task types accesible by the package:
from bellameta.types import Cohort
print(Cohort.list())
In order to add metadata to a cohort of scans, a child class of the abstract base class Metadata needs to be implemented:
from pamly import Diagnosis, Stain
from bellameta.database import Db
from bellameta.types import Cohort, Task
from bellameta.base_metadata import Metadata
class Example(Metadata):
'''
An example class inheriting from Metadata.
We imagine this class to implement the metadata of a new cohort of scans that just arrived from the clinic.
'''
def __init__(self, db: Db):
# here we need to specify the absolute path to the ingress directory as given in the ingress table
# this serves as the identifier for our cohort
super().__init__(db, '/tmp/tmpytfd3_47/example_cohort')
def get_cohort(self, hash):
# typing for cohorts is provided via bellameta/types
return Cohort.Example.to_string()
def get_stain(self, hash):
# typing for stains is provided via pamly
return Stain.to_string(Stain('HE'))
def get_task(self, hash):
# typing for tasks is provided via bellameta/types
return [Task.Subtyping.to_string()]
In order to write this metadata to the database the class needs to be instantiated:
example = Example(db=db)
example.write_many()
Documentation
Along with the source code, under docs/demo.ipynb, we provide a demo leading you through the features of this package via an application scenario.
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
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 bellameta-1.1.0.tar.gz.
File metadata
- Download URL: bellameta-1.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36cefc00fdc8235d5c941a0bd2ac00447b1767fc38392eeccdef116b66dec411
|
|
| MD5 |
8f6e2d60a2f8d4c16e8fe7550e6e8829
|
|
| BLAKE2b-256 |
c314d04fdf7fee8457eeee9a6b43c323d121e7d27b3011afb8150aed04941af5
|
File details
Details for the file bellameta-1.1.0-py3-none-any.whl.
File metadata
- Download URL: bellameta-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dcca01c1931aebb8a800cae69a512c5562bc9e884cd3143679691e05709eaae
|
|
| MD5 |
02334e9e85b006d6d06c6981e490a97c
|
|
| BLAKE2b-256 |
2b65290cc5f0dea60003d0fade43c7e2c5c5034f68743b959e2acb614a15bd23
|