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 hashes)
Built Distribution
Close
Hashes for medvis-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac9fbc701ee1a3672816a2fb4cca02e9073f6561718b1242ba997268545c5348 |
|
MD5 | dcc66717dcdf3c5aa6888e5b94b71a32 |
|
BLAKE2b-256 | 2e58b68575522f4922bf9bdbe3fb8440b0637ea61b623b4f2d65ecc45f7c3699 |