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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cardiacmodelgenerator-0.1.7.tar.gz.
File metadata
- Download URL: cardiacmodelgenerator-0.1.7.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cab49d73a88868e4e7cdce4080acc792f273024f495f2726349bd36cb088b52e
|
|
| MD5 |
f8380c170c6b399176a18aea9ca9cfa1
|
|
| BLAKE2b-256 |
dd68254e4eb88abc03c26673ac1d27fd8b883baa57fc8ba476ac8e4b595e123b
|
File details
Details for the file cardiacmodelgenerator-0.1.7-py3-none-any.whl.
File metadata
- Download URL: cardiacmodelgenerator-0.1.7-py3-none-any.whl
- Upload date:
- Size: 5.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63a17854101e4a263e7418c41d2e5033cbabf0bb8852b7eaea1d828c95c5ad8f
|
|
| MD5 |
2917a2f2aaada7bcd231b64b334aed1a
|
|
| BLAKE2b-256 |
2668d76bef42c6977cd094a84fc739af366bb3a4a4f2ad5fcd543a670f79299d
|