Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ailungmeasure-0.1.2.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

AILungMeasure-0.1.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file ailungmeasure-0.1.2.tar.gz.

File metadata

  • Download URL: ailungmeasure-0.1.2.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

Hashes for ailungmeasure-0.1.2.tar.gz
Algorithm Hash digest
SHA256 52c9a9a1a9f448215399b4927923bd46683e1620c91bc26da69c762a1a6497be
MD5 c35315d822b9bd8c03c495e0effd8d85
BLAKE2b-256 4f67f404ea9504fbbdca53acf4a4242919c350f21fff4e7d95e85efecd901f9a

See more details on using hashes here.

File details

Details for the file AILungMeasure-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: AILungMeasure-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 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

Hashes for AILungMeasure-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 442039684e3d593f43601502aa632929226a64dd9818d6c0ee68d1825a612ff8
MD5 8c2bd61ae487a69ec1d94cf8fad2823d
BLAKE2b-256 a6db7fb0aa4f974a8a039aeafe04e9ed8ab2215c0251c090b78d0e5888ad183b

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