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.

How to Use

  1. First install via
pip install CardiacModelGenerator
  1. 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:

My Picture

If successfully run, the following should appear: My Picture

  1. Dowload the files in the example files. There should be a patient27 folder which has dicoms and a nii file.

  2. Click Load ImageView1 and navigate/click to the patient27 folder:

My Picture

  1. Do the same with the LoadSegs; however, navigate and click the nii file:

My Picture

  1. After this you can use the tool. First you can click View Seg1 and scroll through the overlays. My Picture

  2. 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. My Picture

  3. For the point cloud, you have to give parameters. Examples of parameters is below: My Picture

  4. After you make a mesh by clicking the make tetra mesh option. You can clean the mesh. Example parameters are below: My Picture

  5. 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


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.9.tar.gz (31.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.9-py3-none-any.whl (5.1 MB view details)

Uploaded Python 3

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

Hashes for cardiacmodelgenerator-0.1.9.tar.gz
Algorithm Hash digest
SHA256 d8102b3798157e86d7e2f0e74a6bdcce90466e0321df56f9459867636f3b1b41
MD5 1bf8210e300b132b5bfe28953c2154ec
BLAKE2b-256 c86ba23a95ff963e84f8773f6aa22d1ac44afa1dcc93c8368be99a8023d7057a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cardiacmodelgenerator-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1ee57a4d635a7236fdc8c0c9e22bd5c8c22f2fd18298c0f6665ea62f96da7ee5
MD5 8d5d7b139bb3f95c52486d283d421ee8
BLAKE2b-256 a338ce606fb5382ba48886b3b7acaa7b0381dc26c2a279cc90f2be95b5c1ab94

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