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.
How to Use
- First install via
pip install CardiacModelGenerator
- Then run the following in python either in an IDE or via terminal:
from CardiacModelGenerator import CardiacModelGenerator
CardiacModelGenerator.main()
If you are using macOS or Apple Silicon:
Use pythonw. If not wx will not work
An example is below:
If successfully run, the following should appear:
-
Dowload the files in the example files. There should be a patient27 folder which has dicoms and a nii file.
-
Click Load ImageView1 and navigate/click to the patient27 folder:
- Do the same with the LoadSegs; however, navigate and click the nii file:
-
After this you can use the tool. First you can click View Seg1 and scroll through the overlays.
-
Now, you can generate the point cloud, tetra mesh, clean the mesh, and get the quality metric. Ensure you do this in this order. To access these functions, go to the mesh processing at the top.
-
For the point cloud, you have to give parameters. Examples of parameters is below:
-
After you make a mesh by clicking the make tetra mesh option. You can clean the mesh. Example parameters are below:
-
Finally, you can click the extract mesh quality.
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
All the requirements should be installed when you pip install the package. <\u>
If there are issues:
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
Input Data: Prepare images in a folder (should be dicoms). Have masks as nifti. Examples of data are given in the github.
GUI
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. 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.9.tar.gz.
File metadata
- Download URL: cardiacmodelgenerator-0.1.9.tar.gz
- Upload date:
- Size: 31.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 |
d8102b3798157e86d7e2f0e74a6bdcce90466e0321df56f9459867636f3b1b41
|
|
| MD5 |
1bf8210e300b132b5bfe28953c2154ec
|
|
| BLAKE2b-256 |
c86ba23a95ff963e84f8773f6aa22d1ac44afa1dcc93c8368be99a8023d7057a
|
File details
Details for the file cardiacmodelgenerator-0.1.9-py3-none-any.whl.
File metadata
- Download URL: cardiacmodelgenerator-0.1.9-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 |
1ee57a4d635a7236fdc8c0c9e22bd5c8c22f2fd18298c0f6665ea62f96da7ee5
|
|
| MD5 |
8d5d7b139bb3f95c52486d283d421ee8
|
|
| BLAKE2b-256 |
a338ce606fb5382ba48886b3b7acaa7b0381dc26c2a279cc90f2be95b5c1ab94
|