Automated lung size measurements using deep learning and computer vision on portable chest radiographs.
Project description
AILungMeasure
AILungMeasure is a Python package designed for automated lung size measurements using deep learning and computer vision on portable chest radiographs. This package aims to improve accuracy, reduce variability, and streamline the lung transplantation size matching process.
Features
- Automated lung mask extraction from chest radiographs
- Feature points detection to generate lung height and width measurements
- Validation against measurements reported by radiologists
- Robust performance even with technically challenging radiographs
Installation
You can install AILungMeasure via pip:
pip install AILungMeasure
Usage
Loading the Model
AILungMeasure includes a pre-trained model for lung size measurements. You can load the model using:
import AILungMeasure
# Load the pre-trained model
model = AILungMeasure.load_model()
Segmenting Lung Images
To segment lung images and generate measurements, use the segment function:
im_folder = '/path/to/your/dicom/images'
imagename = os.path.join(im_folder, 'example_image')
out_name = './output_directory'
# Segment the lung image
AILungMeasure.segment(imagename, out_name, model=model, equalize=1, out_dicom=1)
Plotting Measurements
To plot the lung measurements, use the plot_measurments function:
AILungMeasure.plot_measurments(out_name, imname=imagename, plot=1, alpha=0.5, cmap='jet', radius=40)
Example Script
Here’s a complete example script using AILungMeasure:
import AILungMeasure
import os
# Load the pre-trained model
model = AILungMeasure.load_model()
# Example paths (update these paths as needed)
im_folder = '/path/to/your/dicom/images'
imagename = os.path.join(im_folder, 'example_image')
out_name = './output_directory'
# Perform segmentation
AILungMeasure.segment(imagename, out_name, model=model, equalize=1, out_dicom=1)
# Plot measurements
AILungMeasure.plot_measurments(out_name, imname=imagename, plot=1, alpha=0.5, cmap='jet', radius=40, mode=1)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please fork the repository and use a feature branch. Pull requests should be made against the main branch.
Contact
For questions or issues, please contact Mostafa Ismail at mostafa.ismail.k@gmail.com.
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 ailungmeasure-0.1.1.tar.gz.
File metadata
- Download URL: ailungmeasure-0.1.1.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.60.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0fd3eb1b24f9186e12b699bf77d03b4469aa61f393b87f464b926ae066c9d09
|
|
| MD5 |
2e0cf9be8553151464ab60681be42f95
|
|
| BLAKE2b-256 |
fefb61443cb978026a7cf00d8463637c22d442422c9f1f65989b7e08c8fc31ed
|
File details
Details for the file AILungMeasure-0.1.1-py3-none-any.whl.
File metadata
- Download URL: AILungMeasure-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.60.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14242dc74863cef82f90b1f37d65bc603892340739d8fb58e5ddc8d88c82aa01
|
|
| MD5 |
34a487695fe64e7d9cb3fa8a5329383e
|
|
| BLAKE2b-256 |
75486a674e41941019855c5925cc6e2e570e0ff539310f3d68c8433cbf34e026
|