MedViz is a Python package for medical image visualization. It provides a set of functions for visualizing medical images and masks. The package is built on top of the matplotlib and nibabel packages.
Installation
To install the package, use pip:
pip install medviz
Usage
To use the package, import it in your Python code:
import medviz
medviz.layered_plot(image_path="dataset/1-1.nii", mask_paths=["dataset/small_bowel.nii", "dataset/1-1-label.nii"], mask_colors=["red", "yellow"], title="Layered Plot")
The layered_plot function creates a layered plot of an image and one or more masks. The masks are overlaid on top of the image using the specified colors. The resulting plot can be used to visualize the location of structures or regions of interest in the image.
import medviz
medviz.gif(
image_path="dataset/1-1.nii",
mask_paths=[
"dataset/small_bowel.nii",
"dataset/1-1-label.nii",
"dataset/vertebrae_L3.nii.gz",
"dataset/vertebrae_L4.nii.gz",
"dataset/vertebrae_L5.nii.gz",
],
mask_colors=["red", "yellow", "green", "blue", "purple"],
title="Expert Annotations",
interval=70,
start_slice=30,
end_slice=130,
save_path="animation.gif",
)
The gif function creates an animated GIF of an image and one or more masks. The masks are overlaid on top of the image using the specified colors. The resulting GIF can be used to visualize the location of structures or regions of interest in the image.
GitHub repository: [https://github.com/mohsenhariri/medviz](https://github.com/mohsenhariri/medviz)
Metadata
Release files for medviz 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| medviz-1.2.0.tar.gz | 46.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| medviz-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.0 kB
Release files / medviz-1.2.0.tar.gz
| Download URL | medviz-1.2.0.tar.gz |
|---|---|
| Size | 46.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57a6c140e2d2c95585a93f5b2043429faaae7d6a93e6400f3b800c198a7257ed
|
|
BLAKE2b-256 checksum How to use checksums |
02946560bb3f5d98b5841a907804b92fc3cd76ed0045f1b21243b804bc6cc14d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / medviz-1.2.0-py3-none-any.whl
| Download URL | medviz-1.2.0-py3-none-any.whl |
|---|---|
| Size | 56.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e0e9742c6e6d9321bb7d8a1146e99e09dc027b21bfeacfe3f6662cff2f4187a
|
|
BLAKE2b-256 checksum How to use checksums |
6ebbf19bd2be9bf70357f2da2dbd699ed7bba02574f0e2087f645531e630401e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|