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.3.tar.gz (11.4 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.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ailungmeasure-0.1.3.tar.gz
  • Upload date:
  • Size: 11.4 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.3.tar.gz
Algorithm Hash digest
SHA256 1d88967b503c0cd95617754db1c96dbca04fa763c4c7bb8baccd1111a8c8789b
MD5 bf53aa6fa8ac07f4e3b7a69e06b6dba5
BLAKE2b-256 0ada1e73d1fca2deaa9fa2f9b667cdfcb07ffac9bfe68b9478a2cef62c48745f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: AILungMeasure-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fd4062afbcdda5e046500bbcecd598761af148cfc609501a330c0f0499ed5fb9
MD5 43bca976e76571799b966e05bc2adb7c
BLAKE2b-256 08ac6141157c13fc8e9cbfd8cb0d3b801427311b146765ce571236fd9739a114

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