Skip to main content

Toolbox for histopathology image analysis

Project description

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.

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

prismtoolbox-0.0.2.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

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

prismtoolbox-0.0.2-py3-none-any.whl (62.7 kB view details)

Uploaded Python 3

File details

Details for the file prismtoolbox-0.0.2.tar.gz.

File metadata

  • Download URL: prismtoolbox-0.0.2.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Linux/6.5.0-1021-azure

File hashes

Hashes for prismtoolbox-0.0.2.tar.gz
Algorithm Hash digest
SHA256 35392d7cf01b3e741c6f9583cff9f1cc2c0632e45ed338c70cd54b9434bd9868
MD5 af5c8d66cff9f580ffa5a0c10345cb57
BLAKE2b-256 51e55ea5e435a50c33c9429812a72e0884066b1e9c54dedd2c2d33c4b3f092a6

See more details on using hashes here.

File details

Details for the file prismtoolbox-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: prismtoolbox-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 62.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Linux/6.5.0-1021-azure

File hashes

Hashes for prismtoolbox-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0011568a6bbfc0dde5babdfa7f6b083a4ca4bd750ce706e448012714975a34b4
MD5 6312c1b473df0129b320e020e9f44c3d
BLAKE2b-256 9ca4a0e82f47096a3f8e72fea5817d00a9773d667c19d26ee3f209afdb1e0985

See more details on using hashes here.

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