Skip to main content

Medical Image Visualization Tool 🐍🚀🎉🦕

Project description

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)

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

medviz-1.2.0.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

medviz-1.2.0-py3-none-any.whl (56.5 kB view details)

Uploaded Python 3

File details

Details for the file medviz-1.2.0.tar.gz.

File metadata

  • Download URL: medviz-1.2.0.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for medviz-1.2.0.tar.gz
Algorithm Hash digest
SHA256 57a6c140e2d2c95585a93f5b2043429faaae7d6a93e6400f3b800c198a7257ed
MD5 9fa2ef6bb8d0dfba9c0f3867c2bb0b64
BLAKE2b-256 02946560bb3f5d98b5841a907804b92fc3cd76ed0045f1b21243b804bc6cc14d

See more details on using hashes here.

File details

Details for the file medviz-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: medviz-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 56.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for medviz-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0e9742c6e6d9321bb7d8a1146e99e09dc027b21bfeacfe3f6662cff2f4187a
MD5 5f4fe8d9fe4c7d4feae36c42d64cd330
BLAKE2b-256 6ebbf19bd2be9bf70357f2da2dbd699ed7bba02574f0e2087f645531e630401e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page