Skip to main content

PrismToolBox

PrismToolBox is a comprehensive toolkit designed to streamline the process of working with digital pathology images. It provides a set of utilities and functionalities that simplify tasks such as reading slides, extracting patches, and embedding slides. It also provides useful functions to import/export data on QuPath.

The toolkit is still under development, and some features may not be fully implemented. If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.

Features

  • Slide Reading: Supports multiple backends for reading slides, including OpenSlide and TiffSlide.
  • Patch Extraction: Extracts patches from slides at various magnification levels.
  • Slide Embedding: Uses pre-trained models to generate embeddings from patches, facilitating downstream tasks like clustering or classification (in progress).
  • Nuclei segmentation: Extracts nuclei using cellpose for H&E and SOP for IHC brighfield images.

Installation

To install PrismToolBox, run the following command in your terminal:

pip install prismtoolbox

To install PrismToolBox embedding and nuclei utilitaries, please run the following command:

pip install 'prismtoolbox[emb, seg]'

Usage

Here's a basic example of how to use PrismToolBox:

from prismtoolbox import WSI

# Initialize the reader
WSI_object = WSI(slide_path="path_to_your_slide", engine="openslide")

# Extract tissue contours
params_detect_tissue = {"seg_level": 4, "window_avg": 30, "window_eng": 5, "thresh": 90, "area_min": 1.5e3}

WSI_object.detect_tissue(**params_detect_tissue)

# Extract patches and save them as jpg images
params_patches = {"patch_size": 256, "patch_level": 0,"mode": "contours", "contours_mode": "four_pt_hard"}

WSI_object.extract_patches(**params_patches)
WSI_object.save_patches("path_to_folder", file_format="jpg")

For more detailed usage instructions and examples, please refer to the documentation.

Contributing

Contributions to PrismToolBox are welcome! Please open an issue or submit a pull request to propose changes or additions.

License

PrismToolBox is licensed under the BSD 3-Clause License. See LICENSE for more information.

Metadata

Release files for prismtoolbox 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prismtoolbox 0.2.0
File Size Uploaded
prismtoolbox-0.2.0.tar.gz 62.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prismtoolbox 0.2.0
File Interpreter ABI Platform
prismtoolbox-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 139.2 kB

Release files / prismtoolbox-0.2.0.tar.gz

Download URL prismtoolbox-0.2.0.tar.gz
Size 62.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2c77de19cd620b19d8f9bc61369aac60127b084d954de6832a9c59098c766a72
BLAKE2b-256 checksum
How to use checksums
5030a17a99ef601bb891e1b1e7928f06216f33058b9ec1074bf5eabb0ed52e95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.10.11 Linux/6.11.0-1018-azure

Release files / prismtoolbox-0.2.0-py3-none-any.whl

Download URL prismtoolbox-0.2.0-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a15188209b18724cb4c9311ba007d35836251e0aee88a0ef36d1a32d630bdf2b
BLAKE2b-256 checksum
How to use checksums
68c6cbfc0995c5a4f287b1bde2e18d76fe72d98a24b8a6099d19927fc1b54054
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.10.11 Linux/6.11.0-1018-azure

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release 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