Skip to main content

Generate 3D model from clinical cardiac imaging data

Project description

CardiacModelGenerator

Overview

CardiacModelGenerator.py is a Python-based application designed for viewing slice overlays, converting pixels to universal coordinates, generating point clouds, and generating/enhancing tetrahedral meshes. Specifically, this is for cardiac models and uses MRI DICOM images and nifti masks.

Features

Image/Mask Viewer: Allows for a user to scroll through overlays of a mask and image Point Clouds: Can generate point cloud based on user inputs Universal Coordinates: Convers Mask/Image data to universal coordinates based on Dicom metadata Mesh: Allows for tetrahedral meshes from user inputs

Requirements

The script requires the following Python libraries:

wx numpy pydicom nibabel cv2 (OpenCV) random matplotlib pyvista Install dependencies using:

pip install wxpython numpy pydicom nibabel opencv-python matplotlib pyvista How to Use

Input Data: Prepare images in a folder (should be dicoms). Have masks as nifti.

Run the Script: Execute the script in your Python environment: CardiacModelGenerator.py

Interactive GUI: The script uses wx for GUI, allowing you to interactively select data and configure settings. Visualize Point Clouds: Choose from multiple colormaps and adjust parameters like point_size and tol. Functions

generate_point_cloud Generates a 3D point cloud from input coordinates and masks.

Parameters: coords1, coords2, coords3: Coordinate arrays. masks1, masks2, masks3: Corresponding mask arrays. whichmask: Mask value to extract (default: 1). tol: Tolerance for coordinate matching (default: 0.1). colormap_name: Colormap for visualization (default: "viridis"). point_size: Size of the points in the visualization (default: 5). Returns: A PyVista PolyData object representing the cleaned point cloud. Example Usage

Execute GUI. The user can:

Select Dicom Image Folder User selects mask for that folder User clicks view segmentation User selects generate Point Cloud User selects generate mesh User selects fix mesh User can look at quality by clicking mesh quality Developed by vinayjani. Contributions and suggestions are welcome!

License

This project is licensed under the MIT License. See LICENSE for details.

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

cardiacmodelgenerator-0.1.1.tar.gz (6.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cardiacmodelgenerator-0.1.1-py3-none-any.whl (5.1 MB view details)

Uploaded Python 3

File details

Details for the file cardiacmodelgenerator-0.1.1.tar.gz.

File metadata

  • Download URL: cardiacmodelgenerator-0.1.1.tar.gz
  • Upload date:
  • Size: 6.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for cardiacmodelgenerator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 df4539f0d749277a3f9a3e43a5d7eae86a0fbdaeb781b843e88f68643ed26c00
MD5 4f857d2fa10fa0891cb04ce2e074d4b8
BLAKE2b-256 b00b8dca5e211cd9fd737526103c7e388884b51b70b7603055abb7a21c37efb3

See more details on using hashes here.

File details

Details for the file cardiacmodelgenerator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cardiacmodelgenerator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 511eda15493cac888217d9717e2bbfe7f50d69aec5d1f749c1f9b14a6919b9dc
MD5 4caa2472153079f40f82f92f34c60cab
BLAKE2b-256 f59487d3695021638e31ffab44fba9fc8aa47b09f29c18de8c410f4b141bf32a

See more details on using hashes here.

Supported by

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