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. When importing the package, the model will be automalically downloaded and loaded.

import AILungMeasure

Segmenting Lung Images

To get the lung mask, use the get_mask function:

input_image = '/path/to/your/image' # can be dicom, jpg, png, etc.. 
mask = AILungMeasure.get_mask(input_image)

To visualize the mask, use the show_mask function:

mask = AILungMeasure.show_mask(input_image)
 
# or plot it 
matplotlib.pyplot.imshow(mask)

Get Measurements

To plot the lung measurements, use the show_measurments function:

AILungMeasure.show_measurments(input_image , dpi=200) # dpi controls the image resolution

To get the measurments, use the get_measurments function:

measurments = AILungMeasure.get_measurments(input_image)

Note that this will work if the input_image is dicom, which already includes the pixel size in its meta data. The reported measurments will be in mm.
If you are using jpg, png, etc.. then the returned measurments will be in pixels.

License

This project is licensed under the Creative Commons ATTRIBUTION-NONCOMMERCIAL-SHAREALIKE 4.0 INTERNATIONAL - see the LICENSE file for details.

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.4.tar.gz (12.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.4-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ailungmeasure-0.1.4.tar.gz
  • Upload date:
  • Size: 12.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.4.tar.gz
Algorithm Hash digest
SHA256 35a5c28544b50babddbd6de5b7909c493bb0f436105043002991b96b643b1ba9
MD5 73537bf581a79792c18a45101376bcd6
BLAKE2b-256 8535dd90187159dcac4d2b15854da81dadc04588cb06967b6d64d81780cbd978

See more details on using hashes here.

File details

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

File metadata

  • Download URL: AILungMeasure-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.0 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e2403161ba90cfdece49044ada92f2065a28010d18e06a08bf1cad9f53ba6f7
MD5 a3b5c493741a81be78105e3f885bb7e9
BLAKE2b-256 2da209300f93cc63dc7146ca334b60bd2f2f9edc59ffb321a5fa48a14d4406fa

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