Skip to main content

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)

Source distribution for medviz 1.2.0
File Size Uploaded
medviz-1.2.0.tar.gz 46.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for medviz 1.2.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.8.8

2 release files

0.8.4

2 release files

0.1.1

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