Some utilities to visualise medical images and masks
Project description
Tools to visualise medical images.
Installation
To install, run
pip install medvis
Example
The following example will plot a PET/CT image with alpha blended PET signal ontop of a grayscale CT image. The outline of two masks are shown with a legend that specifies what the different colours represent.
import matplotlib.pyplot as plt
import medvis
ct_image = ...
pet_image = ...
binary_true_mask = ...
binary_pred_mask = ...
true_colour = "tomato"
pred_colour = "skyblue"
blended_pet_image = medvis.apply_cmap_with_blend(pet_image, 'magma')
true_mask_outline = medvis.create_outline(binary_true_mask, width=2, colour=true_colour)
pred_mask_outline = medvis.create_outline(binary_pred_mask, width=2, colour=pred_colour)
fig, ax = plt.subplots()
ax.imshow(ct_image, cmap='gray')
ax.imshow(blended_pet_image)
ax.imshow(true_mask_outline)
ax.imshow(pred_mask_outline)
medvis.create_legend([true_colour, pred_colour], ["True mask", "Predicted mask"], ax=ax)
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
medvis-0.0.1.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file medvis-0.0.1.tar.gz
.
File metadata
- Download URL: medvis-0.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eefa44ddcfa35a28cf9ca911727265336abf90f1df76c8eac9ecd93708b17c1 |
|
MD5 | bad2486e87b450d53bfb919551f9343c |
|
BLAKE2b-256 | e4329afb476a15964d16b5c8a162b76c7f4a53283b8909c9e090393cb3e5bb79 |
File details
Details for the file medvis-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: medvis-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac9fbc701ee1a3672816a2fb4cca02e9073f6561718b1242ba997268545c5348 |
|
MD5 | dcc66717dcdf3c5aa6888e5b94b71a32 |
|
BLAKE2b-256 | 2e58b68575522f4922bf9bdbe3fb8440b0637ea61b623b4f2d65ecc45f7c3699 |